[gdal-dev] ERROR 6: Failed to initialize PROJ.4 during warp

Even Rouault even.rouault at spatialys.com
Tue Sep 13 03:04:30 PDT 2016


Le mardi 13 septembre 2016 11:42:10, Gane R a écrit :
> gdalinfo for a file is as
> 
> Driver: PDF/Geospatial PDF
> Files: C:\la plata_final_sept8-1.pdf
> Size is 5100, 3300
> Coordinate System is:
> PROJCS["unnamed",
>     GEOGCS["unknown",
>         DATUM["WGS_1984 based datum",
>             SPHEROID["Sphere",6378137,0],
>             TOWGS84[0,0,0,0,0,0,0]],
>         PRIMEM["Greenwich",0],
>         UNIT["degree",0.0174532925199433]],
>     PROJECTION["Mercator_1SP"],
>     PARAMETER["central_meridian",0],
>     PARAMETER["scale_factor",0],
>     PARAMETER["false_easting",0],
>     PARAMETER["false_northing",0],
>     UNIT["Meter",1]]
> PROJ.4 string is:
> '+proj=merc +lon_0=0 +k=0 +x_0=0 +y_0=0 +a=6378137 +b=6378137
> +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '
> Origin = (-8569762.871896760500000,4652059.044867600300000)
> Pixel Size = (0.467090635994096,-0.467090635994096)
> Metadata:
>   CREATION_DATE=D:20160908221821-04'00'
>   CREATOR=Esri ArcMap 10.3.1.4959
>   NEATLINE=POLYGON ((-8567450.7732485905
> 4650589.7565349042,-8569692.8083013594
> 4650589.7565349042,-8569692.8083013594 4
> 651991.0284428885,-8567450.7732485905
> 4651991.0284428885,-8567450.7732485905 4650589.7565349042))
>   PRODUCER=TerraGo Technologies Publisher for ArcGIS GeoPDF Export version:
> 7.0.0.43
> Corner Coordinates:
> Upper Left  (-8569762.872, 4652059.045)
> Lower Left  (-8569762.872, 4650517.646)
> Upper Right (-8567380.710, 4652059.045)
> Lower Right (-8567380.710, 4650517.646)
> Center      (-8568571.791, 4651288.345)
> Band 1 Block=5100x1 Type=Byte, ColorInterp=Red
> Band 2 Block=5100x1 Type=Byte, ColorInterp=Green
> Band 3 Block=5100x1 Type=Byte, ColorInterp=Blue
> 
> when I try to do a gdalwarp to EPSG:3857  for the above file I get the
> following  '.

It looks like the PDF driver cannot reconstruct a valid projection from the 
encoded projection parameters in the PDF. k == 0 is indeed non sense for 
Mercator. What is the source projection supposed to be ?

From the proj.4 string, it looks a bit like it is already EPSG:3857, except 
that for EPSG:3857 you'd have k == 1, but if I do :

echo "-8569762.872 4652059.045" | \
          gdaltransform -s_srs EPSG:3857 -t_srs EPSG:4326

I get -76.983489691976 38.5123526219601 0
which is compatible of :
https://en.wikipedia.org/wiki/La_Plata,_Maryland

So it looks like it is indeed already encoded in EPSG:3857. Access to the 
source PDF would help investigating.

> 
> ERROR 6: Failed to initialize PROJ.4 with `+proj=merc +lon_0=0 +k=0 +x_0=0
> +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0
> ,0,0,0 +units=m +no_defs. k <= 0
> 
> any suggestions ??

Use gdal_translate in.pdf out.tif -a_srs EPSG:3857


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list