[postgis-tickets] [PostGIS] #2417: pgsql2shp doesnt see SRID
PostGIS
trac at osgeo.org
Fri Aug 9 18:29:56 PDT 2013
#2417: pgsql2shp doesnt see SRID
------------------------+---------------------------------------------------
Reporter: darkblueb | Owner: pramsey
Type: defect | Status: closed
Priority: medium | Milestone: PostGIS 2.1.0
Component: postgis | Version: 2.0.x
Resolution: wontfix | Keywords: srid, pgsql2shp
------------------------+---------------------------------------------------
Changes (by robe):
* status: new => closed
* resolution: => wontfix
Comment:
This affects 2.0 as well I think, but I don't want to fix it this round
and not sure I want to fix it so I'm going to mark as a won't fix.
The issue is that now that geometry_columns contains all tables
(registered), it will look in the geometry_columns table for the srid and
since you didn't make it a typed geometry, the srid will be 0 and wil be
found. If I were to fix this issue it would make the dump slower for
large tables taht are untyped since it wil fal into teh DISTINCT check
trap. I think to resolve, just best to follow best practice rather than
change this behavior.
Try creating your table as follows:
{{{
CREATE TABLE shp_test AS VALUES ('Example',
ST_SetSRID(ST_MakePoint(-122.427159, 37.760028),
4236)::geometry(point,4326));
}}}
and I bet it will work as you expect.
or if you really want the srid, then use SQL so it won't find the wrong
answer in geometry_columns
{{{
pgsql2shp -f test_shapefile.shp "SELECT * from ne3_test" shp_test
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2417#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list