Geoscience Reference
In-Depth Information
gdaltransform -s_srs EPSG:28992 -t_srs EPSG:31370
177502 311865 #this is your input
244296.723070577 165937.350438393 1.60975147597492 #output
You can reverse the operation by either exchanging -s_srs and -t_srs ,orby
invoking the inverse operation mode:
gdaltransform -s_srs EPSG:28992 -t_srs EPSG:31370 -i
244296.723070577 165937.350438393 1.60975147597492 #input
177502.000215473 311864.999542271 0.00031387060880661 #output
Geographical coordinates in longitude latitude are in decimal format. However,
PROJ.4 is distributed with a command line tool cs2cs to transform coordinate
systems that accepts more formats. This tool uses a different catalog of EPSG codes
than that is used for GDAL. Setting the debug level ( export PROJ_DEBUG=4 )
prior to calling cs2cs provides some extra information, including the location of
the catalog of EPSG codes that is used (e.g., /usr/share/proj/epsg ).
Suppose we want to know the longitude and latitude of some coordinates in the
European coordinate system LAEA/ETRS89 (EPSG:3035).
gdaltransform -s_srs EPSG:3035 -t_srs EPSG:4326
3975287.80 3136037.44 #input
5.04632916251796 51.2298627892927 0 #output
The equivalent command using cs2cs 2 is as follows and outputs the coordinates
in degrees, minutes and second:
cs2cs +init=epsg:3035 +to +init=epsg:4326
3975287.80 3136037.44 #input
5d2'46.785"E
51d13'47.506"N 0.000 #output
The above command can be adapted to force a decimal output format as follows:
cs2cs -f" %.6f" +init=epsg:3035 +to +init=epsg:4326
3975287.80 3136037.44 #input
5.046329
51.229863
0.000000 #output
Two other utilities that are distributed with PROJ.4 are proj and invproj .
They convert between geographic and projection coordinates (and vice versa). How-
ever, they are limited to convert within one datum only, whereas cs2cs supports a
translation of the datum.
2 Notice that, unlike GDAL and OGR tools, cs2cs only supports the keyword epsg in small case.
 
 
Search WWH ::




Custom Search