Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

ESRI announced that they are releasing the ArcGIS REST API as open technology. I've got an ISP running Sql Server 2008 with IIS7.

Does anyone know of a good walk through showing how I can write C# using WCF to expose spatial tables compliant with a particular spec (ideally ESRI's)?

Does anyone know where ESRI's spec is?

share|improve this question
add comment

9 Answers 9

up vote 16 down vote accepted

It appears that ESRI has just released their GeoServices REST Specification. I believe that this is what you may be looking for.

share|improve this answer
    
That's it, Thanks Ryan! –  Kirk Kuykendall Sep 7 '10 at 19:10
add comment

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 make ours 100% compatible but it covers 85% and all the client apis seems to work pretty well (that was the only reason I did it to begin with)

here's a demo catalog (lots of little bugs in there :) [bFlood - removed old link]

we're running it on AppEngine (python) and its pretty tightly coupled with the underlying spatial structures but it probably could be made into a decent .Net WCF project. Not sure how we would distribute it though

cheers brian

Update - 3/8/12 - I just saw this post pop up in stackexchange so I figured I'd update the content. You can have your FeatureService running in minutes if you try out the Arc2Earth Sync beta. the backend works with Google Fusion Tables and CartoDB but we'll be supporting other providers very soon. You don't need anything except ArcView 9.2 or greater...

here's a blog post showing how to start collecting field data in minutes using the ArcGIS.com mobile apps: http://www.arc2earth.com/2012/03/arc2earth-sync-live-mobile-data-collection-in-5-minutes/

share|improve this answer
2  
Brian Flood? Kirk Kuykendall? It's like the whole ESRI forums band is back together again! –  Sebastian Good Jul 30 '10 at 1:22
    
Hey Brian, great to hear from you. I'm hoping the bounty will entice someone to do exactly what you and Jason describe, and post their results somewhere like codeplex. If not, maybe I'll take a crack at it. @Sebastian, good to see you here too! –  Kirk Kuykendall Jul 30 '10 at 19:04
2  
@kirk - yea, I would expect a community project to startup at some point. It would need to be flexible enough to allow for multiple spatial backends, probably a plugin architecture to wire up any providers version of maps/layers/features (e.g sql azure, postgis, geoserver, mapguide etc) @Sebastian - yea, ESRI forums with search that actually works. cheers! –  bFlood Aug 2 '10 at 13:06
add comment

here there is an example: http://www.arcgis.com/home/item.html?id=6d28a606369c43fd9a6f929541ae7c93

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

add comment

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 JSONP result which will pull the callback query parameter and make the correct jsonp response. I will try to post something up. You can take a look at the response here:

http://www.ci.austin.tx.us/GIS/TrafficViewer/Home/JsonpIncidents/query?f=json&where=1%3D1&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=*&outSR=4326&callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback

However, only the callback parameter is used:

http://www.ci.austin.tx.us/GIS/TrafficViewer/Home/JsonpIncidents?callback=woot

Edit: Here is how to implement a JSONP result in ASP .NET MVC

http://stackoverflow.com/questions/758879/asp-net-mvc-returning-jsonp

Edit #2: Here is a code example that I quickly made and put up on dropbox.

http://dl.dropbox.com/u/28924446/EsriGeoServicesExampleMvc3.zip

share|improve this answer
add comment

@JasonBirch - i think the main draw for even doing this is the ability to integrate with esri apps/apis/arcgis.com. If esri pulls the plug on using these cheaply (free), it becomes far less important. It's unclear to me what they plan to do with ArcGIS.com and even how it is licensed right now. I saw it as a central location for data/services where web applications could be registered, something like an appstore for esri data. 3rd parties register multi-tenant web(cloud) apps, esri takes a cut and your app is instantly available to all takers compatible with the rest api spec. in this light, it makes sense to open the rest api and allow as many services to integrate with the hub as possible. geospatial data search/storage is quickly on its way to to being commoditized, so move it up a notch and try to control the app space.

I think your OData comment has merit but IMO, that's a ways off. and more importantly, without a extensively distributed and well loved client app (something Google Earth), any well-written spec has the potential of withering on the vine. Not saying that's the case with OData, there are lots of MS devs out there who will get this wired up for free in VS, but I don't see it in the short term. my 2 cents...

(btw, there seems to be a pretty short comment length, hence the new answer instead)

share|improve this answer
1  
Yeah, this site is intentionally designed to avoid discussion :) FYI, Haris and I are working through getting OData working with GeoREST (he's working, I'm nagging. Geometry in strings with extended attribute indicating type (KML/GML/GeoJSON). –  JasonBirch Aug 3 '10 at 22:09
    
that sounds really interesting, is there any info online? –  bFlood Aug 4 '10 at 1:40
    
not yet, but would love to chat about it. We've over-thought it several times already :) BTW, if include my @username, I get notifications of response :) –  JasonBirch Aug 6 '10 at 6:43
    
ahhh, ok @JasonBirch it is (should have guessed this). let's definitely chat, I'd love to hang OData support off A2E clouds (as long as there's a sane method for handling geometry but now that I know you and haris are on the case, we're all good!) –  bFlood Aug 6 '10 at 11:11
add comment

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 something yourself? ;)

Cheers

share|improve this answer
    
Hey Jithen, is the Spatial Data Service discussed in this PDF (esri.com/library/brochures/pdfs/esri-mapit.pdf) using the ESRI REST API, WCF services, or something completely different? I'm guessing that MapIt is non-free if you're not running AGS; if so, it would be beneficial for the community to develop something that exposed the ESRI REST API directly from MS SQL Server Spatial without additional cost, especially for small apps that could run off SQL Express. –  JasonBirch Jul 31 '10 at 3:38
    
Hi Jithen - I downloaded the trial version of MapIT at 1.0 and at that time I needed to install it on the same machine where IIS is running. My ISP does not allow this. Also I could not run MapIT on a dev server then deploy the website to a production server - it has to be run on the production server. Maybe this has changed? –  Kirk Kuykendall Jul 31 '10 at 3:43
1  
@JasonBirch Hi Jason, The SDS is a seperate implementation from that of the REST API but provides a similar interface providing you with the ability to run queries against SQL Server Spatial. An example query: servername/SDS/databases/sandbox/dbo.PostcodeBoundaries/… The response can be read by any if the API's. ESRI MapIt has a number of key and useful features. For example on-the-fly projection and data loader which is not worth writing. –  jiriteach Jul 31 '10 at 6:22
    
@Kirk Hi Kirk, 1.1. includes a number of new features which are mainly enhancements to the loader but also the ability to easily deploy the SDS. Azure support is now included as well. MapIt just needs IIS and the ability to talk to your SQL Server. Its actually very easy to setup and run but as mentioned their is the ability to deploy into azure now with a headless UI so this might help you. Cheers –  jiriteach Jul 31 '10 at 6:25
add comment

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 implement by an open source project unless these format specifications are also made available.

As well, some of the REST APIs aren't especially RESTful. For instance, look at the Feature Service. There seem to be separate "endpoints" for add/update/delete/query instead of using standard HTTP verbs to operate on resources. This puzzles me; I know that esri has some pretty smart people there who understand REST. My guess is that these calls map to some kind of SOAP interface, and esri felt that it would be easier for them and their clients if they maintained consistency between them.

My opinion? If you are only looking at sharing data (not map configuration, metadata, etc) and are not in a rush, you may be better off waiting until Microsoft figures out how they're going to represent spatial data types in EDM. With this in place, you could easily create truly RESTful access to your spatial tables using OData and probably RIA-enabled OData at that. This may be pie-in-the sky for all I know though.

share|improve this answer
    
Thanks Jason. That's a good point about proprietary output formats. First pass I'll just want json, html, and image. Ideally, what I'd like is a C# project that uses WCF WebHttp Services in .NET 4 to fetch data from Sql Server 2008 and return in a form that any of ESRI's web SDK's can digest. –  Kirk Kuykendall Jul 26 '10 at 22:02
    
Ah, sorry, yes. I missed the subtext that you were looking to service esri client software. Absolutely makes sense to try to implement the API in that case –  JasonBirch Jul 29 '10 at 7:43
add comment

It sounds like you may just end up replacing the functionality of ArcGIS doing that. I would recommend utilizing an existing open source project to implement such a system if one becomes available that supports that API, perhaps write you own adapter for an open source project. Maybe one exists but I have not looked very hard yet. I'm not sure they have released a full API specification just yet but if you are in a hurry you could just use the existing API documentation and test your implementation against existing ESRI software.

share|improve this answer
    
Thanks Dandy, I guess eventually there will be an open source project. I find it strange that ESRI would announce it, but not provide a link to the spec. I'm not even sure what a REST API spec would look like. Just an example of a spec along with a code samples showing how one would implement it (with .NET) would be helpful. –  Kirk Kuykendall Jul 23 '10 at 21:51
    
I remember some hype that was spreading around for the FGDB system being open but I think they only opened up a code API to it rather than publishing a spec. I wouldn't get your hopes up but you should be able to easily implement something just using the consumer documentation as @JasonBirch also said. –  Dandy Jul 24 '10 at 21:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.