[gdal-dev] Is epsg text file read at all when re-projecting with FWTools?

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Nov 18 11:02:15 EST 2009


Hi,

Thanks, that makes things more understandable. Is there some good reason to keep delivering "epsg" text file with FWTools if it is not used for anything? Is it perhaps included for Mapserver that ships with FWTools?

Both my codes, 2393 and 3067 are included in pcs.csv thus I believe I must edit pcs.override.csv.

-Jukka-


-----Alkuperäinen viesti-----
Lähettäjä: Frank Warmerdam [mailto:warmerdam at pobox.com]
Lähetetty: ke 18.11.2009 17:15
Vastaanottaja: Rahkonen Jukka
Kopio: gdal-dev at lists.osgeo.org
Aihe: Re: [gdal-dev] Is epsg text file read at all when re-projecting with FWTools?
 
Jukka Rahkonen wrote:
> Hi,
> 
> With Mapserver I am used to correct projection parameters, if needed, by editing
> directly the projection file which is in MS4W package located at
> \ms4w\proj\nad\epsg. 
> Now I tried to do the same with FWTools 2.4.2.  There is a file with promising
> name at \FWTools2.4.2\proj_lib\epsg.  However, I am pretty sure that editing
> this file does not change the behaviour of ogr2ogr in any way. Is FWTools taking
> the projection definitions from some other place or am I doing something wrong?
> 
> What I tried to do was to add +towgs84 parameters. Original line is this 
> 3067> +proj=utm +zone=35 +ellps=GRS80 +units=m +no_defs  <> 
> and I modified it to this:
> 3067> +proj=utm +zone=35 +ellps=GRS80
> +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
> 
> FWTools epsg file is having correct parameters for EPSG:2393 projection, but it
> seems to me but they are not used either in real use. Only way to get correct
> results when reprojecting from epsg:3067 to epsg:2393 is to give both
> projections as +proj strings this way
> 
> ogr2ogr -f "ESRI Shapefile" output.shp input.shp
> -t_srs "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=3500000 +y_0=0 
> +ellps=intl +towgs84=-96.0617,-82.4278,-121.743,4.80107,0.34543,
> -1.37646,1.4964 +units=m"
> -s_srs "+proj=utm +zone=35 +ellps=GRS80 
> +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
> 
> Giving -t_srs or s_srs as epsg:2393 epsg:3067, respectively, gives a faulty
> result which means that +towgs84 parameters are not used at all.

Jukka,

The primary source for EPSG lookups for GDAL utilities is the
gdal/data/pcs.csv and gdal/data/gcs.csv files.  There is logic to
look in a few other places too if a srs is not found in those locations.

In order to introduce a towgs84 parameter for a gcs the normal procedure
is to copy the definition from gcs.csv into gcs.override.csv and add
the towgs84 parameters.  There should be sufficient examples to see how
that might work.

These csv files are found in FWTools\data I believe.

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    | Geospatial Programmer for Rent




More information about the gdal-dev mailing list