DOC
|
Where is the "Ask a question"? This new update has me completely lost!!!
... View more
01-13-2021
01:00 PM
|
0
|
0
|
28067
|
POST
|
How can I check each row for 2 values [counties & township]? Loop and if they match the dictionaries below, continue the If True statement than do something. My script right now is super slow. Processed 2 counties in 3 hours. #Import system modules
import arcpy
from arcpy import env
import os
import time
counties = ["RIC",\
"ASD",
"ATB",
"TUS",
"HOL",
"STA",
"SUM",
"CAR",
"TRU",
"WAS",
"FAI",
"COL",
"WAY",
"GEA",
"LAK",
"HOC",
"MRW",
"MAR",
"MAH",
"FRA",
"GUE",
"HAS",
"POR",
"CRA",
"CUY",
"COS"]
townships = ["SANDUSKY",\
"MILTON",
"WELLER",
"MORGAN",
"ORWELL",
"LENOX",
"MONTGOMERY",
"MADISON",
"MIFFLIN",
"WAYNE",
"WALNUT CREEK",
"ROME",
"PERRY",
"PIKE",
"SPRINGFIELD",
"TWINSBURG",
"MONROE",
"SUGAR CREEK",
"TUSCARAWAS",
"AUGUSTA",
"BROWN",
"ORANGE",
"ROSE",
"MESOPOTAMIA",
"WARREN",
"FAIRFIELD",
"MILL",
"SANDY",
"FEARING",
"VIOLET",
"SALEM",
"BUTLER",
"KNOX",
"ADAMS",
"MUSKINGUM",
"SALT CREEK",
"SUGAR CREEK",
"WAYNE",
"WATERFORD",
"WATERTOWN",
"MONTVILLE",
"GREEN",
"MILTON",
"PAINT",
"WOOSTER",
"BAUGHMAN",
"CHESTER",
"CHIPPEWA",
"MADISON",
"PAINESVILLE",
"PERRY",
"CONCORD",
"FALLS",
"NORTH BLOOMFIELD",
"BIG ISLAND",
"GRAND PRAIRIE",
"CANFIELD",
"ELLSWORTH",
"AUSTINTOWN",
"FRANKLIN",
"WESTLAND",
"MADISON",
"MONROE",
"TULLY",
"SCOTT",
"NORTH",
"RIPLEY",
"MARION",
"PLEASANT",
"VALLEY",
"SALT CREEK",
"GREENFIELD",
"AUBURN",
"LIBERTY",
"CHARDON",
"EAST UNION",
"BERLIN",
"NEWBURY",
"PARKMAN",
"PAINT",
"BLOOM",
"HARDY",
"DEERFIELD",
"FRANKLIN",
"TROY",
"ATWATER",
"MECHANIC",
"SUFFIELD",
"WINDHAM",
"JACKSON",
"HAMBDEN",
"WASHINGTON",
"WHETSTONE",
"URBAN",
"URBAN",
"URBAN",
"MANTUA",
"HUNTSBURG",
"MUNSON",
"SOUTHINGTON",
"RANDOLPH",
"PRAIRIE",
"MILTON",
"SUGAR CREEK",
"CLARK",
"CRAWFORD",
"THOMPSON",
"POLK",
"NEWTON",
"URBAN",
"BETHLEHEM",
"FRANKLIN",
"LAWRENCE",
"SPRINGFIELD",
"WARREN",
"HOWLAND",
"FARMINGTON",
"URBAN",
"BRACEVILLE",
"BAZETTA",
"JACKSON",
"BRISTOL",
"URBAN",
"PERRY",
"CANAAN",
"CHAMPION",
"BLOOMFIELD",
"BERLIN",
"BROOKFIELD",
"LAWRENCE",
"MIDDLEFIELD",
"BURTON",
"LEROY",
"HAMILTON"]
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
lyr = arcpy.mapping.ListLayers(mxd, "ohioGrids", df)[0]
for lyr in arcpy.mapping.ListLayers(mxd, "*"):
if lyr.name == "ohioGrids":
for a in counties:
b = "%s" % (a) #
#print ("%s" % (b))
for c in townships:
d = "%s" % (c) #
#print ("%s" % (d))
arcpy.SelectLayerByAttribute_management("ohioGrids", "CLEAR_SELECTION")
cnty = '"COUNTY_CD" = \'%s\'' % b
seperator = " AND "
twpship = '"TOWNSHIP_N" = \'%s\'' % c
lyr.definitionQuery = cnty + seperator + twpship
result1 = arcpy.GetCount_management("ohioGrids")
#print('{} has {} records'.format("ohioGrids", result[0]))
if result1 > 0:
#arcpy.RefreshActiveView()
# GetExtent
lyr = arcpy.mapping.ListLayers(mxd, 'ohioGrids', df)[0]
ext = lyr.getExtent()
df.extent = ext
# SelectLayerByLocation
selection = arcpy.SelectLayerByLocation_management ("Meters", "WITHIN", "ohioGrids")
result = arcpy.GetCount_management(selection)
count = int(result.getOutput(0))
if count > 0:
print "COUNTY: " + b + " & " + "TOWNSHIP: " + d
print count
arcpy.SelectLayerByAttribute_management("ohioGrids", "CLEAR_SELECTION")
else:
arcpy.SelectLayerByAttribute_management("ohioGrids", "CLEAR_SELECTION")
... View more
11-02-2020
08:11 PM
|
0
|
3
|
1091
|
BLOG
|
How do you view sketches from the inbox? If you create a form and design a sketch design can this be access in survey123 connect only once?
... View more
10-21-2020
04:43 PM
|
0
|
0
|
2940
|
POST
|
What can I do to allow sketches to be view in survey123 when someone creates them?
... View more
10-21-2020
09:27 AM
|
0
|
2
|
1175
|
POST
|
Is it possible to assign an ID to a field based on where a geopoint is placed on a map? Can be anywhere. We would like to populate an office field based on where the geopoint is placed. So if the geopoint is closest an office, call the office name in the field. Any help or examples would be appreciated! Thanks!
... View more
10-13-2020
10:48 AM
|
0
|
1
|
854
|
POST
|
How do you write an If statement based on a value from previous fields. If TYPECODE = 3 and MCF is > 500 calculate 1801 Engineering Dept as the answer? My statement below doesn't seem to work. Any help would be appreciated! ${TYPECODE}='3' and if(${A00MCFTOTAL}>500,"1801 Engineering Dept"))
... View more
10-12-2020
02:42 PM
|
0
|
2
|
1187
|
POST
|
Is there a way to clean up the excel sheets saved on AGOL?
... View more
10-05-2020
06:06 AM
|
0
|
0
|
6468
|
POST
|
What's the best way to populate a department section based on a filter which works and 2 milestone date fields? I'll provide an example below if someone could help! Thanks!
... View more
10-01-2020
05:46 PM
|
0
|
1
|
916
|
POST
|
Is there's a way to setup inbox to read the choices? I know with a single selection we are able to use field=${username} but when you add more like "person1, person2 , person3" it's unable to read. In ArcMap I've used this WORKORDERID LIKE '%20161008%' becuase it's able to find that string but LIKE '%${username}%' doesn't seem to be a valid expression for the inbox. I'll provide an example form below. To get a single selection to show in your inbox, add your login username in the choice tab. Any help would be greatly appreciated! Any help would be greatly appreciated!
... View more
10-01-2020
12:40 PM
|
0
|
1
|
2503
|
POST
|
This is amazing! Do you know if there's a way to setup inbox to read the choices? I know with a single selection we are able to use field=${username} but when you add more like ", person1 , person 2" it's unable to read. In ArcMap I've used this WORKORDERID LIKE '%20161008%' becuase it's able to find that string but LIKE '%${username}%' doesn't seem to be a valid expression. Any help would be greatly appreciated!
... View more
10-01-2020
11:17 AM
|
0
|
2
|
6927
|
POST
|
How can you tell survey123 to auto select all of the choices for a select_multiple field when a field above is answered? This is based off a choice filter. I'll provide my form below, but I'm trying to build a survey where depending on which office, users will be select automatically. Hoping to use this with inbox so that paperwork goes to a group of people. Please let me know if you can help! Note* I am using the survey 3.11 beta that allows you to use choice filters on select_multiple choices but is there a way to select multiple choices regardless? Thanks!
... View more
09-30-2020
01:57 PM
|
0
|
8
|
7020
|
POST
|
What's the best way to automate exporting AGOL feature data down to a local CVS file daily?
... View more
09-25-2020
09:25 AM
|
0
|
1
|
796
|
POST
|
Hi James, Is there any update for showing attachments in the inbox? Many of our PC users in our office use the desktop application and there biggest complaint is not being able to view signatures and job site pictures. Thanks, Jordan
... View more
09-21-2020
01:58 PM
|
0
|
1
|
3150
|
POST
|
We're looking to purchase several GPS receivers and poles for better accuracy. I was wondering which ones would be the best bang for your buck and last for 3-4 years? Looking for something that can be used with Collector and there other apps. Thanks
... View more
09-18-2020
05:21 AM
|
0
|
7
|
5056
|
Title | Kudos | Posted |
---|---|---|
1 | 05-11-2018 06:04 AM | |
1 | 04-11-2018 06:24 AM | |
1 | 04-04-2019 05:59 AM | |
1 | 05-06-2019 08:45 AM | |
2 | 06-06-2019 06:32 PM |
Online Status |
Offline
|
Date Last Visited |
01-13-2021
02:32 PM
|