17 votes

Download Dataset From ArcGIS REST Service

I always find myself in situations where I need to export all the data from a Map Service into a shapefile. Here is a very easy utility to use that will export every feature from a service and save ...
user avatar
  • 561
9 votes
Accepted

Passing token to ArcGIS Server REST service?

For Post Request You send it over inside a form in the body with the key token and the value is the token you received from this document explaining how to get token For Get Request You can send them ...
user avatar
8 votes

Download Dataset From ArcGIS REST Service

Download data stored on an ArcGIS REST MapServer one layer at a time using the command line and the Python package pyesridump. Example command: esri2geojson http://gis.naperville.il.us/arcgis/rest/...
user avatar
8 votes
Accepted

How to include a single quote / apostrophe in an ArcGIS Server REST API query string

As with the ArcObjects question above, the answer is to include a second single quote: &where=locality = 'O''CONNELL'
user avatar
  • 20.5k
7 votes

Add Item and Publish Service with ArcREST or ArcPy

I just uploaded a script uploads a CSV and publishes as a github-gist. You may want to change the input as right now its setup to run at command line and enter parameters manually when you execute. ...
user avatar
  • 15.3k
5 votes
Accepted

Adding feature layer to ArcGIS Online from REST API?

I've checked requests which were sent in ArcGIS Online to add Feature Service with Chrome dev tools and found that it uses 4 requests: Create Service - create feature service with REST API without ...
user avatar
  • 66
5 votes
Accepted

How can I get a map image from an ArcGIS mapserver centered on a single feature?

You can use my restapi module. It is very simple to do these kinds of things: import restapi import os url = 'http://gis.mda.state.mn.us/arcgis/rest/services/MN_Agriculture_EAB_Detection/MapServer' ...
user avatar
  • 8,374
5 votes

Seeking open source ArcGIS REST API compatible server?

The answer is 'yes' and 'no'. Let me explain. As Bill mentioned, there are plenty of implementations of various OGC standards WFS, WMS, TMS, etc. (see Geoserver, Mapserver, Tilestache, etc). However,...
user avatar
5 votes
Accepted

Extracting data from ArcGIS REST endpoint

You need to make a request to the ?query endpoint of the layer, and supply a where clause. Specify &f=json to receive the response in JSON. Note that ArcGIS Server by default only returns the ...
user avatar
  • 20.5k
5 votes
Accepted

Using output statistics in ArcGIS REST API query?

The statistics you need are the count of OBJECTID for each DFIRM_ID, so your onStatisticField should be OBJECTID instead of DFIRM_ID. The groupBy parameter should be set to DFIRM_ID: [{ "...
user avatar
  • 4,173
5 votes

Getting token without providing credentials

If you think of HTTPS security as using a postal system, a GET uses a postcard, and a POST uses a security envelope. Unfortunately, to extend the metaphor, you've written the username and password on ...
user avatar
  • 18.9k
4 votes
Accepted

ESRI REST Api - need to download batches of tiles

Turns out that ESRI just added this feature, but only for users of ArcGis server - the public server will have it turned off. The feature is called ExportTiles and it has been introduced in 10.2.1 for ...
user avatar
4 votes

ArcGIS REST Server Object Extension Examples

This is a template that I created and use as a boilerplate for most of my SOE projects. I hope this helps.
user avatar
  • 1,313
4 votes

List layer names from Map service using python

I use requests to do stuff like this: import requests def _post(service, _params={'f': 'pjson'}, ret_json=True): """Post Request to REST Endpoint Required: service -- full path to REST ...
user avatar
  • 8,374
4 votes
Accepted

How to delete features/records in ArcGIS Server using Python

I couldn't find this syntax listed anywhere so I'm sharing it in case it helps someone else. import urllib, urllib2, json serviceEndPoint = "http://<server>/ArcGIS/rest/services/<name>/...
user avatar
  • 20.5k
4 votes
Accepted

Is editing feature service through the REST API an okay approach?

Regarding your question as to whether you can edit a feature layer using the REST API, the answer is yes. See the Apply Edits section of the REST API for documentation on how do this this. However, ...
user avatar
  • 20.5k
4 votes
Accepted

Attempt to generate ESRI REST Token generate 'no client_id specified' error even when client_id is in the request body

I'm successfully using this method to obtain a token: def get_token(): # Retrieve a token from ArcGIS Online to enable access to private services token_params = { 'client_id': "...
user avatar
  • 20.5k
4 votes

Web Application and ArcGIS server are two different machines and unable to load layers using rest services

Yes this is possible! There are multiple approaches for this. You can install Apache http server from here and you have to configure modjk module in this using modJk configuration (You will define ...
user avatar
  • 1,027
4 votes
Accepted

How do I obtain a valid token for updating layer definition in a feature service?

I've found requestip to be somewhat unreliable. A better practice is to request a token with a referer instead. So, in the token request, use it with the URL of your app (or a made up, unique one): '...
user avatar
  • 15.3k
4 votes
Accepted

Finding tables related to layer using ArcPy?

Here is a Python 3 script that crawls a map service and prints out all of the relationships. You should just need to change the map service url. import urllib.request import json MapServiceURL = '...
user avatar
  • 166
4 votes
Accepted

How to define projection when adding features to a feature service layer using its ArcGIS REST endpoint?

I know you can send the following JSON to an addFeatures end point which defines the input coordinates. [{ "geometry" : {"x" : -115, "y" : 36, "...
user avatar
  • 15.3k
3 votes
Accepted

Getting Reconcile Versions geoprocessing tool published as ArcGIS Server service to work with new version?

Yes, you can publish this tool so it can reconcile versions that are created dynamically. You need to add a couple other tools to the model though. Most of the tool parameters can/should be model ...
user avatar
3 votes
Accepted

using REST "delete features" in arcgis api for javascript

the best way to get an idea of what you need to do in your javascript app to interact with ArcGIS Server or ArcGIS Online services successfully is to play around with the REST endpoint for a ...
user avatar
  • 5,053
3 votes

Create layer from ArcGIS REST URL in ArcObjects using C#

In Arc 10.2 you can use IMapServerRESTLayer. Using this avoids using SOAP. Here is some code (VB.Net) that shows how it is used, with some extra code. This code is for a AddIn button. The extra code ...
user avatar
3 votes

Connecting QGIS to ArcGIS world imagery?

This question appears to have resurfaced so it is worth adding an updated answer. Adding ArcGIS imagery and mapping is now easy in QGIS 3.x and you can add these services through the add data ...
user avatar
  • 3,649
3 votes

Download Dataset From ArcGIS REST Service

To download this data, you can visit https://geodatadownloader.com, specify your URL, pick an extent or a where clause if you like, then click "download". It'll save a geojson file to your ...
user avatar
3 votes

ArcGIS Rest performing query on feature service layers using within and intercepts

Ok, I figured out how to do this. As Stefan suggested, I had to add a couple of parameters to the URL: geometry (value = e.g. 639739.5,7598259.3) geometryType (value = esriGeometryPoint) ...
user avatar
3 votes

Attempt to generate ESRI REST Token generate 'no client_id specified' error even when client_id is in the request body

We use python requests library to make HTTPS post calls to arcgis online and to arcgis server. you can use urllib2, but we really like using requests. After you have that, these are the params we use ...
user avatar
  • 131
3 votes

Edit or update ArcGIS Online Web Map data using the REST API

This is definitely possible if the service is a FeatureService. I would do this using Python and either the built-in urllib modules or with requests (my preferred choice). This example shows how ...
user avatar
  • 8,374
3 votes
Accepted

Edit or update ArcGIS Online Web Map data using the REST API

The Update Item operation is how to do this. See helpful post on GeoNet. I was not sure how to implement Update Item or what parameter to use to POST the data I was requesting and modifying. I ...
user avatar
  • 981

Only top scored, non community-wiki answers of a minimum length are eligible