[Proj] Proj command usage

Frank Warmerdam warmerdam at pobox.com
Tue Sep 4 09:57:28 PDT 2007


Herve Baille wrote:
> Hello
> 
> New in this list.
> We are changing our own projection functions for a standard tool, 
> libproj4, on Sun Sparc Solaris 10.
> We project (latitude=45, longitude=0) to a Lambert conic conform 
> projection called "extended Lamber II" used in France.
> Our program gives (x=415728.737817, y=2002668.173285), which is very 
> close to the result of the National Geograpgic Institute.
> The "proj" command (with correct projection parameters):
> echo 0 45 | proj +proj=lcc +lon_0=2.3372917 +lat_0=46.8 +lat_2=45.8989 
> +lat_1=47.696 +x_0=600000 +y_0=2200000 +ellps=clrk80
> gives:
> 415663.74       2002665.67
> We are not very far on Y axis but 65 meter away on X axis.
> If I specify the XYZ offset between WGS84 and NTF (dx=-168, dy=-60, 
> dz=320) with option +towgs84
> the command:
> echo 0 45 | proj +proj=lcc +lon_0=2.3372917 +lat_0=46.8 +lat_2=45.8989 
> +lat_1=47.696 +x_0=600000 +y_0=2200000 +ellps=clrk80 
> +towgs84=-168,-60,320,0,0,0,0
> gives exatly the same result
> 415663.74       2002665.67
> as if the option +towgs84 is not used.
> 
> Where could be the mistake?
> Is there an other way to specify the translation?

Herve,

Gerald's libproj4 does not do datum shifts, by design.

The "proj" command also does not do datum shifts, only reprojection
on the same datum.

You can use the PROJ.4 cs2cs command to do the transformation
(equivelent to the pj_transform() API call).

eg.

cs2cs +proj=latlong +datum=WGS84 \
   +to +proj=lcc +lon_0=2.3372917 +lat_0=46.8 +lat_2=45.8989 \
       +lat_1=47.696 +x_0=600000 +y_0=2200000 +ellps=clrk80 \
       +towgs84=-168,-60,320,0,0,0,0

I get 415723.87       2002668.31 as a result with this command.

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 Proj mailing list