[gdal-dev] ogr2ogr failing on postgis?

Dmitry Baryshnikov bishop.dev at gmail.com
Sun Apr 10 08:56:47 PDT 2016


Hi Paolo,

It seems to me that your shape spatial reference not present in 
spatial_ref_sys and GDAL try to import it into spatial_ref_sys.
Your shape file have such SRS:
PROJCS["Monte_Mario_Italy_zone_1",GEOGCS["GCS_Monte 
Mario",DATUM["D_Monte_Mario",SPHEROID["International_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["Meter",1]]

If I execute such SQL: select * from spatial_ref_sys where srtext like 
'%Monte_Mario%' I received:

4265;"EPSG";4265;"GEOGCS["Monte 
Mario",DATUM["Monte_Mario",SPHEROID["International 
1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],AUTHORITY["EPSG","6265"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745 
(...)"
4806;"EPSG";4806;"GEOGCS["Monte Mario 
(Rome)",DATUM["Monte_Mario_Rome",SPHEROID["International 
1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],AUTHORITY["EPSG","6806"]],PRIMEM["Rome",12.45233333333333,AUTHORITY["EPSG","8906"] 
(...)"
3003;"EPSG";3003;"PROJCS["Monte Mario / Italy zone 1",GEOGCS["Monte 
Mario",DATUM["Monte_Mario",SPHEROID["International 
1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],AUTHORITY["EPSG","6265"]],PRIMEM["Greenwich",0,AUTHORITY[" 
(...)"
3004;"EPSG";3004;"PROJCS["Monte Mario / Italy zone 2",GEOGCS["Monte 
Mario",DATUM["Monte_Mario",SPHEROID["International 
1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],AUTHORITY["EPSG","6265"]],PRIMEM["Greenwich",0,AUTHORITY[" 
(...)"
26591;"EPSG";26591;"PROJCS["Monte Mario (Rome) / Italy zone 1 
(deprecated)",GEOGCS["Monte Mario 
(Rome)",DATUM["Monte_Mario_Rome",SPHEROID["International 
1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],AUTHORITY["EPSG","6806"]], 
(...)"
26592;"EPSG";26592;"PROJCS["Monte Mario (Rome) / Italy zone 2 
(deprecated)",GEOGCS["Monte Mario 
(Rome)",DATUM["Monte_Mario_Rome",SPHEROID["International 
1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],AUTHORITY["EPSG","6806"]], 
(...)"

I think you need to reproject shape file to EPSG: 3003 or defined it for 
shape file.

Best regards,
     Dmitry

10.04.2016 18:23, Paolo Cavallini пишет:
> Hi all,
> I have an ogr2ogr command, from shp to pg, that fails because it
> requests write access to spatial_ref_sys. An apparently identical
> command on another file runs smoothly. Any hint?
> Details and data documented here:
> http://hub.qgis.org/issues/14650
> Thanks.



More information about the gdal-dev mailing list