1

I'd like to setup a layer in GeoServer based on a table in PostGIS DB. The geometry column in the table has no SRID set (Find_SRID for this table returns 0). Geometries inserted into the table don't have the same SRID. Is it still possible to create a GeoServer layer from this table?

When I try to setup the layer, GeoServer sets "Native SRS" to one of the SRS present in the table data and I cannot remove it.

If its not possible, is the some possibility in GeoServer to serve global GIS data with mixed SRS?

3
  • 4
    It's poor practice to load data with varying SRIDs in a single table, and an antipattern to load data without any spatial reference at all. Rather than going forward with effectively corrupt data, you'd probably be best off re-loading the data with a single correct spatial reference (reprojecting as necessary once, instead of each time the data is accessed), which will make all your other steps significantly easier.
    – Vince
    Jan 13, 2020 at 17:08
  • As @vince says don't do this, it won't work and geoserver will produce random data
    – Ian Turton
    Jan 13, 2020 at 17:55
  • just to understand you, mixed SRS in DB is not data without spatial reference, or corrupt data, so what u mean with this? I guess, GeoServer than cannot do what i would hope: take the mixed SRS data and reproject it into a common projection i specify in e.g. WMS "srs" parameter.
    – george
    Jan 14, 2020 at 6:13

1 Answer 1

2

Your problem is stated here:

The geometry column in the table has no SRID set (Find_SRID for this table returns 0).

As a result GeoServer considers this unprojected data (it's just numbers not a position) and can't reproject it. GeoServer only considers the SRS of the geometry column not the individual projection of the geometries (which PostGIS doesn't return in a normal query) so can not process a column of this type correctly.

Spatial database tables should have a single enforced SRS (SRID) not a random mix, you can achieve this by reprojecting your random polygons to a common SRS before adding them to the database. GeoServer will then happily import and reproject your data to any SRS that is requested.

4
  • now i understand, thx a lot! but for a global GIS system which needs to keep precision, reprojecting data is for sure not good. could u point out some suggestions, how to store the data, or even maybe post some links to concepts of global GIS systems?
    – george
    Jan 14, 2020 at 14:23
  • If it's truly global then use WGS84 (or similar), but more likely you have a number of projects scattered around the world.
    – Ian Turton
    Jan 14, 2020 at 14:30
  • yeah, scattered around the world and u can jump from one to other ....
    – george
    Jan 15, 2020 at 9:02
  • then many tables is the best plan
    – Ian Turton
    Jan 15, 2020 at 9:07

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.