1

Re: Reporting within Indicia - KML format

Hi,
I am creating an Indicia site to record squirrels in Northern Ireland and have been asked to provide a way to download a KML file of the records. I've been searching the wiki on how to do this and see that it should be possible - http://code.google.com/p/indicia/wiki/R … troduction but I can't find any instructions on how to do it.

I am working on the BRC test Warehouse and believe it has the capability to do this..?

Any help would be much appreciated.

Thanks,
Fiona

Fiona McCrory
CEDaR Website Officer
www.nmni.com/cedar

2

Re: Reporting within Indicia - KML format

Hi Fiona
Yes, the easiest way is to go via GeoServer's web services. Here's a link from the GeoServer layer preview pages:
http://testwarehouse.indicia.org.uk:8080/geoserver/indicia/wms/kml?layers=indicia:detail_occurrences

You can find other layer previews at http://testwarehouse.indicia.org.uk:8080/geoserver/web/?wicket:bookmarkablePage=:org.geoserver.web.demo.MapPreviewPage

I'd suggest that we setup a custom view for you on the database and expose it via GeoServer so you get a simple link like this for the KML. Otherwise you have to get into filtering the output which means there would be a bit more to learn.

John van Breda
Biodiverse IT

3

Re: Reporting within Indicia - KML format

So I just need to add the URL to my reporting page to allow the records to be downloaded in KML format. I hadn't really got that concept! Seems silly now.

What information would you need from me in order to set up a custom view for my survey?

Out of interest, what is involved in setting up the filtering for the output? Is there somewhere I can read a little about it to see if I would be ok with it?

Thanks,
Fiona

Fiona McCrory
CEDaR Website Officer
www.nmni.com/cedar

4

Re: Reporting within Indicia - KML format

There are a few different ways of filtering the output in GeoServer, though none of them are "OGC standard" though I doubt that matters in this case. The one that is relatively simple to get to grips with is CQL, described at http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html. You simply add a parameter called CQL_FILTER to the URL, setting it to the filter you need (URL encoded of course, e.g. spaces should be represented as %20, equals as %3D). So the first thing you need is a filter on your website ID, e.g. the following request gets website ID 1's records:
testwarehouse.indicia.org.uk:8080/geoserver/indicia/wms/kml?layers=indicia:cache_occurrences&CQL_FILTER=website_id%3D1

Note that I recommend you switch to the cache_occurrences layer as it is faster and has less load on the server.

If you still want a custom view added, we need to know which fields are going to be required for each point on the map (i.e. if they click on the point in Google Earth, what info is available), plus what filter criteria you want applied.

John van Breda
Biodiverse IT