|
POST
|
@markjones6, The following script projects an SDF into a WGS84 lat long SDF: from arcgis import GIS
gis = GIS('AGOL or Portal url', 'username', 'password')
# let's say you create an SDF from a feature layer first
item = gis.content.search("title: featureLyr")[0]
flayer = item.layers[0]
fset = flayer.query()
# project using WGS84 epsg code in the feature set
sdf_WGS84 = flayer.query(out_sr=4326).sdf
sdf_WGS84.head() Now if you check the SHAPE you should see the coordinates in lat and long format. ------------------------------------------------------------------------------------------------------------------------------------ Please give a like if you find it helpful. If it answered your question please accept as solution.
... View more
09-19-2021
06:59 PM
|
2
|
3
|
5121
|
|
POST
|
@MohammedAljezawi , You can do the conversion in ArcGIS Pro and/or Python but I'm not sure this is doable in JavaScript.
... View more
09-19-2021
06:11 PM
|
0
|
0
|
687
|
|
POST
|
@MPach I believe the solution answered your question.
... View more
09-19-2021
05:36 PM
|
0
|
1
|
2089
|
|
POST
|
@EvanThoms1 , You must use the right format. By default, all fields are visible and you need to hide the ones you don't want. Use the following dictionary, here the ISO_SUB, Creator and NAME fields will be invisible: update_dict = {"fields" : [
{
"name" : "ISO_SUB",
"visible" : False
},
{
"name" : "Creator",
"visible" : False
},
{
"name" : "NAME",
"visible" : False
},
]} I hope that helps. cheers Mehdi
... View more
09-16-2021
09:38 PM
|
1
|
0
|
2428
|
|
POST
|
@MPach , This modelbuilder does what you are after if I understood your workflow correctly: Make sure the first Select Layer By Location has Invert spatial relationship ticked on.
... View more
09-16-2021
07:03 PM
|
0
|
3
|
2116
|
|
POST
|
@RamakrishnaBillakanti , Is it possible to share your script?
... View more
09-15-2021
10:37 PM
|
0
|
2
|
2554
|
|
POST
|
@ngrid_ShelbyZ , Yes, that's possible. See the code snippet below: # get the layer
buffer_item = gis.content.get('item_id')
# add the layer with query to the web map with a new title/name
web_map.add_layer(buffer_item.layers[0].query("Location_Status = 'Active'"),options={'title':'Active Buffers'})
# save as a new web map
webmap_item_properties = {'title':'Some Active Areas',
'snippet':'Map created using Python API showing locations',
'tags':['automation', 'webmap', 'features', 'python']}
web_map.save(webmap_item_properties) Cheers Mehdi
... View more
09-15-2021
07:20 PM
|
2
|
1
|
3326
|
|
POST
|
@TheoF , I have no idea regarding the updates before release. I might be able to find the future updates in one of esri's presentation. will keep you posted.
... View more
09-15-2021
06:18 PM
|
1
|
0
|
1466
|
|
POST
|
@ROMANFILOZOF , You are getting the message "Invalid expression" because the Shape_Area field is most probably not available in your shapefiles' fields by default. But when you import your shapefiles into a gdb, some fields are automatically created/calculated by the gdb. These fields are Shape_Area, Shape_Length, ... and FID becomes OBJECTID. I hope that helps. Mehdi
... View more
09-14-2021
07:23 PM
|
2
|
1
|
2642
|
|
POST
|
@TheoF , There is not much reporting for the apps via the API, however the Survey123 app has got some reporting capabilities which allows survey’s data be exported as reports : https://developers.arcgis.com/python/api-reference/arcgis.apps.survey123.html?highlight=report
... View more
09-14-2021
06:18 PM
|
1
|
2
|
1471
|
|
POST
|
@ngrid_ShelbyZ , If you want to query feature layers, the following link provides some good examples of querying feature layers: https://developers.arcgis.com/python/guide/working-with-feature-layers-and-features/
... View more
09-14-2021
06:06 PM
|
1
|
3
|
3340
|
|
POST
|
@afana1972 , The following code snippet should work. You just need to change the layer names and variables accordingly. from arcgis import geometry #use geometry module to project the records
from copy import deepcopy
original_item = gis.content.get("item_id")
original_layers = original_item.layers
fLyr = original_item.layers[0]
fset = fLyr.query()
new_item = gis.content.get("item_id")
new_fLyr = new_item.layers[0]
new_fset = new_fLyr.query()
new_fset_features = new_fLyr.query().features
new_flayer_rows = new_fset.sdf
features_to_be_added = []
template_hostedFeature = deepcopy(fset.features[0])
for index, row in new_flayer_rows.iterrows():
feature_to_be_updated = deepcopy(template_hostedFeature)
input_geometry = new_fset_features[index].geometry
output_geometry = geometry.project(geometries = [input_geometry],
in_sr = fset.spatial_reference['wkid'],
out_sr = fset.spatial_reference['latestWkid'],
gis = gis1)
# assign the updated values
feature_to_be_updated.geometry = output_geometry[0]
feature_to_be_updated.attributes['cr_id'] = int(row['cr_id'])
feature_to_be_updated.attributes['C31013'] = row['C31013'].values[0]
feature_to_be_updated.attributes['big_shape'] = row['big_shape'].values[0]
feature_to_be_updated.attributes['site_name'] = row['site_name'].values[0]
feature_to_be_updated.attributes['awh_stage'] = int(row['awh_stage'])
feature_to_be_updated.attributes['awh_package'] = int(row['awh_package'])
# #add this to the list of features to be updated
features_to_be_added.append(feature_to_be_updated)
original_layers[0].edit_features(adds = features_to_be_added) I hope that's helpful.
... View more
09-12-2021
08:38 PM
|
0
|
0
|
2420
|
|
POST
|
@RobertDriessen1 , The following link provides details of managing services on your server via ArcGIS API for Python: https://developers.arcgis.com/python/guide/managing-your-gis-servers/ Cheers Mehdi
... View more
09-05-2021
08:22 PM
|
0
|
0
|
2483
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-16-2021 09:38 PM | |
| 1 | 03-17-2024 06:09 PM | |
| 1 | 11-10-2020 04:59 PM | |
| 1 | 02-08-2021 09:29 PM | |
| 1 | 02-17-2021 04:47 PM |