Thanks Even,<br><br>The method importFromEPSG() and the EPSG file look like what I'm looking for.<br>I'll investigate it further.<br><br>Thanks,<br><br>Paul<br><br><br><div id="WISESTAMP_SIG_9609"><span style="font-size: 13.3px; font-family: Verdana, Arial, Helvetica, sans-serif;"><div style="border: 1px solid #e5e5e5;background-color: #f8f8f8;padding: 0.8em 0.8em 0.3em 0.8em;">
<div style="margin: 0 0 8px 0"><p style="margin:0; "><span><strong><img style="float: left; margin-left: 5px; margin-right: 5px;" src="http://www.bontepaarden.nl/bontepaarden/images/newButton.png" alt="" height="120" width="160">Paul Meems </strong><br>
<span>Release manager, configuration manager</span><br><span>and forum moderator of MapWindow GIS.</span><br><a href="http://www.mapwindow.org/" target="_blank"><span>www.mapwindow.org</span></a><br><br><span>Owner of MapWindow.nl - Support for</span><br>
<span>Dutch speaking users.</span><br><a href="http://www.mapwindow.nl/" target="_blank"><span>www.mapwindow.nl</span></a><br></span></p>
<p style="margin:0; "><strong><br></strong></p></div></div><img src="http://p1.wisestamp.com/pixel.png?p=mozilla&v=2.2.1&t=1305148262480&u=8899286&e=8883" height="1" width="1"></span></div><br><br><div class="gmail_quote">
2011/5/11 Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Le mercredi 11 mai 2011 20:20:51, Paul Meems a écrit :<br>
<div class="im">> Hi List,<br>
><br>
> We use GDAL with Proj.4 in MapWindow GIS.<br>
> We're currently in the process of upgrading to GDAL v1.8<br>
><br>
> We have some issues with projections in MapWindow.<br>
> We partially us GDAL methods and partially our custom ones.<br>
> We also are more and more working with EPSG codes with WMS and WFS. So we<br>
> need to handle them as well.<br>
><br>
> I've seen a discussion about this 2 or 3 weeks ago and my question<br>
> partially overlaps.<br>
> As I understand it, it is not possible do use GDAL/Proj.4 to input a EPSG<br>
> code and get the prj-file or projection string back, right?<br>
<br>
</div>If I were you, I would look at the importFromEPSG() and exportToProj4() /<br>
exportToWkt() methods of OGRSpatialReference ....<br>
<div class="im"><br>
> And the same is for the other way round: get the EPSG code when the input<br>
> is a projection string.<br>
<br>
</div>Generally not, unless there's a AUTHORITY node in the WKT. There's also a<br>
OGRSpatialReference::AutoIdentifyEPSG() method, but it will work only in a few<br>
cases. Have a look at its implementation to know which ones.<br>
<br>
One possibility to identify the EPSG code is to iterate over all the EPSG code<br>
and get their proj4 representation, and compare that to the proj4<br>
representation of your projection string. But that's not a perfect solution<br>
and I'm not sure there's a perfect solution. The proj4 representation isn't a<br>
bijection of the WKT representation.<br>
<div class="im"><br>
><br>
> But we do want this. Is some sort of offline database or XML file available<br>
> that will show the EPSG codes with the accompanying prj-file text and<br>
> projection string?<br>
<br>
</div>Are you looking for the "epsg" file from the proj.4 distribution... ?<br>
<a href="http://trac.osgeo.org/proj/browser/trunk/proj/nad/epsg" target="_blank">http://trac.osgeo.org/proj/browser/trunk/proj/nad/epsg</a><br>
<br>
Illustrating my point in previous paragraph :<br>
<br>
# CHTRF95<br>
<4151> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <><br>
# NAD83(HARN)<br>
<4152> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <><br>
<br>
2 EPSG codes, same PROJ.4 representation<br>
<div class="im"><br>
><br>
> Or am I thinking in the wrong direction?<br>
><br>
> Thanks,<br>
><br>
> Paul<br>
><br>
><br>
> *Paul Meems *<br>
> Release manager, configuration manager<br>
> and forum moderator of MapWindow GIS.<br>
> <a href="http://www.mapwindow.org" target="_blank">www.mapwindow.org</a><br>
><br>
> Owner of MapWindow.nl - Support for<br>
> Dutch speaking users.<br>
> <a href="http://www.mapwindow.nl" target="_blank">www.mapwindow.nl</a><br>
><br>
</div>> *<br>
> *<br>
</blockquote></div><br>