4

I'm converting layers from shape files to postgis with the below command:

shp2pgsql -s 22175 -c  -W "latin1" path/file.dbf' table_name db_name | psql -d db_name

Next, I add this layer to the GeoServer but the field native SRS is empty. I thought that the SRID were wrong so I run:

SELECT ST_SRID(geom) FROM table_name;

And to my surprise I get 22175 the conversion is not the problem. What I am doing wrong?

Note: already exits other layers have been added (by someone else) and that layers have the field native SRS filled with value EPSG:22175.

What am I doing wrong?

2
  • did you check the geometry_columns table?
    – Ian Turton
    Commented Jun 6, 2013 at 15:20
  • The table is empty. But if this is the problem, why the others layers works? Commented Jun 6, 2013 at 15:24

1 Answer 1

6

In my experience the native SRS field is empty usually because the user, as which Geoserver is accessing the database, does not have at least SELECT rights to the table.

4
  • 2
    Either the table, or the metadata views/tables.
    – Alex Leith
    Commented Jul 9, 2017 at 5:14
  • 1
    That, and you have to start from a new store if the table owner was wrong in PostGIS (that is, if you had to update it with ALTER TABLE … OWNER TO …). Commented Apr 16, 2020 at 14:26
  • Is starting from a new source the only way? I have a flow where I copy computation results from an outside database into the Geoserver PostGIS database. The source is in other words updated. The new layer is indeed missing the source sis... Commented Jul 8, 2021 at 7:09
  • You can create an SQL view instead, just using a standard "SELECT * FROM table_name", and that seems to "refresh" it
    – Alistair R
    Commented May 22, 2023 at 5:44

Your Answer

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

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