10

I have a PostGIS table with two geometry columns, both multipolygon but one with SRID 4326, the other 3857. When publishing the table in Geoserver, I realize that Geoserver defaults to using the first geometry column in the list of columns, but I was wondering if there is a way to configure Geoserver to use a specific geometry column?

I’m not talking about configuring the SLD to render using a specific geometry column, ie:

<se:PolygonSymbolizer>
<se:Geometry>
<ogc:PropertyName>geom3857</ogc:PropertyName>
</se:Geometry>
…
</se:PolygonSymbolizer>

I’m talking about having Geoserver use a specific geometry column as the native SRID and default projection.

1 Answer 1

4

The usual way to deal with this situation is to expose the geometry column you want using a view. Then just point GeoServer at the view rather than the table:

CREATE OR REPLACE VIEW parcels_3857 AS 
SELECT "PARCEL_VIEW".geom_3857 as geom
FROM "PARCEL_VIEW";
1
  • 6
    This certainly seems like a reasonable and logical way to do this, but it seems like more of a workaround of a missing feature of Geoserver than the standard procedure. Thanks for the response.
    – nick_g
    Apr 8, 2014 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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