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:
geom3857
…
I’m talking about having Geoserver use a specific geometry column as the native SRID and default projection.
Answer
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";
No comments:
Post a Comment