I am searching for any examples of implementing a logic that Esri has built with geoprocessing services. You author a custom tool or it can be a system tool >> you publish it exposing this functionality as a web service >> you consume the web service with a client.
A classical simple example: user can click on the map to create a point > the coordinates are sent to the server > buffering operation is being executed at the back-end > the buffer zone feature (or just an image) is sent back to client and shown on the map canvas. I've been developing Esri GP services for last 3 years and it has been a nice experience specifically since version 10.1.
Are there any examples of the open source system/solution that one could use to build a similar logic?
I've googled and found sextante gis but there was nothing specific on how this works and how much of logic that is available through Esri is available. 52North also seem to be working on that, but again I am missing the clean explanation of the concept.
Answer
Using Pre-existing WPS or Building Them
There is a whole description/tutorial on web processing services (WPS) found here. Most of this is going to be done using HTTP requests sent to a server like GeoServer that is hosting this process. The GeoServer link will outline the general process of hosting and calling a WPS using their software. GeoServer's WPS extension comes with JTS Topology Suite processes, which is a library of a common spatial functions such as buffering and intersection operations. Here is their example on executing a buffer operation using the JTS library.
Other Ways
There are other ways to do it though. Our web team uses queries against their PostGRE/PostGIS database to do simple analysis, but I am not familiar with that fully.
One idea I have been starting to research involves using open-source python scripts such as PySal/GDAL to do spatial analysis. You would need to use some JavaScript/AJAX (or whatever server-side language) to execute those scripts on your server and spit back out the results. It would be a complicated option, but I believe it would give you better customization options as opposed to ESRI.
I think you should be able to break down features into a GeoJSON string to pass as a parameter into the python scripts. From there, you would need to convert that result back into a GeoJSON string to pass back to the client to display. Python packages such as Shapely can interpret a GeoJSON string. Others might need some work-around written up to utilize GeoJSON, or there may be a better option I haven't thought about using.
Another option would be to use GeoTools to write up a Java web application that would do spatial analysis. This also supports GeoJSON strings and has some built in spatial analysis functions. They have some screenshots showing their various applications.
It is doable to create your own WPS or run a server-side script. It won't be as easy as ESRI makes it, but it would be free if you're using open-source.
Whatever route you decide, update it here since it is a great topic!
No comments:
Post a Comment