Tuesday, January 19, 2010

Utilize NGA Geoprocessing Tasks For Haiti in Your Applications

I was very impressed last week with the speed in which the National Geospatial-Intelligence Agency's eGEOINT Management Office made some useful web-based GIS tools available for first responders to the Haitian Earthquake.

The "DemoBase Haiti" site unfortunately still only works in Internet Explorer, which I've communicated to the agency is DEFINITELY NOT the browser of choice for pretty much anyone I know that is responding to the earthquake with their geospatial skills.

Go to a CrisisCamp or OSM Mapping Party and count the default IE users on one hand....they probably just got a laptop with Windows and haven't had a chance to install Firefox or Chrome or to wipe the hard drive and install Ubuntu :)

However, IE remains the security-threat cesspool of choice for the US Government computers so I guess most development STILL gears itself with IE as a baseline.

Well, I thought it would be useful to expose the really powerful pieces of the DemoBase tool, the Geoprocessing Tasks, to anyone that wants to call on the NGA / NRL servers in their web-based applications.

The DemoBase tool currently has one very nice GP task, a Zonal Statistics tool that allows you to draw a polygon anywhere in Haiti and get back a Population estimate.....as accurately as the ESRI Zonal Statistics tool and the NGA data is anyway.....like I said, it is an estimate.





But, it could be incredibly helpful for those on the ground to be able to view recent imagery in an application and then just digitize a polygon on a city block of rubble and be able to estimate the population of that block.

I'm not a full time ESRI JavaScript API developer, but I did get some help from David Spriggs at ESRI to boil down a process for sending a simple polygon to the ArcGIS Server and receive a population estimate in return - I hope it is helpful for anyone trying to add some analytic capability to their Haitian support efforts.

I also hope that a more widespread use of the geoprocessing tasks will show the agency how powerful exposing these services can be and they'll continue to offer more geoprocessing tasks to their current offering - lord knows they have the data to make some very useful and interesting applications....

In my example, I simply create a polygon (a rectangle) out of an array of coordinate pairs - but you should be able to adapt the functions to any GeoJSON or other polygons you might have in your application.

My code will simply initialize and send the polygon through to the Geoprocessing Task and then display the result.

Here is the code

2 comments:

David said...

Awesome Sean!

Could be operator error, but I'm comparing the geoprocessing service and the eGEOINT raw (http://egeoint.nrlssc.navy.mil/haiti/) service and getting different estimates.

Using the geoprocessing service I'm getting a 1 for 1 answer (1 person per sq km) wherever I select a region. Using the eGEOINT NRL server above I get a more reasonable answer such as Total Population: 2,044,487
Total Area: 274.884 km2

Seeing that Corey was involved I'm confident that I'm hitting the same data, so hopefully it's just a glitch...

Dave said...

FYI, I fixed the site and it now works in all browsers. Also, we are building a new version using only our ESRI JS API that will include new tools.