Please consider upgrading the geoshape geometry functionality to include multipart polygon features.
Id like to see the ability to pass multipart geometry using pulldata('json ') into a geoshape field.
FYI the workaround for this is to publish your survey with the geoshape geometry in the form but add a pulldata statement to create a join field to a dataset which contains the multipart geometry youre after.
Once the survey is published, I run a script that then updates the geometry of the Survey geoshape based on the linked datasets geometry..
Interesting! Would you be able to share a sample?
In the meantime, I'd like to say that just because a user has found a workaround doesn't mean this isn't still desired functionality.
Its definitely still desired. workarounds suck..Copilot and i mashed up a script. we're becoming good friends.
the script runs locally for now. hoping to get notebooks enabled on AGOL so i can automate it hourly or triggered by a data submission .I (well copilot...) also did an optimised version that refines the source dictionary by the features that need updating. this saves time if your source has lots of features...
............................
##Updates Geometry of Reserves attached to Permit from the Masterfrom arcgis.gis import GISfrom arcgis.features import FeatureLayerimport datetime
# 1. Connect to ArcGIS Onlinegis = GIS("Your AGOL", "USER", "PWD")
# 2. Access the source and target feature layerssource_layer_url = "URL1"target_layer_url = "URL2"
source_layer = FeatureLayer(source_layer_url)target_layer = FeatureLayer(target_layer_url)
# 3. Query all features from both layerssource_features = source_layer.query(where="1=1", out_fields="GlobalID", return_geometry=True).featurestarget_features = target_layer.query(where="1=1", out_fields="TSRID", return_geometry=True).features
# 4. Create a dictionary for quick lookup from sourcesource_dict = {f.attributes['GlobalID']: f.geometry for f in source_features}
# 5. Update target geometriesupdates = []for feature in target_features:uid = feature.attributes['TSRID']if uid in source_dict:feature.geometry = source_dict[uid]updates.append(feature)
# 6. Apply updatesif updates:result = target_layer.edit_features(updates=updates)print(f"Updated {len(updates)} features at {datetime.datetime.now()}")else:print("No matching features found to update.")
Faça login para publicar, seguir conteúdo e mais. Novo aqui? Registre-se gratuitamente.