|
POST
|
Oh, I see. I didn't catch that you were running this online. I believe you want to use that method locally if you want to save to a file to disk.
... View more
09-23-2022
09:04 AM
|
1
|
0
|
2035
|
|
POST
|
Hi, There is documentation, but perhaps it's not completely obvious. Since Enterprise/AGOL relies on ArcGIS Server, this documentation on supported SQL operations applies: Enforce standardized SQL queries—ArcGIS Server | Documentation for ArcGIS Enterprise Additionally, this documentation for Pro applies: SQL reference for query expressions used in ArcGIS—ArcGIS Pro | Documentation
... View more
09-23-2022
08:59 AM
|
0
|
0
|
1156
|
|
POST
|
Hi there, I have usually avoided calculate because it is much slower than using dataframes and edit_features to perform updates, but here's the syntax for string concatenation (there are 2 ways I know of): fl.calculate(where="1=1", calc_expression={"field": "test", "sqlExpression" : 'Activity || Description'}) OR fl.calculate(where="1=1", calc_expression={"field": "test", "sqlExpression" : 'CONCAT(Activity, Description)'}) This examples assumes you are calculating a field "test" to be the concatenation of fields "Activity" and "Description." In your case, it seems you actually have a variable? In that case, you have to do some string substitution. Here I make use of the f-strings (introduced at Python 3.6): fl.calculate(where="1=1", calc_expression={"field": "test", "sqlExpression" : f"CONCAT(Activity, '{newVal}')"}) Hope this helps!
... View more
09-23-2022
08:55 AM
|
1
|
1
|
1157
|
|
POST
|
I'm going to assume from your usage of GIS("home") you are running this notebook in ArcGIS Pro? I suspect the csv is being written, but perhaps not where you expect to find it. Add another cell and run this to see the current working directory: !echo %cd% Hope this helps!
... View more
09-21-2022
11:46 AM
|
0
|
3
|
2058
|
|
POST
|
Are there any obvious difference between the two environments? Are the arcgis package versions the same? What about the python versions?
... View more
09-15-2022
07:43 AM
|
0
|
0
|
1438
|
|
POST
|
Posting this just in case it's useful to anyone. I used to run into this problem all the time and, as you noted, the error handling was not the best or nonexistent at times. You will often see a success message for records even though the operation was not successful. In my case, this would happen 100% of the time with text fields. The problem was caused by the fact that if you publish a service from a pandas dataframe, the text field lengths will default to the maximum string length found in corresponding dataframe columns. So, if on the next truncate/add you have a string that is longer than the length supported by the Field, this will derail the entire add process. You can fix this particular scenario using a different approach if you do not wish to overwrite. Basically, on each truncate/add you find the max string length for each string (object) column and compare that value to the corresponding Field's length property. If you find that the max exceeds the supported Field length, you delete the field and recreate it with exactly the same properties, except with the field length set higher (at least the length of the max string length found). This can all be done programmatically like so: Use np.vectorize or df.col.str.len().max() to find the max length of each object column Compare the max length to the corresponding field in FeatureLayer.properties['fields'] If exceeds are found, remove using delete_from_definition Re-add those fields with modified lengths using add_to_definition
... View more
09-08-2022
01:30 PM
|
3
|
0
|
2831
|
|
POST
|
Okay, so you're trying to do something like this? https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/FeatureServer/0/query?where=1%3D1&obje… Where in this case the source layer is: Layer: Earthquakes1970 (ID: 0) and we are returning points that fall more or less within the United States. -Earl
... View more
10-21-2019
07:08 AM
|
0
|
0
|
1559
|
|
POST
|
Hi Gail, I'm still not sure what you mean by open, but I'll assume you mean to open in a browser. For something like that, you could use selenium · PyPI . -Earl
... View more
10-17-2019
09:58 AM
|
0
|
0
|
1943
|
|
POST
|
Hi Lino, To accomplish this you'll want to create a custom container image. You can find workflow information here: Extend a notebook runtime—ArcGIS Notebook Server Installation Guide (10.7) | ArcGIS Enterprise Kind regards, Earl
... View more
10-17-2019
07:47 AM
|
0
|
2
|
1286
|
|
POST
|
Hi Gail, Can you clarify what you mean by "go to the url" ? Are you trying to get the text from page or do you want to load the url in a web browser? For the second part, you can use Select Layer By Attribute—Help | ArcGIS for Desktop and then use zoomToSelectedFeatures. Below is a sample for ArcMap: mxd = arcpy.mapping.MapDocument('/path/to/mxd')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
lyr = arcpy.mapping.ListLayers(mxd, "Target_Layer", df)[0]
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", ' "id" = 1234 ')
df.zoomToSelectedFeatures() Hope this helps, Earl
... View more
10-17-2019
07:44 AM
|
1
|
2
|
1943
|
|
POST
|
It's been a while, but those chancing upon this page with Windows environments can see this page: Deploying custom Python packages for ArcGIS Server—Documentation | ArcGIS Enterprise Ignore the vague title - the contents of the page go over how to clone the default Python 3 environment, install new packages. It is also possible to activate the ArcGIS Server Python 3 environment to run Python 3 scripts, providing another option beyond ArcGIS Pro. To answer your question Francesco, on Linux I believe to use Python 3 you simply have to be publishing from Pro. A windows Python 3 comes with the installation, located at: server/framework/runtime/ArcGIS/bin/Python/Scripts. Someone can correct me if I'm wrong, but out-of-the-box I think it uses with installation (via wine). To perform scripted operation, that's when you install the Linux-specific Python 3 installation. I'm not certain on a workflow to modify the default Python 3 environment accessed via wine...but perhaps the Windows documentation, if we suppose Wine is being used, might come into play to make changes/updates. -Earl
... View more
10-16-2019
06:46 AM
|
1
|
3
|
4843
|
|
POST
|
You're right Joshua. I updated the link to the 10.6.x page thinking it would remove confusion but had not realized the contents were not the same (and thus created more confusion!). I know from experience the environment is accessible so we can say that this documentation is accurate for 10.6.1: Deploying custom Python packages for ArcGIS Server—Documentation | ArcGIS Enterprise. The information on how to access the ArcGIS Server Python 3 is somewhat obscure and even the title of this article is not great. I'll submit feedback to update the 10.6.1 page and suggest an update the title. Thanks for your input! -Earl
... View more
10-16-2019
06:43 AM
|
2
|
0
|
2228
|
|
POST
|
Yes, you can see this page for more information: Deploying custom Python packages for ArcGIS Server—Documentation | ArcGIS Enterprise -Earl
... View more
10-15-2019
03:04 PM
|
0
|
2
|
2228
|
|
POST
|
Hi Raul, You are on the right track. I mentioned the rest operations briefly in this post: How to create hosted feature views including tables . At minimum, you need createService and addToDefinition to create the view. As I mention in the post, the easiest way to see what the params should be is to log the traffic. I think for what you have to do you need to run the join job first and then create the view from the result (unless for you workflow you need to create the view first and then the join?). If you're not seeing the submitjob request, it may help to run the job in a browser and use the "Preserve Log" or "Persist Logs" option of the browser developer tools. Hope this helps! -Earl
... View more
10-14-2019
06:55 AM
|
1
|
1
|
3429
|
|
POST
|
Hi Ming, My apologies for the delay. I'm glad the information was helpful! I am not sure about label classes and would have to test that out. Perhaps there is a limitation for label classes someone else can expand on? -Earl
... View more
10-14-2019
06:49 AM
|
0
|
0
|
2129
|
| 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 |