|
POST
|
If I could figure out how to create a definition query based on a field value WHERE clause and then run code against just those records I would be ecstatic....
... View more
05-21-2021
11:50 AM
|
0
|
1
|
1662
|
|
POST
|
Now that I have the Unique Species I need to pass them 1 by one to a function that will either QUERY the point Feature Class and do something to JUST those records or Create a DEFINITION query and do something with just those point records. In the DEF I have a unique Species name sent to it. Whats the best way to query the points Feature Class and just work with those records? Query or Definition Query....any examples?
... View more
05-21-2021
11:45 AM
|
0
|
2
|
1662
|
|
POST
|
OK I am trying to get a tally of each species and their counts... But I just get a big list of each one as it passes through the loop....not totals....where am I going wrong # COUNT NUMBER OF RECORDS FOR EACH SPECIES
def unique_values(table, field):
resultspecies = ""
expressionValue = table
species = field
expressionValue2 = "common_name = '{}'".format(species)
with arcpy.da.SearchCursor(Points, "common_name", where_clause=expressionValue2) as cursor:
for row in cursor:
resultspecies = row[0]
rowCount = 0
rowCount = rowCount + 1
print "There are " + str(rowCount) + " of " + resultspecies
# GET UNIQUE SPECIES FROM TABLE
for feature in arcpy.ListFeatureClasses():
#print feature
with arcpy.da.SearchCursor(Points,"common_name", sql_clause=(None,'ORDER BY common_name DESC')) as SCur:
for row in SCur:
if not row[0] in bList: # if not in list then add to list
bList.append(row[0])
species = row[0]
expressionValue = "common_name = '{}'".format(species)
uniques = unique_values(expressionValue, species)
... View more
05-21-2021
11:11 AM
|
0
|
3
|
1666
|
|
POST
|
OK I think I have it working now...Now onto the next piece # COUNT NUMBER OF RECORDS FOR EACH SPECIES
def unique_values(table, field):
expressionValue = table
species = field
expressionValue2 = "common_name = '{}'".format(species)
with arcpy.da.SearchCursor(bba_Points, "common_name", where_clause=expressionValue2) as cursor:
for row in cursor:
print row[0]
... View more
05-21-2021
10:47 AM
|
0
|
4
|
1668
|
|
POST
|
I am trying this.... Loop though the Points Feature Class to get a list of Unique Species After each iteration in the loop call a Function and pass that species name In the Function I am just trying to get a count for that species. This should loop through for each species and get me a count. ANY thoughts to why I am getting this error? ERROR : Traceback (most recent call last): File "E:\ArcGIS_Server_aws\Python_Scripts\CountBBASpecies\CountSpeciesinPolygon.py", line 61, in <module> uniques = unique_values(expressionValue, species) File "E:\ArcGIS_Server_aws\Python_Scripts\CountBBASpecies\CountSpeciesinPolygon.py", line 47, in unique_values for row in cursor: RuntimeError: Underlying DBMS error [[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near 'Vireo'.] [BBA2.DBO.JaysTest_BirdLocations_Test] >>> CODE: # COUNT NUMBER OF RECORDS FOR EACH SPECIES
def unique_values(table, field):
expressionValue = table
species = field
with arcpy.da.SearchCursor(Points, "common_name", where_clause=expressionValue) as cursor:
for row in cursor:
print row[0]
# GET UNIQUE SPECIES FROM FEATURE CLASS
for feature in arcpy.ListFeatureClasses():
with arcpy.da.SearchCursor(Points,"common_name", sql_clause=(None,'ORDER BY common_name DESC')) as SCur:
for row in SCur:
if not row[0] in bList: # if not in list then add to list
bList.append(row[0])
species = row[0]
expressionValue = "common_name = " + species
# PASS species name to Function to Count
uniques = unique_values(expressionValue, species)
... View more
05-21-2021
10:38 AM
|
0
|
6
|
4236
|
|
POST
|
I found this for python and I think it will work but I have to loop through each time with a different species name. The example just calculates the total number of points... https://gis.stackexchange.com/questions/289273/counting-points-within-polygon-with-arcpy CAN I DO THIS? I can create a list of all the unique Species Names Then Step through each Species Name and set a definition query on the Points Layer Use this DEFINITION query result and then get the counts and update a field with the count Then move on to the next Species Name etc etc
... View more
05-21-2021
09:13 AM
|
0
|
9
|
4244
|
|
POST
|
I found this but I need something that I can run and let it go through everything....this is far to manual... https://gis.stackexchange.com/questions/264697/counting-number-of-points-differing-in-specific-attribute-within-polygon-in-arcg
... View more
05-21-2021
07:35 AM
|
1
|
0
|
4248
|
|
POST
|
Thanks a bunch and you aint kidding that this is a heavy lift. Shifting gears a bit....wondering if I can do this via python or something. Run a script against the dataset.... Polygon Dataset with multiple fields for individual species Run a script and have it count the number of point occurrences (species specific) in each polygon for Species A and write the number in the corresponding field. Then do this for every species. Then I have a polygon FC that I can symbolize by a given field. This should do what I want and not have to do it on the fly. Do you know of any examples to accomplish this via python or geoprocessing tools?
... View more
05-21-2021
05:14 AM
|
0
|
1
|
4250
|
|
POST
|
I have an app that searches for a particular species from a point file Once found it creates graphics for the point locations and grid polygons that encompass those points. What I want to do now is symbolize those polygons based on how many points are found within them. I am not sure how to approach this. I think I would have to read through each polygon and determine how many points are in there and set the symbology? So the result would be a graphics layer of polygons of varying color based on how many points are within them Anyone have any ideas?
... View more
05-20-2021
04:07 AM
|
0
|
14
|
5966
|
|
POST
|
Thanks for your input Brian The Incident Analysis, Situation Awareness or Public Notification widgets are based on retrieving results from data and other datasets from a specific location. My workflow is quite different..... For Example: Data: Say you had 200,000 incidents across an entire state You then overlaid a grid polygon on top Workflow: The user selects a particular incident type While zoomed to the entire state you want to show the grid polygons that contain those selected incidents When the user zooms in to a particular zoom level the polygons turn off and the actual point locations appear.
... View more
05-18-2021
04:29 AM
|
0
|
1
|
2327
|
|
POST
|
I can create a query in AGOL that selects the records from the point file pertaining to a Field Value I can create a second query to spatially query the polygons that intersect those resulting points from the first query. But I have to do this in a manual process running each query individually. I need this to happen all at once. That and when I run the second query it turns off the first point result. Anyone have any thoughts? I guess I might have to do this with a geoprocessing script?
... View more
05-17-2021
09:25 AM
|
0
|
0
|
2345
|
|
POST
|
somehow select a species in the point file This will then look for Polygons that 'contain' this filtered list of point locations Resulting in a Point file and a Polygon File that I can control their visibility based on my zoom level.
... View more
05-17-2021
08:22 AM
|
0
|
1
|
2346
|
|
POST
|
Yea I get the fact that I can set visibilities on the data but cant conceptualize how to work with both feature classes in AGOL and perform this query or filter. Can AGOL do this? Do I need to write python and publish a GP Tool service?
... View more
05-17-2021
08:07 AM
|
0
|
2
|
2347
|
|
POST
|
I am new to this....how is the class called from Python and used? Is there a simply example of this code in its entirety where when you run it you just see the dropdown and the populated list?
... View more
05-17-2021
07:50 AM
|
0
|
0
|
6550
|
|
POST
|
I have a point Feature Class I have a polygon feature Class. When the web application opens I do not want to see any data. There is too much data to show!!!! I am looking to have someone select a field value from the point Feature Class field value. This then filters out those records. BUT what I want to do is then select the Polygons that have those Feature Located inside them. So I then show the Polygons that have those features NOT the points themselves. As you zoom in the points would then appear and the polygons would then disappear...Does that make sense. So at a state level only grid polygons would show...when I get down to saw a county level the points would draw and the polygons would stop drawing. Can this be done out of box in a web application? Or do I need to do this somehow in a geoprocessing tool?
... View more
05-17-2021
04:55 AM
|
0
|
7
|
2399
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|