In GeoServer we are slowly evolving our REST interface, with the first step of having features and layers available as KML complete. The next logical step is to do an overview page in html for users to explore the data. This should give any meta information we have about the layers, links to download the full dataset in a variety of forms, a map interface to explore, along with CQL filters to drill down, ideally having those output in a variety of formats. ESRI has done some nice stuff in their REST api, and we should borrow their better ideas, and improve in other ways. Please poke around at http://sampleserver1.arcgisonline.com/arcgis/rest/services before starting implementation.
The first step should be pretty straight forward. For each layer create a path at http://.../geoserver/rest/layers/glc/glin.html that has an html representation of the layer. The html page should contain three main things - links to download the entire data set in a number of different forms, a map preview page, and a listing of all the meta information we have.
TODO: Right now it's geoserver/rest/geosearch/glc/glin.kml I think we should have the same hierarchy for all the rest stuff, not split it out in to 'geosearch'. So we should change 'geosearch' to 'layers' or something like that. If we need specific geosearch things, like the count stuff, do it under /rest/glc/glin.geosearch-kml or something like that - lower on the hierarchy.
The main idea here is to be able to replace custom KML templates that can be found in Google Maps Search, like [this http://maps.google.com/maps?f=q&hl=en&geocode=&q=Kraft+Foods+Benzo(a)pyrene+Emmissions&sll=42.159332,-87.044678&sspn=1.889383,4.169312&ie=UTF8&z=8] with a link to 'data source' (should come up with better name, that gets across you can download the data and get it in more forms). That will go to this page, and so the full downloads should be at the top. In time there may be security constraints, like some users being able to view but not get the source, but we don't have that difference now, so it doesn't matter.
We should have several different options for data download:
- KML (generates all the KML as a single file, for a user to do as they want)
- GML2 and GML3
And then a section for 'view in X', and have:
- Google Earth (reflector with super overlay)
- Google Maps (coming, see future)
- Virtual Earth (coming, see future)
And a section for 'access tiles in X'
- OpenLayers / WMS-Caching (link to GeoWebCache WMS)
- Google maps API (link to GeoWebCache Google Maps (see here)
- Virtual Earth API (link to GWC VEarth (see here)
These would ideally pop-up some instructions on how to embed, but also could just do have the URL and a link to the gwc instructions.
For a first crack just put in the current GeoServer preview window. In the future we'll want to expand this for more format options, like so you can put in some CQL and download that query as JSON or Shapefile, and do it in such a way that it teaches the user the URLs for WFS and eventually for restful feature access. For the first steps though just put in what we have in the current preview.
We can garner a good bit of meta information from what we display on capabilities. But this should be a nicer place to display it, and hopefully will encourage people to fill out more. The fields to be sure to get are:
- metadata link
- link to 'contact info' (this is server wide, so should just have some rest page at like rest/contact.html that lists that info).
- SRS (EPSG and WKT)
Then it'd also be good to list basically the describeFeatureType information in a more readable form. The attributeTypes / columns of the dataset, along with some of the type information. (esri does this, see here
Another idea is to add some of the capabilities information to html meta tags. A great candidate is keywords, as those can go in to html meta tags, there's already one for keywords. Investigate if there's other logical html meta tags where we can put more caps information, description? abstract?
Be sure to have a good link structure. Lots of links, to go up and down the hierarchy and get more information. ESRI does a good job of this, see http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer Lots of links back up, and then links in lots of different directions.
(rough thoughts for now, will expand and flesh out later)
More explore options - The map should let you do CQL and get out lots of different formats. Like everything that you can download as, you should also be able to query against in the CQL. ESRI has a lame query interface, we can do the same but much better.
Better CQL exploring - first step would just be to have a little tutorial that users can pop up and see. The cool thing past that could be to do auto-completion on the potential attributes. So if you type 'S' then it does an ajax 'STATE_NAME' that you can select, so you don't have to type those all in directly, since it's a limited vocabulary for the column names. Other thing that could be sweet is to be able to enter the geometry CQL by clicking on openlayers. It's cool to see intersects and touches, but not if you have to add lots of points in. Should be able to click point, line or polygon and then have that go to the query CQL interface.
View in Gmaps or VEarth - would be good to have those links also available, so any layer can be seen on top of those, with OpenLayers should be fine. Perhaps start with localhost key, so that any user who installs geoserver can see it that way, but it warns them that others will not be able to see it unless the api key is updated. Then can let an admin enter gmaps and vearth api keys in to geoserver admin console, and have them work. Also could perhaps do it all through openlayers, let an admin add the api key right there).
Embed in webpage/blog - generate an html code for a user to put an OpenLayers map. Ideally pick up the params, like the CQL and the width and height options. And even more ideal let users put a gmap or vearth right there, on the default OL map their looking at. I guess if the api keys were entered then they could just show up as potential background layers. Perhaps also with bluemarble and OSM.
Put in Yahoo! GeoCoder above the map so users can type in a location and zoom to that area of the map. Like 'Go to:' with a blank line where you can type in your address (not sure how we'll deal with projection issues? We'll need to be able to tell users that their search just isn't on the map)
Editing for admins - would be great if admins could edit fields right here, instead of having to go to the config interface. Or at least have a nice link to the admin interface to change things.
Style options - (this should be there for regular preview screen too). Should be able to have a drop down to select the styles that are configured as optional styles for this layer.
Styler - when we have styler we should let people style as they like on the preview screen (and then embed in their blog, etc). This does get down to slippery slope to fully on mixing, but I guess we just have a link to 'mix with other layers' or something like that, that takes one to the full interface. Also perhaps the REST page that's a level or two up could have all the layers on it.
Additional metadata - could pull in information from a link to an ISO 19115 document.
Tagging, rating, commenting - let users tag and rate the layer. Ideally we have user accounts for people to login, but could be ok to just let anyone put some tags up.