[gdal-dev] Sphere projection definition problem with ogr2ogr

Frank Warmerdam warmerdam at pobox.com
Wed Nov 28 17:11:21 EST 2007


Limei Ran wrote:
> Hi:
> 
> I can not define the earth sphere as +a=6370000.0 +es=0.0 when I use 
> ogr2ogr command.  For instance,
> ./ogr2ogr -f "ESRI Shapefile" -a_srs "+proj=lcc +a=6370000.0 +es=0.0 
> +lat_1=33 +lat_2=45 +lat_0=40 +lon_0=-97" out.shp in.shp
> will fail.  But,
> 
> ./ogr2ogr -f "ESRI Shapefile" -a_srs "+proj=lcc +a=6370000.0 
> +b=6370000.0 +lat_1=33 +lat_2=45 +lat_0=40 +lon_0=-97" out.shp in.shp
> will work.
> 
> cs2cs in PROJ.4 will allow you to define the sphere as +a=6370000.0 
> +es=0.0.
> 
> A sphere in OGR can only be defined as +a=6370000.0 +b=6370000.0, 
> right? 

Limei,

Correct.  OGR has a rather limited PROJ.4 parser and doesn't
understand lots of the more esoteric options.

> Also, do I always need +no_defs in projection definition?  What 
> is it for?

It tells PROJ.4 not to look in a defaults file for some
sorts of defaults.  It can be helpful to ensure nothing
surprising is happening.  OGR ignores it though since it
never looks in the defaults file anyways.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list