Set GeoServer to access a Postgresql database, Simple or Snapshot schema, populated by Osmosis

StackOverflow https://stackoverflow.com/questions/17920443

Pergunta

I have a postgresql database which I keep updated using Osmosis. Osmosis can write to two different database schemas, named Simple and Snapshot. There are not that much different from the database Geoserver uses, But I can't make Geoserver use it perfectly.

The main problem seems to be the way tags are stored in those DBs. I can add the nodes layer and display it with that default Points style, but as soon as I use a "ogc:Filter" in my style to filter the nodes by their "place" tag, the WMS is broken and does not respond (says: The requested Style can not be used with this layer. The style specifies an attribute of place and the layer is: TestDB:nodes)

Is there anyway to make GeoServer understand that one of those shemas, or make Osmosis update to the DB GeoServer knows?

Foi útil?

Solução

This is a case for using TRIGGERs to manage the integration. The two programs use two different schemas. You can CREATE TRIGGERs in the database which ensure that data written to one application is made available to another. Another option is you can set one or both to use VIEWs populated in part by the other application. In PostgreSQL, a VIEW can have triggers attached so these are not really

This is, in any case, a potentially large project so rather than offering sample code, I will offer a general outline of what sorts of things you need to think about.

  1. Are these generally applicable? If so do you want to start an open source integration project?

  2. Are both of these read-only workloads? Does data ever update? In general, if you are going to use views, updates pose the most concerns, so you want to run the views on the side not doing the updates if such is the case.

  3. What is the write model of both sides? Insert/Update? Append only? Static data? What data do you have to "replicate" between the schemas?

Once you have those answers it should be relatively straightforward to get started and ask for help (either as an open source project or here) where you get stuck.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top