[postgis-users] Problem in migrating shapefile to postgis

Obe, Regina robe.dnd at cityofboston.gov
Fri Nov 14 07:07:17 PST 2008


I suspect Vinh's problem is not only with the SRID.  PostGIS to my knowledge doesn't do any validation of SRID when loading  except to check its -1 or the SRID is in the spatial_ref_sys (I don't think it even does that much where SRID is concerned).   Given that, there should never be a problem with loading the data unless
 the data has grossly invalid geometries (e.g. weird dimensions, not enough points for a line, invalid geometry type, nonsense numbers like INFINITY) 
 
 or the shp2pgsql is not being used right
 
 I have had cases like that where I have had to go in the .sql generated file and remove clearly invalid geometries that were causing a transaction abort.
 
 
Vinh,
 
What errors are you getting exactly?  
Does the .sql file get generated or does it not get that far? 
 if you can't even generate the .sql file, then you are using shp2pgsql incorrectly or the executable can't be found.  
If it generates the .sql file, but you get a transaction abort, then something is wrong with some of the geometries in the file 
or your database is not spatially enabled.
 
Make sure you can do
 
SELECT postgis_full_version() 
 
on your database
 
Hope that helps,
Regina

________________________________

From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Burgholzer,Robert
Sent: Friday, November 14, 2008 9:31 AM
To: PostGIS Users Discussion; nguyenquangvinh20052005 at yahoo.com
Subject: RE: [postgis-users] Problem in migrating shapefile to postgis



You should still be able to load this data into postgis, it will default to SRID -1 if you do not include the –s switch.  

 

Once inside postgis, you can then gain at least some information about the data by querying the extent(the_geom) of the table.  That will tell you if it is in some sort of lat/lon projection (coords between -180 and +180), or if it is some sort of metric system (very large numbers).

 

If it is in a lat/lon system, then you should be able to get it to work approximately, with some lat/lon projection that works in your area.

 

HTH,

r.b.

 

Robert W. Burgholzer

Surface Water Modeler

Office of Water Supply and Planning

Virginia Department of Environmental Quality

rwburgholzer at deq.virginia.gov

804-698-4405

Open Source Modeling Tools:

http://sourceforge.net/projects/npsource/

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Burgholzer,Robert
Sent: Wednesday, November 12, 2008 12:53 PM
To: nguyenquangvinh20052005 at yahoo.com; PostGIS Users Discussion
Subject: RE: [postgis-users] Problem in migrating shapefile to postgis

 

First place to start to find the proper SRID is look for a metadata file for your shape.  If you have that, you may post on the list, perhaps someone can help.

 

r.b.

 

Robert W. Burgholzer

Surface Water Modeler

Office of Water Supply and Planning

Virginia Department of Environmental Quality

rwburgholzer at deq.virginia.gov

804-698-4405

Open Source Modeling Tools:

http://sourceforge.net/projects/npsource/

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of vinh nguyenquang
Sent: Wednesday, November 12, 2008 12:36 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Problem in migrating shapefile to postgis

 

Hi, everyone
 Can you help me load LopGiaoThong.shp vao trong postgis? I have problem
 with SRID or something else i don't know.
 I do it in this way: shp2pgsql -i -D -s LopGiaoThong.shp LopGiaoThong >
 LopGiaoThong.sql
                            psql -d postgis -U postgres -f LopGiaoThong.sql
 I do not know the parameter -s: what value it is to load LopGiaoThong.shp
 Can you show mw how to find the value of -s parameter (SRID) of my data or
 how to load my data to postgis?
 Thank you very much!


Re: I still can not load LopGiaoThong.shp to postgis. Even though, I tried with -s parameter: 32648, 4326, 3405. I really can not find the correct SRID's value of my data. I really appreciated if anyone can help me do it.
Thanks!

 

________________________________

Nước nào thường cho nhiều học bổng du học? Khám phá tại Yahoo! Hỏi & Đáp <http://sg.rd.yahoo.com/mail/vn/footer/def/*http:/vn.answers.yahoo.com> 


-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20081114/b2933d8c/attachment.html>


More information about the postgis-users mailing list