2

Using GeoServer, I need to provide a graphical representation of the distribution of some metrics on a geographical basis. The geographical regions will be coloured and labelled according to the value of that metric.

I would like to have a "world" layer (containing all the continents and only continents), a "Europe" layer (containing only countries from Europe) and a "France" layer (containing all the cities in France). So to speak, "a tree of layers containing the immediate children", given that these entities (continents/countries/cities) reside in three distinct tables with one-to-many relationships defined.

I haven't found any "filtering" option when defining a layer from a PostGIS store, so a "cities" layer can only be based on the whole cities table (not on the cities in country X). Is there something I missed ?

P.S. I would rather have distinct layers than having one big layer and filtering with every request, because I think the caching feature can only refer to layers. Is this assumption correct ?

  • Let me try to rephrase... – Costi Ciudatu Jan 11 '11 at 15:57
  • Hope the edit clarifies at least the "normalisation" thing... Basically, I'm looking for a way to define (for each country in the "countries" table) a layer containing all the cities in the "cities" table which belong to that country. – Costi Ciudatu Jan 11 '11 at 16:09
  • I re-edited the question and I hope I phrased it right this time... and the title also... – Costi Ciudatu Jan 11 '11 at 16:32
3

I haven't found any "filtering" option when defining a layer from a PostGIS store, so a "cities" layer can only be based on the whole cities table (not on the cities in country X). Is there something I missed ?

There are basically two ways to filter data in Geoserver: CQL and OGC Filter encoding. Read more: http://docs.geoserver.org/2.0.x/en/user/filter/index.html

The new Geoserver beta additionally supports SQL views (http://gridlock.openplans.org/geoserver/trunk/doc/en/user/data/sqlview.html):

alt text

But in your case, I think it would make sense to just create a view containing only cities in France (if you want to avoid creating another table for that).

0

I don't really understand what you are trying to do but the new SQL views datastore in GeoServer 2.1beta may be what you are looking for. See http://gridlock.openplans.org/geoserver/trunk/doc/en/user/data/sqlview.html

  • Thanks. Having a view for each continent and each country defined in the DB is something I have considered, in case I won't find any better solution. – Costi Ciudatu Jan 12 '11 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.