Hi,
remember some months ago, while we were discussing the improved catalog API, I suggested that it would have been possible to create a datastore on top of the catalog API?
Well, last Sunday I had a spare hour and worked a bit on it, creating the really bare minimum version of the store that generates features out of layers.
Here is a screenshot out of openlayers (I have many worldwide layers, so not that interesting):
and here is an excerpt of the GML output:
<nurc:layers fid=“layers.LayerInfoImpl–570ae188:124761b8d78:-7fcc”>
nurc:workspacetiger</nurc:workspace>
nurc:nametiger_roads</nurc:name>
nurc:titleManhattan (NY) roads</nurc:title>
nurc:abstract
Highly simplified road layout of Manhattan in New York…
</nurc:abstract>
<gml:Polygon srsName=“http://www.opengis.net/gml/srs/epsg.xml#4326”>
<gml:coordinates xmlns:gml=“http://www.opengis.net/gml” decimal=“.” cs=“,” ts=" ">
-74.02722,40.684221 -73.907005,40.684221 -73.907005,40.878178 -74.02722,40.878178 -74.02722,40.684221
</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</nurc:bounds>
</nurc:layers>
</gml:featureMember>
<nurc:layers fid=“layers.LayerInfoImpl–570ae188:124761b8d78:-7fca”>
nurc:workspacesf</nurc:workspace>
nurc:namearchsites</nurc:name>
nurc:titleSpearfish archeological sites</nurc:title>
nurc:abstract
Sample data from GRASS, archeological sites location, Spearfish, South Dakota, USA
</nurc:abstract>
<gml:Polygon srsName=“http://www.opengis.net/gml/srs/epsg.xml#4326”>
<gml:coordinates xmlns:gml=“http://www.opengis.net/gml” decimal=“.” cs=“,” ts=" ">
-103.87256379,44.37740331 -103.63794182,44.37740331 -103.63794182,44.48804281 -103.87256379,44.48804281 -103.87256379,44.37740331
</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</nurc:bounds>
</nurc:layers>
</gml:featureMember>
For the curious the current code is here:
It’s really just a proof of concept, It lacks tests, comments, javadocs, pretty much every possible kind of optimization.
One annoying thing that I’ve noticed playing with it was me trying to do something like “ah, let’s only see the layers in namespace ‘sf’” (by adding it in the path, virtual service) and GeoServer responding me “don’t know what nurc:layers is”. Gah
(the published catalog is still a layer, so it can only be seen when calling the global endpoint, or its own workspace specific one, but not others).
Anyways… is there interest? Anyone wants to pick it up and turn it into something useful?
Cheers
Andrea
–
==
GeoServer training in Milan, 6th & 7th June 2013! Visit http://geoserver.geo-solutions.it for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it