|
POST
|
I've encountered this multiple times and it is usually a problem with dtypes or a rogue string that exceeds the maximum length of a field. Does everything work with a small subset of data?
... View more
11-28-2023
12:45 PM
|
0
|
1
|
2232
|
|
POST
|
There's a few problems going on. The url param when initializing the GIS should be the url to your portal. Additionally, your feature_service_url is not pointing to a Feature Service, but a Feature Service Layer. You should remove "/2"
... View more
11-27-2023
07:10 AM
|
0
|
1
|
2098
|
|
POST
|
Based on the error and other provided information, it seems you are working with a FeatureCollection Item and not a FeatureCollection object. Try doing this: from arcgis.features import FeatureLayerCollection
flc = FeatureLayerCollection.fromitem(flc_item) where "flc_item" is what you are currently working with
... View more
11-22-2023
01:31 PM
|
1
|
1
|
2291
|
|
POST
|
Hey, glad those workarounds help. That's a fair question! The truth is, I'm just an enthusiast and I am in no way affiliated with the ArcGIS API for Python team. I understand your frustration - that's why I'm on these boards answering the questions I can as my time allows. Generally, it is preferable to open a case with Technical Support so the issue can be tracked both externally and internally. You may not be the only person running into this problem, so it is helpful to everyone to be able to add additional cases onto the defect log. Alternatively, you could post an issue on the public-facing github: https://github.com/Esri/arcgis-python-api You may or may not be able to get some more direct information on the expected behavior. In any case, it's still a good idea to log a formal defect and/or enhancement as the case may be.
... View more
11-20-2023
10:14 AM
|
0
|
0
|
1385
|
|
POST
|
I observe the same thing on my end. Perhaps the best course of action might be to open a case with Technical Support to gain a better understanding of when the groupDesignations and url property values are populated and what they are supposed to be. My guess is this functionality may just be broken and a defect should be logged. For the groups, maybe you can do: ", ".join([group.Title for group in item.shared_with["groups"]]) And this would handle cases where the an item is shared to multiple groups. As for the WebMap url, if you're okay with linking to the Item Details page, then you can get that from "item.homepage". This will return something like: 'https://www.arcgis.com/home/item.html?id=d4d5c81e0ejkt4f68ac1aa77452a3338' If, however, you're after a direct link to the map I think you'll need to do some string interpolation/concatenation. Something like this if you are using the new Map Viewer: map_url = f"{gis.url}/apps/mapviewer/index.html?webmap={item.id}" Hope this helps.
... View more
11-20-2023
09:18 AM
|
0
|
2
|
1401
|
|
POST
|
Accessing the database directly is likely the more efficient route in this case, especially since it seems many records are returned sometimes. If the main benefit of using the API is to do manipulations with pandas or something like that, you can also just do this by accessing the database directly. A related question was just asked the other day on how to load a feature class into a dataframe, for example: Re: Stand-Alone Table to Pandas Data Frame - Esri Community Anyhow, if you must use the ArcGIS API for Python I think the place you have to start is making sure the account running your ArcGIS Server has its own account in Portal with adequate permissions.
... View more
11-16-2023
09:40 AM
|
0
|
1
|
2291
|
|
POST
|
Oh, okay. Does the service point to a database accessible to the ArcGIS Server? Another option might be an arcpy script to generate data via the database.
... View more
11-15-2023
10:07 AM
|
0
|
3
|
2300
|
|
POST
|
It sounds to me like the better, more direct approach is to perform the required query in the JS application. Is that not an option?
... View more
11-14-2023
12:30 PM
|
0
|
5
|
2311
|
|
POST
|
I would lean towards using the boto3 package to get that info. I would assume it's the same as you would get through the metadata, hopefully. There are a couple of ways to do this, but they all pretty much entail getting a "last_modified" attribute. import boto3
s3 = boto3.client('s3', region_name='your_region')
objects = s3.list_objects(Bucket='your_bucket')
for o in objects["Contents"]:
print(o["LastModified"])
... View more
11-14-2023
09:33 AM
|
1
|
0
|
7346
|
|
POST
|
Can you tell us a little bit more about what you're trying to do? What else is the GP service supposed to do? I understand if you can't share much more.
... View more
11-13-2023
07:50 AM
|
0
|
7
|
2329
|
|
POST
|
I don't know of a specific method for this, but one way to do it would be to run a user search and then get the userLicenseTypeId (this was formerly userType so try both if you run into unexpected results in your version) value for each User object. The userLicenseTypeId values correspond to the userLicenseTypeId values described in REST API documentation: creatorUT | editorUT | GISProfessionalAdvUT | GISProfessionalBasicUT | GISProfessionalStdUT | viewerUT | fieldWorkerUT From there, you should have the data necessary to create your own plot/table. It's been a long while since I've had to do anything with Users/Content, but something like this should get you started: import pandas as pd
from arcgis.gis import GIS
gis = GIS("https://machine.domain.com/portal", "username", "password")
users = gis.users.search('*', max_users=1000)
df = pd.DataFrame(users)
df.userLicenseTypeId.value_counts().plot(kind='bar', title="User Type Plot") For simplicity, I use the user search results directly here, but ideally you would just grab the things you actually need from the User objects (if you don't, you may notice a performance hit especially with larger results). For example: users = [{"username": user.username, "userLicenseTypeId": user.userLicenseTypeId } for user in gis.users.search('*', max_users=1000)] Anyhow, this should yield a plot like this one:
... View more
11-13-2023
07:14 AM
|
0
|
2
|
3019
|
|
POST
|
What is your proposed solution to this problem? Personally, I prefer the UI version that replaces spaces with underscores. It gets away from the problem of URL encoding. My general opinion is spaces should be avoided whenever possible. I don't have much advice for you other than propose that you get your team to agree on certain naming conventions. The other thing I would suggest is logging a bug with Esri Support to match behavior between UI/API view creation. I do think you've identified some valid, problematic behavior here.
... View more
11-09-2023
07:02 AM
|
0
|
0
|
746
|
|
POST
|
plot() is a method on a License, not LicenseManager. So, from your example you would just grab one of the licenses returned and plot from there: licenses = gis.admin.license.all()
licenses[0].plot() This would return something like this:
... View more
11-06-2023
12:49 PM
|
0
|
4
|
3044
|
|
POST
|
The only thing that comes to mind is you may be on a differen version of the API? I re-ran the code and came out with the exact same output.
... View more
11-06-2023
10:23 AM
|
0
|
2
|
2070
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 01-18-2024 01:34 PM | |
| 1 | 09-13-2023 06:48 AM | |
| 1 | 09-23-2022 09:04 AM | |
| 1 | 06-14-2024 01:14 PM | |
| 2 | 09-24-2019 08:22 AM |