Hot answers tagged rest
15
It appears that ESRI has just released their GeoServices REST Specification. I believe that this is what you may be looking for.
13
This is a good question. While I like REST, I don't see a way to request Z and M values for geometries. It looks like this is possible with SOAP using the PointN object. It would be great to see this question evolve to list more differences.
Another factor is what clients you need to support - if it's just Silverlight, then SOAP is a lot more attractive.
...
9
There are many things you can do with the GeoServer REST API that are not specifically documented and that there are not code examples for. Here's the strategy for tackling those.
First, start with the examples in the documentation. Make sure you are familiar with how you can create a simple new layer or workspace using an HTTP POST with either XML or JSON.
...
8
I just used the link Jason posted above. I can't imagine when its released, the official spec will be much different. It was mostly a roll-up-your-sleeves, fire up Fiddler, hit the 10.0 sample servers and start hacking away at the implementation. There's nothing that's impossible, just tedious with lots of little issues to take into account. We won't even ...
7
The only documentation that I know of for esri's REST API is in their online help here:
http://help.arcgis.com/EN/arcgisserver/10.0/apis/rest/index.html
This is written more from the perspective of a consumer than a provider, but should be hackable.
There are parts of this API that are quite proprietary (some of the output formats) and impossible ...
6
REST - Representational State Transfer
REST basically means that each unique URL is a representation of some object. You can get the contents of that object using HTTP GET, to delete it, you then might use a POST, PUT, or DELETE to modify the object (in practice most of the services use a POST for this).
SOAP - Simple Object Access Protocol
SOAP is mostly ...
6
At a previous clients, we looked at this for ages and the long and the short of it, for them, was that SOAP has too much development lead time, and REST was easy for an organisation to implement.
It cna be argued SOAP aren't actually web services too...
Here's some arguments for you:
SOAP/REST
5
The bound variable key takes the form of the resource name + "ID".
This is not very clearly stated in the conceptual document you linked to, but I remember seeing it somewhere.
EDIT: See this PDF, slide number 45. Resources seem to be always identified by their identifier (id), which is ok, but I personally find this string-convention-based design very ...
5
Stick to a single where parameter in your query string. Here's an example of a where clause hitting multiple fields: ...
5
You should have a look at the REST Help for GP Task
To run the geoprocessing task, you need to provide an input. If your GP Service is Synchronous, then you need to call the Execute Operation. If your service is Asynchronous, then you need to call the SubmitJob Operation. Both of them take their input parameter in JSON Format.
In the case of a Synchronous ...
4
Have you tried any of the configuration examples in the docs (here)?
You can access layer information through e.g. http://localhost:8080/geoserver/rest/layers/giant_polygon.html
Publishing a shapefile works like this:
Consider a directory on the server /data/shapefiles/roads that contains the Shapefile roads.shp. The following adds a new datastore for the ...
4
The REST legend service was added in Service Pack 1. Has this server had Service Pack 1 installed? It appears that it has not.
'currentVersion' was added to serveral resources to indicate the version and patch level. See the latest ArcGIS 10 API documentation for more details.
4
You have not stated what version of ArcGIS Server you are running.
If you are on 9.3.1 your stuck with the WKIDs that REST supports:
Projected
Geographic
The other option (which I have done before) is submit a WKID request to Esri Support.
For me, we sent them the projection file and they created a NIM, and at the next version it was included. I know ...
4
Use esri.request() to hit each layer's REST endpoint to get info about fields. Here's a simple example:
<html>
<head>
<script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4"></script>
<script ...
4
It's hard, but not impossible, to hide a password, even from root.
The trick is to save the password in a password protected keyring (like the Gnome Keyring), unlock the Keyring once and then (from the same session!) run a script like the following (written in python). Please note that even if root can su to your account he still cannot open the Keyring ...
4
You'll be able to in 10.1 SP1. When you run a geoprocessing tool in Python, its return value is a result object. There will be a new arcpy.CreateGPSDraft function what accepts these result objects and from there the workflow from Python will be exactly the same as it is with map services now.
4
Unless your app is written in Java then the REST approach is the most elegant as it can be coded in any language that has an HTTP lib (all of them).
Any solution using selenium or something similar should be an absolute last resort, changes to the REST API will likely remain backward compatible so you can upgrade GeoServer with confidence, the UI will ...
3
You can create a workspace, datastore and layer (coveragestore) for a GeoTiff with curl and xml from outside the UI like so:
Create the workspace.
curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' \
-d '<workspace><name>wsgeotiff</name></workspace>' \
http://localhost:8080/geoserver/rest/workspaces
Then ...
3
If you're willing to do something absolutely moderately awful, you could get the contents of that page as HTML, and then use jQuery to get the links:
var extAnchors = $('b').filter( function( index ) {
if( this.innerHTML.match( 'Supported Extensions' ) )
return true;
} ).nextAll('a');
This gets all the anchor elements after the phrase ...
3
Looks like the whole Portland folder is gone from sampleserver2, and I didn't see any on ss1 or 3 either.
Here are a couple async gp services used in the Silverlight API samples
Clip Counties GPServer - used in this sample
Buffer Points - not sure if there is a live demo
3
You can specify them exactly like they are specified in the datastore.xml. The REST api allows for multiple syntaxes in connectionParameters. The following syntaxes are equivalent:
<port>5432</port>
<entry key="port">5432</entry>
You will find a description of what those additional parameters mean in the user guide.
3
Unfortunately the GML extension has more or less been abandoned due to lack of a maintainer for that extension. That said you can still upload GML as part of a WFS transaction. So a recipe that could work is to create a new empty layer (in postgis or something) via the REST api, and then issue WFS transactions to populate it.
3
Geoserver REST API can be constructed using
Path
GET (read)
POST (create)
PUT (update)
DELETE (delete)
http://geoserver.org/display/GEOS/User+Collaboration+REST+API
for selecting a SLD you need to GET {yourserver} {port} {user} {password}
/geoserver/rest/styles (exists already in rest api)
This might help for you too
...
3
I just tested a GET and POST request with my custom SOE, and it accepts both GET and POST requests just fine without any special configuration. postOnly=true as you know will force POST only requests, and should be used when data is modified. What kind of a response do you get when you try and submit a POST request to your SOE?
3
Unfortunately this is not documented in the api reference or samples. But here is the gist of it.
First create the store:
POST /rest/workspaces/<ws>/wmsstores
<wmsStore>
<name>wms</name>
<capabilitiesURL>http://somehost/wms?</capabilitiesURL>
<workspace>sf</workspace>
</wmsStore>
And then ...
3
A POST will always create a new resource and redirect you to it once created.
If you want to either create a new one or replace an existing one you must use PUT instead.
Mind, it will overwrite fully an existing layer group (btw, haven't tried it out, the above is just based on what you should expect from a REST based API).
2
Are you looking at exposing spatial tables from SQL Server 2008 Spatial? ESRI MapIt does this already and I believe the licensing allows those with AGS to have access to ESRI MapIt.
Some screens of what this looks like can be found on my blog: http://geo.geek.nz/development/hiding-databases-from-unauthorised-users-when-using-esri-mapit/
No need to write ...
2
I have done this already in an application. I did not fully implement the full REST api, but enough to get a query task to run and format the JSON correctly. I used ASP .NET MVC to build my endpoint. I tried doing this about a year ago with WCF and the JSON output was not formatted in such a way to work. The trick with MVC is to make sure you have a ...
2
OpenLayers currently has a layer aimed at the 9.3 REST endpoint, but it will work with 9.3.1 and 10.0 (and future releases that remain backwards compatible).
http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Layer/ArcGIS93Rest-js.html
2
I don't see how to do it. The REST API documentation discusses how to get information about SOEs as child resources of a MapServer (http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/index.html?admin.html). Logic would indicate that {MapServer URL}/exts should return a list of SOEs but it returns an error. Only when you specifically call down to the SOE ...
Only top voted, non community-wiki answers of a minimum length are eligible
