|
POST
|
Hi Ian Hamilton, Yes, it’s possible. The following link provides a comprehensive guide about how to publish a CSV file and update/append new features to an existing hosted feature layer from a CSV. Updating features in a feature layer | ArcGIS for Developers ------------------------------------------------------------------------------------------------------------------------------------ Please mark as helpful if you find it helpful. If it answered your question please mark it as answered.
... View more
10-30-2020
06:16 AM
|
1
|
0
|
2417
|
|
POST
|
Hi Clive Swan, You need to add encode(“utf-8”) at the end of line 14. The code will be like so: import urllib
import json
def generateToken(username, password, portalUrl):
'''Retrieves a token to be used with API requests.
portalUrl = myurl
username = myuser
password = mypassword'''
parameters = urllib.parse.urlencode({'username' : username,
'password' : password,
'client' : 'referer',
'referer' : portalUrl,
'expiration' : 60,
'f' : 'json'}).encode("utf-8")
print("Read parameters")
response = urllib.request.urlopen(portalUrl + '/sharing/rest/generateToken?', parameters).read()
print("response")
try:
jsonResponse = json.loads(response)
if 'token' in jsonResponse:
return jsonResponse['token']
elif 'error' in jsonResponse:
print(jsonResponse['error']['message'])
for detail in jsonResponse['error']['details']:
print(detail)
except ValueError:
print('An unspecified error occurred.') ------------------------------------------------------------------------------------------------------------------------------------ Please mark as helpful if you find it helpful. If it answered your question please mark it as answered.
... View more
10-29-2020
07:57 AM
|
1
|
1
|
1883
|
|
POST
|
Hi Yaxiong Lei, You can merge the points feature classes first then export the output merged feature class into SLPK. Merge (Data Management)—ArcGIS Pro | Documentation ----------------------------------------------------------------------------------------------------------------------------------------------- Please mark as helpful if you find it helpful. If it answered your question please mark it as answered.
... View more
10-28-2020
10:11 PM
|
0
|
1
|
976
|
|
POST
|
Hi Matthew Thompson, You can use the following code to create a spatial dataframe from the shape: from arcgis import GIS
from arcgis.features import SpatialDataFrame, Feature, FeatureSet
import pandas as pd
from arcgis import geometry
shape = {
"rings": [[[-90.0, 30.0], [-91.0, 30.0], [-90.0, 31.0]]],
"spatialreference" : {"wkid" : 4326}}
polygonFeature = Polygon(shape)
polygon_new = Feature(geometry=polygonFeature, attributes={"title": "Polygon test",
"description": "This is a test",})
#Create a featureset to access spatial dataframe
polygon_fset = FeatureSet(features = [polygon_new],
geometry_type="Polygon",
spatial_reference={'latestWkid': 4326, 'wkid': 102100})
polygon_fset.sdf ----------------------------------------------------------------------------------------------------------------------------------------------- Please mark as helpful if you find it helpful. If it answered your question please mark it as answered.
... View more
10-28-2020
08:30 PM
|
4
|
0
|
2483
|
|
POST
|
Hi Nils Ratnaweera, Yes, you can. By using Pandas, GeoAccessor and GeoSeriesAccessor DataFrame Accessors you can access local shapefiles and gdb feature classes,... from arcgis.features import GeoAccessor, GeoSeriesAccessor
import pandas as pd Then these feature classes can be plotted as spatial data frames to a web map in this instance. The following links give more insights: https://community.esri.com/message/958657-re-jupyter-lab-spatialplot-local-gdb-multiple-feature-classes?commentID=958657… Introduction to the Spatially Enabled DataFrame | ArcGIS for Developers or use mp.add_layer(layer_item) to add layers to the web map, then web map can be saved in Portal or AGOL. Here's an example of how to set up item properties of a web map and save it: webmap_properties = {'title':'Web Map Sample','snippet': 'Jupyter notebook saved as a web map','tags':['automation', 'python']} mp.save(item_properties = webmap_properties, mode=None, thumbnail=None, metadata=None, owner=None, folder=None,)
... View more
10-14-2020
08:15 PM
|
2
|
0
|
1806
|
|
POST
|
Hi Ian Hamilton, Would you please mark it as answered if that answered your question? Thank you.
... View more
10-13-2020
06:46 PM
|
0
|
0
|
3996
|
|
POST
|
Hi Tyler Townes, you can create another spatial dataframe and plot it to the same map widget: df1 = pd.DataFrame.spatial.from_featureclass(path to feature class1)
df2 = pd.DataFrame.spatial.from_featureclass(path to feature class2)
mp = gis.map('area of interest')
mp
df1.spatial.plot(map_widget = mp, renderer_type = 'u', col = xxxx)
df2.spatial.plot(map_widget = mp, renderer_type = 'u', col = xxxx)
... View more
10-12-2020
06:50 PM
|
3
|
0
|
1959
|
|
POST
|
Hi Ian Hamilton, The Publish method in ArcGIS API for Python doesn't have any parameters to specify a named folder when publishing. Publish items However, the Add method in the Content Manager gives you this option to add your item to a named folder then publish it from there. add (item_properties, data=None, thumbnail=None, metadata=None, owner=None, folder=None, item_id=None) Add items you also have the option to move items to an already created folder using move(folder, owner=None) Move items
... View more
10-12-2020
05:47 PM
|
2
|
2
|
3996
|
|
POST
|
Hi Ronald Vanderpool, Would you please mark it as answered if it answered your question? Thank you.
... View more
10-08-2020
05:55 PM
|
2
|
0
|
3061
|
|
POST
|
Not a problem Ronald Vanderpool, Here's the api reference link: arcgis.gis.admin module — arcgis 1.8.2 documentation
... View more
10-08-2020
05:59 AM
|
3
|
2
|
3061
|
|
POST
|
Hi Devin Doring, I've found the following feature services for Stop Signs: https://www.arcgis.com/home/item.html?id=f4e7ad6b7c6e43758e22d910f1938c40 https://www.arcgis.com/home/item.html?id=459dc422538c478b8565098027333c10
... View more
10-08-2020
01:02 AM
|
0
|
0
|
2984
|
|
POST
|
Hey Brittaney Harkness, The following link by Earl Medina provides some methods in regards to updating feature layers symbology using ArcGIS API for Python: https://community.esri.com/groups/arcgis-python-api/blog/2019/04/09/updating-layer-symbology-with-the-arcgis-api-for-python
... View more
10-07-2020
11:14 PM
|
1
|
1
|
907
|
|
POST
|
Hi Cameron McArtney, This is an example arcade expression which classifies features based on current date. if (DateDiff(Now(), Date($feature.Date_Stamp), 'days') <= 1) {
return "Features captured within the last day" }
else if (DateDiff(Now(), Date($feature.Date_Stamp), 'days') > 2 &&
DateDiff(Now(), Date($feature.Date_Stamp), 'days') < 5) {
return "Features captured between 2 to 5 days ago" }
else if (DateDiff(Now(), Date($feature.Date_Stamp), 'days') >= 5) {
return "Features captured more than 5 days ago" }
else {
return "None of these conditions" } you can change days to hours, minutes, months, .... More information is in the link below: Date Functions | ArcGIS for Developers
... View more
10-07-2020
10:29 PM
|
1
|
2
|
1312
|
|
POST
|
Hi Tanner Arrington, You can use reverse direction in related items method to get the web maps in which a feature layer is being used, however, you need to establish a relationship using (add_relationship) with the web maps first. webmap1 = gis.content.get('webmap ID')
webmap_related_item = gis.content.get('Feature Layer ID')
webmap1.add_relationship(rel_item= webmap_related_item, rel_type= 'Map2Service')
webmap_related_item.related_items('Map2Service', 'reverse') and conversely, forward direction provides the feature layers (collections) used in the web map. I hope that helps.
... View more
10-07-2020
08:33 PM
|
2
|
0
|
12355
|
| 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 |