[postgis-tickets] [PostGIS] #2417: pgsql2shp doesnt see SRID

PostGIS trac at osgeo.org
Fri Aug 9 11:50:28 PDT 2013


#2417: pgsql2shp doesnt see SRID
-----------------------------+----------------------------------------------
 Reporter:  darkblueb        |       Owner:  pramsey      
     Type:  defect           |      Status:  new          
 Priority:  medium           |   Milestone:  PostGIS 2.1.0
Component:  postgis          |     Version:  2.0.x        
 Keywords:  srid, pgsql2shp  |  
-----------------------------+----------------------------------------------
 using 2.1rc2, '''pgsql2shp''' does not see SRID in a trivial dump

 {{{
 dbb at xps-8300:~$ psql ne3_test
 psql (9.2.4)
 Type "help" for help.

 ne3_test=# CREATE TABLE shp_test AS VALUES ('Example',
 ST_SetSRID(ST_MakePoint(-122.427159, 37.760028), 4236));
 SELECT 1
 ne3_test=# \d shp_test
     Table "public.shp_test"
  Column  |   Type   | Modifiers
 ---------+----------+-----------
  column1 | text     |
  column2 | geometry |

 ne3_test=# select column1, st_asewkt(column2) from shp_test ;
  column1 |               st_asewkt
 ---------+----------------------------------------
  Example | SRID=4236;POINT(-122.427159 37.760028)
 (1 row)

 ne3_test=# select st_isvalid(column2) from shp_test ;
  st_isvalid
 ------------
  t
 (1 row)

 ne3_test=# \q

 dbb at xps-8300:~$
 /home/shared/srcs_xps8300/postgis-2.1.0rc2/loader/pgsql2shp -f
 test_shapefile.shp ne3_test shp_test
 Initializing...
 Done (postgis major version: 2).
 Output shape: Point
 Dumping: X [1 rows].

 dbb at xps-8300:~$ ogrinfo test_shapefile.shp
 INFO: Open of `test_shapefile.shp'
       using driver `ESRI Shapefile' successful.
 1: test_shapefile (Point)

 dbb at xps-8300:~$ ogrinfo test_shapefile.shp -al
 INFO: Open of `test_shapefile.shp'
       using driver `ESRI Shapefile' successful.

 Layer name: test_shapefile
 Geometry: Point
 Feature Count: 1
 Extent: (-122.427159, 37.760028) - (-122.427159, 37.760028)
 Layer SRS WKT:
 GEOGCS["Hu Tzu Shan 1950",
     DATUM["Hu_Tzu_Shan_1950",
         SPHEROID["International 1924",6378388,297,
             AUTHORITY["EPSG","7022"]],
         TOWGS84[-637,-549,-203,0,0,0,0],
         AUTHORITY["EPSG","6236"]],
     PRIMEM["Greenwich",0,
         AUTHORITY["EPSG","8901"]],
     UNIT["degree",0.0174532925199433,
         AUTHORITY["EPSG","9122"]],
     AUTHORITY["EPSG","4236"]]
 COLUMN1: String (7.0)
 OGRFeature(test_shapefile):0
   COLUMN1 (String) = Example
   POINT (-122.427159 37.760028)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2417>
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