开发者

How can I convert a projection that's not part of spatial_ref_sys?

开发者 https://www.devze.com 2022-12-28 09:12 出处:网络
I\'m importing shapefiles into a Postgres+PostGIS database. Here\'s my usual procedure: * Find an srid in the spatial_ref_sys table where srtext appears to match the shapefile\'s .prj file

I'm importing shapefiles into a Postgres+PostGIS database.

Here's my usual procedure:

* Find an srid in the spatial_ref_sys table where srtext appears to match the shapefile's .prj file

* Upload the data into a new table using the shp2pgsql utility, specifying the srid using the -s flag

* Add the new table to my main geometry table, and on the way convert to an srid of 4269 (the Census standard projection) using ST_Transform

Unfortunately, the spatial_ref_sys table doesn't include Mississippi state's standard projection. The contents of their .prj file is as follows, where I've bolded the parts I usually try to match:

PROJCS["mstm",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",1300000.0],PARAMETER["Central_Meridian",-89.75],PARAMETER["Scale_Factor",0.9998335],PARAMETER["Latitude_Of_Origin",32.5],UNIT["Meter",1.0]]

I eventually found the ogr2ogr utility, and especially with the "peace and joy" promises, I decided to give it a try. I tried this command:

ogr2ogr -update -f "PostgreSQL" PG:"Connection details" 
    "File name.shp" -t_srs EPSG:4269 -nln Table_Name

I am now getting the error "Terminating translation prematurely after failed translation of layer" -- which seems to indicate that ogr2ogr is not 开发者_高级运维going to be the savior I imagined in getting arbitrary .prj files neatly into the 4269 projection.

Any ideas about what to do?


Here it is on spatialreference.org

http://spatialreference.org/ref/epsg/3814/

You just need to use epsg 3814. I highly reccomend spatialreference.org for finding SRIDs

0

精彩评论

暂无评论...
验证码 换一张
取 消