<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=SV link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello Brent,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>I don’t know why gdalinfo misinterprets the ESRI
binary grid, or why spatialreference.org doesn’t help.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>But EPSG:3994 uses Mercator variant B (see <a
href="http://www.epsg.org/guides/docs/G7-2.pdf">http://www.epsg.org/guides/docs/G7-2.pdf</a>),
which is a<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>somewhat unusual variant. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>On the other hand, the epsg file of Proj version 4.8.0
has the same definition that you tried:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'># WGS 84 / Mercator 41<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><3994> +proj=merc +lon_0=100 +lat_ts=-41 +x_0=0
+y_0=0 +datum=WGS84 +units=m +no_defs <><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>which I believe is correct (lat_ts means latitude of
true scale). Based on that, I can compute:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>>proj +init=epsg:3994<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>100 0<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>0.00 0.00<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>101 41<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>84135.19
3767131.99<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>101 41.000009<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>84135.19
3767132.99<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>The first test point shows that the grid origin (zero
easting, zero northing) is at<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>the equator at longitude 100 d E, which is what I would
expect. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>The other two test points shows that a difference of
0.000009 degrees in latitude,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>near the latitude 41 N, gives a difference of about 1
meter in northing. This is also<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>what I would expect, since 41 N (and 41 S) are
standard parallels, where the scale<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>should be true. (Because 0.000009 degrees of latitude
is about 1 meter.)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>For your test point, I reproduce your results:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>>proj -I +init=epsg:3994 -f "%.5f"<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>6200000.000 -3710000.000<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>173.69093 -40.48353<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>You say you didn’t expect these results: <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>> </span></font><span lang=EN-GB>I expected values
around 174.66 -41.41<o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>but I don’t know if what you expected is
correct or not. I have used Proj 4.8.0 that came with OSGeo4W.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>On the other hand, in Proj 4.7.0 the epsg file had
the entry <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'># WGS 84 / Mercator 41<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><3994> +proj=merc +lon_0=100 +k=1 +x_0=0 +y_0=0
+ellps=WGS84 +datum=WGS84 +units=m +no_defs <><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>which I think is very wrong. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> The EPSG definition of WGS 84 /
Mercator 41 used to have the code 3752, but</span></font><font size=1
face=Arial><span lang=EN-GB style='font-size:9.0pt;font-family:Arial'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>this was deprecated in 2008 and replaced with 3994 (EPSG
change request 2008.088).<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>I am not sure if the bad definition in Proj 4.7.0 had
anything to do with that, though.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Best regards,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Mikael Rittri<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Carmenta<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Sweden<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>http://www.carmenta.com<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
proj-bounces@lists.maptools.org [mailto:proj-bounces@lists.maptools.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>pcreso@pcreso.com<br>
<b><span style='font-weight:bold'>Sent:</span></b> den 15 april 2012 22:19<br>
<b><span style='font-weight:bold'>To:</span></b> proj@lists.maptools.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [Proj] EPSG:3994 problem</span></font><span
lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0>
<tr>
<td valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>Hi,<br>
<br>
I'm unable to get Proj to correctly return lat/long coordinates from
Mercator41 data.<br>
http://www.spatialreference.org/ref/epsg/3994/ does not list any proj4
string, Postgis proj4text or Mapserver values for this projection.<br>
<br>
I have an ESRI binary grid with a projection definition (prj.adf) of:<br>
<br>
Projection MERCATOR<br>
Datum WGS84<br>
Spheroid WGS84<br>
Units METERS<br>
Zunits NO<br>
Xshift 0.0<br>
Yshift 0.0<br>
Parameters <br>
100 0 0.0 /* longitude of central meridian<br>
-41 0 0.0 /* latitude of true scale<br>
0.0 /* false easting (meters)<br>
0.0 /* false northing (meters)<br>
<br>
gdalinfo fails to interpret this correctly, giving:<br>
<br>
gdalinfo w001001.adf <br>
Driver: AIG/Arc/Info Binary Grid<br>
Files: .<br>
./#m41_to_ll#<br>
./sta.adf<br>
./w001001x.adf<br>
./hdr.adf<br>
./w001001.adf<br>
./m41_to_ll<br>
./whbr<br>
./prj.adf<br>
./dblbnd.adf<br>
Size is 8817, 7901<br>
Coordinate System is:<br>
PROJCS["unnamed",<br>
GEOGCS["WGS 84",<br>
DATUM["WGS_1984",<br>
SPHEROID["WGS
84",6378137,298.257223563,<br>
AUTHORITY["EPSG","7030"]],<br>
TOWGS84[0,0,0,0,0,0,0],<br>
AUTHORITY["EPSG","6326"]],<br>
PRIMEM["Greenwich",0,<br>
AUTHORITY["EPSG","8901"]],<br>
UNIT["degree",0.0174532925199433,<br>
AUTHORITY["EPSG","9108"]],<br>
AUTHORITY["EPSG","4326"]],<br>
PROJECTION["Mercator_1SP"],<br>
PARAMETER["latitude_of_origin",100],<br>
PARAMETER["central_meridian",0],<br>
PARAMETER["scale_factor",1],<br>
PARAMETER["false_easting",-41],<br>
PARAMETER["false_northing",0],<br>
UNIT["METERS",1]]<br>
Origin = (6199987.499999998137355,-3709987.500002769753337)<br>
Pixel Size = (25.000000000000000,-25.000000000000000)<br>
Corner Coordinates:<br>
Upper Left ( 6199987.500,-3709987.500) <br>
Lower Left ( 6199987.500,-3907512.500) <br>
Upper Right ( 6420412.500,-3709987.500) <br>
Lower Right ( 6420412.500,-3907512.500) <br>
Center ( 6310200.000,-3808750.000) <br>
Band 1 Block=256x4 Type=Float32, ColorInterp=Undefined<br>
Min=-2570.453 Max=2917.197 <br>
NoData Value=-3.4028234663852886e+38<br>
<br>
With some obvious errors, like latitude of origin = 100... so just extracting
the xyz values & trying to reproject with proj, I'm having problems.<br>
<br>
I tried: g dal2xyz.py w001001.adf | head <br>
which returns:<br>
6200000.000 -3710000.000 76.1574<br>
6200025.000 -3710000.000 76.1842<br>
...<br>
<br>
which seems to work fine, but when I pass these Mercator41 coordinates into
proj I'm unable to get a parameter list which gives the lat/long values for
where I know these data sit. There is an offset of many miles. This suggests
either my source data has an error in the coordinates (unlikely) or I don't
understand enough about proj parameters (more likely)<br>
<br>
Based on the contents of the above prj.adf file I have tried the following
command:<br>
<br>
echo "6200000.000 -3710000.000" | proj -If "%.5f"
+proj=merc +lon_0=100 +lat_ts=-41 +k=1 +x_0=0 +y_0=0 +ellps=WGS84
+datum=WGS84 +units=m +no_defs +to +proj=longlat +ellps=WGS84 +datum=WGS84
+no_defs<br>
173.69093 -40.48353<br>
<br>
I expected values around 174.66 -41.41 (the data is a 25m multibeam
bathymetry grid around Cook Strait, between the North & South Islands of
New Zealand) <br>
<br>
<br>
Any advice appreciated.<br>
<br>
Brent Wood<br>
<br>
<br>
<br>
<o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>