[gdal-dev] [Projections] EPSG, proj.4, .prj files

Paul Meems bontepaarden at gmail.com
Wed May 11 17:11:08 EDT 2011


Thanks Even,

The method importFromEPSG() and the EPSG file look like what I'm looking
for.
I'll investigate it further.

Thanks,

Paul


*Paul Meems *
Release manager, configuration manager
and forum moderator of MapWindow GIS.
www.mapwindow.org

Owner of MapWindow.nl - Support for
Dutch speaking users.
www.mapwindow.nl

*
*


2011/5/11 Even Rouault <even.rouault at mines-paris.org>

> Le mercredi 11 mai 2011 20:20:51, Paul Meems a écrit :
> > Hi List,
> >
> > We use GDAL with Proj.4 in MapWindow GIS.
> > We're currently in the process of upgrading to GDAL v1.8
> >
> > We have some issues with projections in MapWindow.
> > We partially us GDAL methods and partially our custom ones.
> > We also are more and more working with EPSG codes with WMS and WFS. So we
> > need to handle them as well.
> >
> > I've seen a discussion about this 2 or 3 weeks ago and my question
> > partially overlaps.
> > As I understand it, it is not possible do use GDAL/Proj.4 to input a EPSG
> > code and get the prj-file or projection string back, right?
>
> If I were you, I would look at the importFromEPSG() and exportToProj4() /
> exportToWkt() methods of OGRSpatialReference ....
>
> > And the same is for the other way round: get the EPSG code when the input
> > is a projection string.
>
> Generally not, unless there's a AUTHORITY node in the WKT. There's also a
> OGRSpatialReference::AutoIdentifyEPSG() method, but it will work only in a
> few
> cases. Have a look at its implementation to know which ones.
>
> One possibility to identify the EPSG code is to iterate over all the EPSG
> code
> and get their proj4 representation, and compare that to the proj4
> representation of your projection string. But that's not a perfect solution
> and I'm not sure there's a perfect solution. The proj4 representation isn't
> a
> bijection of the WKT representation.
>
> >
> > But we do want this. Is some sort of offline database or XML file
> available
> > that will show the EPSG codes with the accompanying prj-file text and
> > projection string?
>
> Are you looking for the "epsg" file from the proj.4 distribution... ?
> http://trac.osgeo.org/proj/browser/trunk/proj/nad/epsg
>
> Illustrating my point in previous paragraph :
>
> # CHTRF95
> <4151> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
> # NAD83(HARN)
> <4152> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
>
> 2 EPSG codes, same PROJ.4 representation
>
> >
> > Or am I thinking in the wrong direction?
> >
> > Thanks,
> >
> > Paul
> >
> >
> > *Paul Meems *
> > Release manager, configuration manager
> > and forum moderator of MapWindow GIS.
> > www.mapwindow.org
> >
> > Owner of MapWindow.nl - Support for
> > Dutch speaking users.
> > www.mapwindow.nl
> >
> > *
> > *
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110511/3d63d2c0/attachment.html


More information about the gdal-dev mailing list