Select to view content in your preferred language

How to use without local arcgis pro install?

147
4
Monday
PeterPurnyn
Emerging Contributor

I want to write an application that solely relies on API keys in order to automate some tasks using ArcGIS pro.
I am using this library to execute some functions. I am not using notebooks to run it or run it within arcgis pro and I am developing on windows using conda for the environment management.

My problem is that I am finding that some of the functions rely on the local install of arcgis pro
-  enriching a buffer study area,
-  converting from shapely to arcgis polygons.

Since we have a paid license to use it, and we have supplied a api key to the GIS object and then supplied the GIS to the functions in question, why do I still need the arcgis application installed locally and logged in?

This makes deployment much harder than it needs to be for us as we are running the application as a service on a VM and the API key owner has to login and change the password every time the password needs to be changed due to company policy. It would be nice to eventually package the whole application as a single executable.

Is it possible that functions that demand the Arcgis Pro software be labeled? It is very frustrating using a function and realizing it is not just a wrapper for the api calls. Is using docker enough or will it demand that Arcgis Pro be installed and logged in too?

0 Kudos
4 Replies
SimonSchütte_ct
MVP Regular Contributor

For using geoprocessing tools, you need ArcGIS Pro on your local machine
or when implementing a server solution, you will need ArcGIS Enterprise and run your code on the ArcGIS Server machine.

"ArcPy is primarily used for core GIS applications. It is a Python package that provides a way to perform various tasks related to geographic data analysis, data conversion, data management, and map automation, as well as access to the approximately 2,000 geoprocessing tools using Python.

It requires an ArcGIS product to use, such as ArcGIS ProArcGIS Server, or ArcGIS Notebooks*." (*Adv. version for ArcPy)
ArcPy and the ArcGIS API for Python—ArcGIS Pro | Documentation

 

In the past, it was possible to license ArcGIS Engine, but it is now deprecated. I am not aware of any alternative. Now, to use arcpy you need ArcGIS Pro licensed for Desktop apps and ArcGIS Enterprise/Server for server apps.

If you have ArcGIS Enterprise, I´d recommend to publish Tools you need as a geoprocessing service ,you can than interact with it.

 

0 Kudos
PeterPurnyn
Emerging Contributor

I am not using arcpy, I am using the arcgis python api.

"It can be used both interactively and through scripting, making it a versatile tool for GIS professionals. The ArcGIS API for Python is included with ArcGIS Pro, but also works with ArcGIS Online or ArcGIS Enterprise."

https://github.com/Esri/arcgis-python-api/blob/master/guide/12-enrich-data-with-thematic-information...

Based on my own experience working with this API, it can be used without ArcGIS pro being installed or logged into if you provide the api key. Unless you use certain functions.

I haven't tried yet but I doubt that making an API request requires a local install of arcgis pro:
https://developers.arcgis.com/arcgis-rest-js/demographic-data/

If the python api cannot do it then I will have to make direct api requests, but my question is why the python api isn't just a wrapper for api calls and requires the local install.

0 Kudos
pc2
by
Emerging Contributor

I don't know if you're asking for solutions for buffer and polygon conversion but I am posting this in case others find this useful.

I think this buffer will use the buffer REST API: https://developers.arcgis.com/python/latest/api-reference/arcgis.geometry.html#buffer

Sometimes there are multiple options to do something. For buffer, there is another buffer function that uses arcpy, which they happen to state in the documentation: https://developers.arcgis.com/python/latest/api-reference/arcgis.geometry.html#arcgis.geometry.Geome...

As for converting from shapely to ArcGIS polygon, one should be able to convert it to an ArcGIS geometry. See shapely's documentation for a GeoJSON-like mapping that can be used to initialize a arcgis.geometry.Geometry object.

Something like this should work to convert shapely to an ArcGIS Geometry object:

import shapely
from arcgis.geometry import Geometry

# convert shapely geometry to arcgis geometry
Geometry(shapely.geometry.mapping(shapely_geometry))

 

PeterPurnyn
Emerging Contributor

In the end I just wrote my own buffer generation code and conversion code instead of using arcgis python api.

0 Kudos