Pergunta

I am setting up a new site on plone using collective.geo.bundle, but I need to make the data accessible to desktop GIS. Two obvious ways of doing this are to use a postgres/postgis database, or to publish the data through a WFS service. The problem is it appears that plone stores pickles in the database, so a GIS wouldn't be able to make sense of the data, and there doesn't seem to be an addon which exposes a WFS. Two questions then:

  1. Is there a way to use configure plone to use a postgres/postgis database with geometry data types, so that the data can be read from outside plone?

  2. Is there a way to set up plone (e.g. through an addon) to expose a WFS?

Foi útil?

Solução 2

TL;DR: I don't think there is an out-of-the-box solution (using collective.geo.*) that already does this.

As mentioned in the comments, Plone itself doesn't deal with geospatial data at all, it's collective.geo.geographer that does this. More specifically, it's the GeoreferencingAnnotator that saves coordinates for IGeoreferenceable objects into their annotations (and loads them from there).

So, just forcing Plone to store its content in a relational DB, for example using RelStorage wont help you - Plone or RelStorage don't know about geospatial data, and will store those annotations like any other.

However, it shouldn't be too hard to write your own IWriteGeoreferenced adapter that writes the georeferencing data to a PostGIS database instead of annotations, using the UUID of the context to link the data to the objects, and maybe store some additional metadata like Title or URL. This georeferencing data could completely separate from your actual content - there's no need to put all the Plone content into a PostgreSQL DB.

A different approach could be to write an event handler for the ObjectGeoreferencedEvent, and publish the georeferencing data to a PostGIS DB (in addition to having it stored in annotations on the actual objects). Since you only want to access it read-only from a desktop GIS, you wouldn't have to worry about syncing that data in both directions.

Last but not least, I would strongly suggest to have a look at the collective.geo mailing list - people on there are usually very responsive and helpful, and I could well imagine someone else already had the same use case.

Outras dicas

A long time ago, I developed zgeo.wfs https://pypi.python.org/pypi/zgeo.wfs to expose geo-referenced Plone contents through WFS. It used to work on Plone 3 and it probably does not work anymore on Plone 4, nevertheless it could be a good starting point for you.

Note: I do not maintain it anymore as I prefer to use GeoJSON now.

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