Wednesday, March 21, 2012

ArcGIS Online REST API

And there it is! the ArcGIS Portal REST API documentation was made public today. The API was there all the time of course, but using it needed some detective work using FireBug or your favorite HTTP sniffer.

You can of course continue on that path. You never know what you find along the way. But for those who want to get going quickly developing custom apps on the ArcGIS Online platform, the documentation should come in handy.

We've been using the API in some of our projects (like the gallery in geo.data.gov and the open government data label in geoplatform.gov), Kentucky's KyGovMaps site, and even the integration of Geoportal Server with ArcGIS Online I described earlier is possible thanks to this API. But it doesn't end there. Want to build your site in Drupal or Microsoft SharePoint? Now there's an API for that.

Or if you want to develop a custom application template like this one:


This template takes a webmap with (in this case) the location of dams. One of the attributes is the age of those dams. Using the ArcGIS Portal REST API, this (JavaScript) app, fetches the data included in the webmap (uploaded from a CSV). It then calculates the average age of dams visible in the current map extent and uses that to drive the gauge.

Whether you want to access a group to build your gallery from or do something interesting with the content of individual webmaps, the ArcGIS Portal REST API documentation helps you build your apps.

Perhaps this will now push me to finish up this Drupal module I had started a while ago. OR perhaps someone out there is adventurous enough to help me with that...

Saturday, March 10, 2012

I Want More Like This!

Last night I was reading Peter Morville's book on Information Architecture and apparently my brain did some batch processing overnight. Getting up before the rest of the house has the benefit of doodling a bit with some ideas I got delivered from my brain this morning.

I never knew there was a term for it, but apparently I was thinking of growing pearls. Every website has it. Even our Geoportal Server has it, but it's a bit underused at the moment and it's such a nice feature.

The Geoportal Server allows for searching for content as well as for browsing the catalog. The browse tree configuration essentially comes down to defining a number of searches (call them facets) that are listed. Typical examples are showing content by type or theme. This works well for those facets that have a limited domain.

The mechanism of browsing the entire catalog is also available for individual items. Open the Relationship page for an item and you'll notice a similar tree structure:


We searched (on the Geoportal sandbox site) for Redlands and then went to the details page for the map service returned. from there we see in the Relationships page that this map service 'operates on' a dataset for the ESRI Redlands Campus.

This relation is determined from the content metadata (see the full metadata for the items) using the ISO construction for this type of relation.

However, the Geoportal Server can do more than navigate relations included within the metadata. It can infer relations based on other things, like where did the metadata come from, who published it, and even show content with similar tags/keywords.

To enable this, you'll need to edit a few configuration files. No coding required.

Once you've setup your editing environment of choice, open .../geoportal/WEB-INF/classes/gpt/search/browse/browse-resource.xml. This file controls the relationships that will appear for individual resources (note: you'll see the structure for the overall Browse navigation in this same location).

The structure of this file is simple and reflects a basic tree of <item> elements:


The secret sauce is in the <query> element in this structure. In the overall Browse tree you'll find elements that essentially are basic 'fixed' searches like so:

<query>dataCategory=farming</query>

In the structure for the individual items, the element defines a search based on one of the indexed fields of the item at hand, like so:

urn:esri:geoportal:browse:resourceRelationship:keywords-keywords

In this example, the search generated will take the indexed keywords for the current item and then formulate a query based on that. This will be specific to every item and thus results in finding other related items.

The above example includes a couple similarity relations that will find other items with similar keywords/tags, similar content type, were harvested from the same repository (think other web services harvested from the same ArcGIS Server for example), and were published by the same publisher (111 items from NOAA's Coastal Services Center in the below example). From there you can filter and repeat your way through the catalog.



With the capability of adding your own fields to the Geoportal Server index, this allows you to build a rich network of related items that will give your users a different approach to finding interesting content from a single starting point: pearl-growing.

Next time I may write about 'berry-picking' or 'lobster trapping'. You never know what you end up finding in the field of information retrieval.