|
POST
|
You're right, but there's still a large number of organizations who haven't made the switch yet. This line of code should work if the OP can bypass the cert verification step OR make the request over HTTPS.
... View more
07-08-2020
12:58 PM
|
0
|
0
|
5092
|
|
POST
|
John, It looks like the server's certificate can't be validated. Have a look at the top comment in the StackOverflow discussion below. Creating a new SSLContext and passing it with the request should resolve the issue. python - urllib and "SSL: CERTIFICATE_VERIFY_FAILED" Error - Stack Overflow -Josh
... View more
07-08-2020
10:51 AM
|
1
|
6
|
5092
|
|
POST
|
Hey Joe, If you have access to the REST endpoint of the service and Python 3, you can get this done using ArcPy. Here's a quick example I spun up. It's not perfect, but I ran it on a few different feature layers and it seems to work. import requests import json import arcpy # Set variables featureLayerURL = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessmentStatePlane/FeatureServer/0" fgdbPath = r"C:\temp\test.gdb" featureClassName = "TEST1" featureClassGeometry = "POINT" # Get feature layer information in JSON format r = requests.get(featureLayerURL + "?f=json") # Get field information from the response fields = json.loads(r.text)["fields"] # Maps feature layer field types to feature class field types field_types = { "esriFieldTypeString": "TEXT", "esriFieldTypeDate": "DATE", "esriFieldTypeDouble": "DOUBLE", "esriFieldTypeInteger": "SHORT" } # Creates a new feature class fc = arcpy.CreateFeatureclass_management(out_path=fgdbPath, out_name=featureClassName, geometry_type=featureClassGeometry) # Adds a new field to the feature class for each entry in the "fields" variable, except for ObjectID and GlobalID. for field in fields: if field["type"] == "esriFieldTypeOID" or field["type"] == "esriFieldTypeGlobalID": pass else: arcpy.AddField_management(in_table=fc, field_name=field["name"], field_type=field_types[field["type"]], field_alias=field["alias"], field_is_nullable=field["nullable"], field_length=field["length"])
... View more
07-02-2020
01:55 PM
|
3
|
4
|
2524
|
|
POST
|
Hi Joe, Typically, I install Anaconda. I do this for a few reason: It installs a package and environment manager (conda) The base environment includes a huge number of popular packages by default. Jupyter Notebook is installed alongside the environment. https://www.anaconda.com/products/individual -Josh
... View more
06-18-2020
09:47 AM
|
1
|
0
|
1194
|
|
POST
|
Aaron, Go to ArcGIS Server Manager > Services > System and turn on the "CachingControllers" service, if it's turned off. -Josh
... View more
06-17-2020
12:54 PM
|
0
|
0
|
642
|
|
POST
|
Hi Michelle, The first portion of the formula needs to be in parentheses like this: ([Volume_2020] - [Volume_2019]) / [Volume_2019] Otherwise, the division will be performed before the subtraction due to order of operations. Let me know if this works! Best, Josh
... View more
06-12-2020
01:43 PM
|
1
|
3
|
3917
|
|
POST
|
Peter, It looks like the get_members() function returns a dictionary that contains three lists: users, admins, and owners. The contents of these lists are strings, so it doesn't look like we can derive the full name of each user as-is. However, using list comprehensions, you can create a list of <User> objects whose username appears in the resulting dictionary from get_members(). From this new list, you can print each user's name using the fullName property. See the code below: # Authentication
portalURL = ""
username = ""
password = ""
org_gis = GIS(portalURL, username, password)
# Get a list of groups that have "SA" in the title.
sa_groups = org_gis.groups.search('title:SA')
# Get a list of all users in the portal (max 1000 users).
all_users = org_gis.users.search(max_users=1000)
# Select the third group in the list
g = sa_groups[2]
# Get a dictionary of all users, admins, owners of the group.
response = g.get_members()
# Create a list of user objects whose usernames appear in the "users" list of the "response" dictionary.
lst = [u for u in all_users if u.username in response["users"]]
# Print the full name of each user in the list.
for user in lst:
print(user.fullName)
... View more
06-12-2020
10:11 AM
|
1
|
2
|
5283
|
|
POST
|
Hi Natalie, I think you need to run calculate() on a feature layer, not the feature service. Try the code below: import arcgis
import arcpy
from arcgis.gis import GIS
from arcgis import features
from arcgis.features import FeatureLayer
gis = GIS('https://arcgis.com', 'xxxxxx', 'xxxxxx')
arcpy.env.overwriteOutput = True
trap_count = gis.content.get("b6b9c68fa42b408a88c68aa9e18593d5")
trap_count
trap_count_lyr = trap_count.layers[0] # replace the 0 with the actual layer index
trap_count_lyr .calculate(where="fid > 0", calc_expression=[{"field": "TotalArmyworms", "sqlExpression" : "Nu_W_YellowStripedArmyworm + Nu_BerthArmyworm" }]) -Josh
... View more
04-10-2020
05:33 AM
|
1
|
4
|
6368
|
|
POST
|
Hello Louis, Take a look at the technical article linked below. It walks through how to list all dependencies using the ArcGIS API for Python's dependent_upon() and dependent_to() functions. Some tweaking will be required to get it to list specific layers, but hopefully this is a good place to start. How To: Find dependencies in Portal for ArcGIS using ArcGIS API for Python Best, Josh
... View more
04-07-2020
12:52 PM
|
2
|
0
|
1127
|
|
POST
|
Jose, You cannot directly edit feature services in ArcMap. You need to first create a local copy of the data. About editing data from feature services—Help | ArcGIS for Desktop -Josh
... View more
04-01-2020
01:29 PM
|
0
|
0
|
599
|
|
POST
|
Hey Todd, I haven't confirmed this yet, but I believe you need to use the Oauth2 workflow. This requires creating an Application item in ArcGIS online and obtaining a client ID and client secret. More detail in the doc below: Working with different authentication schemes | ArcGIS for Developers -Josh
... View more
04-01-2020
06:30 AM
|
0
|
0
|
467
|
|
POST
|
Hey Jack, It sounds like you're not connected to an active Portal/ArcGIS Online organization. Try launching ArcGIS Administrator on your machine and check the Portal connections. Use ArcGIS Desktop with your portal—Portal for ArcGIS (10.5.x) | Documentation for ArcGIS Enterprise -Josh
... View more
04-01-2020
06:24 AM
|
0
|
0
|
606
|
|
POST
|
Hey Rex, I'd first use the requests module to get the json response, then load it as a dictionary. From there, you can use panda's from_dict function to create the DataFrame from the series. Something like this: import numpy as np
import pandas as pd
import requests
import json
r = requests.get('https://www.purpleair.com/json?show=39183|31221|31179|31185|2827|12785|35779|15947|46911|3095|35885|10286|33089|38627|34099|27405|21109|27825|34579|34109|27401|21111|27873|34747|26961|38253|34153|27807|27833|27863|22355|9930|2221|8244|8248|4427|2944|2514|15019|28651|47173|25361|36607|37575|4591|6612|36139|30739|5512|3157|34933|38835|48625|34951|2239|12016|34803|14687|26249|35693|36965|34847|34797|44553|39593|46293|48047|30169')
dictionary = json.loads(r.text)
results = dictionary["results"]
df = pd.read_json(df.results.to_json(), orient='index') Now the data is a DataFrame, as opposed to a Series. Hope this helps! Best, Josh Edit: Modified the last line of code to reflect @joshua Bixby's suggestion. Thanks a lot!
... View more
03-30-2020
02:29 PM
|
3
|
0
|
2942
|
|
POST
|
Hello, Can you use the first workaround listed in the technical article below? Basically, you can configure a list widget to show related records. How To: Show related records in Operations Dashboard for ArcGIS -Josh
... View more
02-18-2020
08:38 AM
|
1
|
0
|
867
|
|
POST
|
Jim, Try this: arcpy.CalculateField_management("Underground.dbf", "Conduit",
'"2\" HDPE"', "PYTHON3") You need a forward back slash (\) before the parentheses ("). Otherwise, the Python interpreter will think you are trying to close the string. Best, Josh
... View more
01-24-2020
12:28 PM
|
0
|
2
|
2351
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-01-2025 05:40 AM | |
| 1 | 02-28-2025 07:11 AM | |
| 1 | 01-16-2025 05:35 AM | |
| 2 | 01-14-2025 06:48 AM | |
| 2 | 01-10-2025 08:07 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|