POST
|
Is it anticipated that this will change in the future? Would it work to have others edit just the excel document? My forms have to be in several languages, can I send the Excel workbook to the translators and then just save the translated document into the survey123 folder and publish the updates to AGOL?
... View more
02-01-2019
07:35 AM
|
1
|
1
|
1649
|
POST
|
I had missed that, thank you very much for pointing it out.
... View more
11-29-2018
11:15 AM
|
0
|
0
|
972
|
POST
|
This worked for me import arcpy rank = 1 fc = <the feature class you want to rank> sqlclause = sql_clause=(None, 'ORDER BY <Ranking Field> DESC') with arcpy.da.UpdateCursor(fc,'<the rank field>',sql_clause=sqlclause) as cursor: for row in cursor: row[1] = rank cursor.updateRow(row) rank = rank + 1 del cursor The idea is that I sort the featureclass based on my ranking criteria and then just add 1 to the rank for each loop. This assumes that you are basing you ranking on a single field. Instead of DESC which is decending order you could use ASC which is ascending order. This forum post helped: arcgis 10.1 - Is it possible to sort an arcpy.da.UpdateCursor()? - Geographic Information Systems Stack Exchange
... View more
11-29-2018
08:52 AM
|
0
|
2
|
972
|
POST
|
Hello, I need to be able to summarize nested related records. I have been through the documentation and sample notebooks but have been unable to connect the dots on this. I would appreciate any help in understanding the process. Here is where I am now: # get the feature layer collection from AGOL feature_layer_collection = gis.content.get('bf7307237621413fb692f2f1a6f26211') # get the feature layer of interest feature_layer = feature_layer_collection.layers[0] # get the related tables of interest feature_table1 = feature_layer_collection.tables[0] feature_table2 = feature_layer_collection.tables[1] # query the related records from feature_table related_table1 = feature_layer.query_related_records(object_ids="2", relationship_id="1", out_fields="*") related_table2 = feature_table1.query_related_records(object_ids='2', relationship_id="2", out_fields="*") # Look at what's inside the result related_table1? Type: dict String form: {'fields': [{'name': 'objectid', 'type': 'esriFieldTypeOID',
'alias': 'ObjectID', 'sqlType': 'sql <...> 'sqlTypeOther',
'length': 128, 'domain': None, 'defaultValue': None}], 'relatedRecordGroups': []} Length: 2 Docstring: dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) There is nothing in the 'relatedRecordsGroups', how do I access the values in the related table? How do I summarize those values? Thank you for any help. Here is the URL for the feature service I am using in this example: https://services8.arcgis.com/ZbDl0kmn9FILhh7J/arcgis/rest/services/service_02ec21de18564c0782c96723d94a84ec/FeatureServe…
... View more
11-05-2018
05:43 AM
|
0
|
1
|
961
|
POST
|
So I figured it out by reading the REST API documentation Query Related Records (Feature Service)—ArcGIS REST API: Services Directory | ArcGIS for Developers Just in case anyone is as baffled as I was: the object ID it is asking for is that actual object ID of the source feature the relationship id is an identifier you can find by looking at the service page under "Relationships:" good luck
... View more
11-01-2018
11:18 AM
|
6
|
0
|
2373
|
POST
|
Hello, I have a feature layer containing points. I have a related table that has a multiple records for each point feature. How can I query and use the data from the related records? From the python API documentation I wrote the following in Jupyter Notebook: # get the feature layer collection from AGOL feature_layer_collection = gis.content.get('08d12e0*****4379bd5881f26539838e') # get the feature layer of interest feature_layer = feature_layer_collection.layers[0] # get the related table of interest feature_table = feature_layer_collection.tables[0] # query the related records from feature_table # I am using the "objectid" field and "globalid" field from feature_layer related_query = feature_layer.query_related_records(object_ids='objectid', relationship_id='globalid') I get the error: RuntimeError: Unable to perform query. Please check your parameters. (Error Code: 400) Note: The feature layer and table are indeed related 1 to many globalid to parentglobalid I haven't been able to find a good example to model from. Any help would be appreciated.
... View more
11-01-2018
10:51 AM
|
1
|
1
|
3136
|
POST
|
Howdy, I found the correct reference arcgis.features module — arcgis 1.5.0 documentation
... View more
11-01-2018
08:05 AM
|
0
|
0
|
499
|
POST
|
Is there a comprehensive reference for how to query features and tables in ArcGIS Python API? I have features with related tables and need to query at all levels. Many thanks ArcGIS Python API Jupyter Notebook AGOL Hosted features
... View more
10-31-2018
12:04 PM
|
0
|
1
|
632
|
POST
|
Thank you very much Claire That worked perfectly and thank you for the link it helped answer other questions I had.
... View more
10-26-2018
05:42 AM
|
0
|
0
|
562
|
POST
|
I would like to have questions in my survey that affect the relevant column but are not needed in my actual data set. For example: I am collecting trap information, I need to record certain information when the trap is set and different information when it is collected. If I have a question at the beginning of my survey asking the field tech if they are setting traps or collecting them then using the relevant column I can show only those fields that are important to either task; but I don't need to store whether they are setting or collecting a trap in the feature layer (in fact it avoids problems if it isn't stored). I am using a hosted feature layer in AGOL. I am using Survey123 Connect Version 3.0.142 Note: There is a lot of information for each trap that doesn't change between setting and collecting so having two different features would be less effective. The trap sites are relatively close together and they alternate between setting and collecting traps so switching between two different forms would be less effective.
... View more
10-25-2018
05:55 PM
|
0
|
2
|
636
|
POST
|
Perhaps we are all barking up the wrong tree. You could just do a spatial join on the new points from that day with a persistent county fc with the output in_memory with just the name field carried over from the county fc. Then append that to a long term points fc. You could then programmatically delete all that days features from the new points fc so you are working from an empty data set each day. Roughly (I'm sure Richard will pick up on any errors): import arcpy
# Establish parameters
new_features = # A temporary feature class that is reset each day
county_feature_class = # The county feature class used to get county names
historical_features = # A feature class you add new points to as they come along
county_points = arcpy.analysis.SpatialJoin(new_features, county_feature_class, "in_memory/County_points",
"JOIN_ONE_TO_MANY", "KEEP_ALL",[fields you want to cary over],
"INTERSECT", None, None)
arcpy.Append_management(county_points, historical_features, "NO_TEST",...) When I tested is using GP tools within ArcGIS Pro it only took 7 seconds total for all the cities an counties in the US.
... View more
09-28-2018
10:26 AM
|
3
|
0
|
461
|
POST
|
Hello Thomas, Here is a simple script you can work from. import arcpy
# Establish parameters
city_feature_class = arcpy.GetParameterAsText(0) # A point fc (string)
county_feature_class = arcpy.GetParameterAsText(1) # A polygon fc (string)
# Set up search cursor for county fc
with arcpy.da.SearchCursor(county_feature_class, ['SHAPE@', 'NAME']) as search_cursor:
# Set up update cursor for point fc
with arcpy.da.UpdateCursor(city_feature_class, ['SHAPE@', 'Test_County']) as cursor:
# Iterate through counties
for polygon in search_cursor:
county = polygon[0]
name = polygon[1]
# Iterate through cities
for row in cursor:
point = row[0]
if point.within(county):
row[1] = name
cursor.updateRow(row)
cursor.reset()
del search_cursor
del cursor I tested it by running the code to add county names to every city within the county and then compared it against the county field in the city feature class to make sure it ran correctly. It is pretty good performance wise, when I ran it against all the cities (1,015) in all the counties (67) in Florida it ran in less than a minute. When I ran all the cities (38,186) in all the counties (3,142) in the entire US it took just under an hour. If you are running it over night it shouldn't be an issue. Cheers, Ben
... View more
09-26-2018
06:15 PM
|
0
|
1
|
461
|
POST
|
I am trying to get the X and Y values from the output of the positionAlongLine method. As far as I can tell it should be a point object so how do I get the XY from that point? I have found examples of how to do this in a search cursor but that only works with tables, I only have a single point. new_point = line.positionAlongLine(cur_length, is_percentage) point_x = new_point.X point_y = new_point.Y returns the error: AttributeError: 'PointGeometry' object has no attribute 'X' Any help would be greatly appreciated.
... View more
09-11-2018
01:56 PM
|
1
|
6
|
6819
|
POST
|
You can accomplish this using Calculate Value: Here is a link: Calculate Value—Tools | ArcGIS Desktop (near the bottom of the page)
... View more
07-11-2018
10:15 AM
|
0
|
0
|
621
|
Title | Kudos | Posted |
---|---|---|
1 | 09-11-2018 01:56 PM | |
1 | 11-01-2018 10:51 AM | |
1 | 02-12-2019 09:39 AM | |
1 | 02-01-2019 07:35 AM | |
1 | 11-13-2019 09:58 AM |
Online Status |
Offline
|
Date Last Visited |
04-29-2022
04:13 PM
|