<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello Paul,<br>
<br>
thanks very much, you are perfectly right. I wasn't paying enough
attention to the order of parameters of the procedure Calc in one of
the demos of the PROJ API. The Google API always wants the latitude
fiorst, and that's what I was focussing on. But the procedure Calc (and
the DLLs CalcForward as well) need the parameters vice versa.<br>
<br>
Thanks for that help.<br>
<br>
<div class="moz-signature">Best regards,<br>
<br>
Christian<br>
<small><b>Directmedia Publishing GmbH</b> · Möckernstraße 68 · 10965
Berlin<br>
<a class="moz-txt-link-abbreviated" href="http://www.digitale-bibliothek.de">www.digitale-bibliothek.de</a><br>
AG Berlin-Charlottenburg · HR B 58002 · USt.Id. DE173211737<br>
Geschäftsführer: Ralf Szymanski · Erwin Jurschitza</small></div>
<br>
<br>
Paul Kelly schrieb:
<blockquote
cite="mid:Pine.LNX.4.62.0803071827530.24814@vortex.ukshells.co.uk"
type="cite">On Fri, 7 Mar 2008, Christian Kirchhoff wrote:
<br>
<br>
<blockquote type="cite">Hello,
<br>
<br>
I'd like to use the Delphi PROJ API to translate coordinates. The
coordinates come from GoogleMaps, thus are lat/lng values.
<br>
<br>
I want to match them to shapes from a shape file which I can read with
the ShapeAPI. I have got the following information the the prj file of
the shape:
<br>
PROJCS["Germany_Zone_3",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",3500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",9.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
<br>
<br>
Therefore I thought that the TCoordinateTranslator I named "Proj"
should be opened with:
<br>
Proj.Open('+proj=tmerc +ellps=bessel +lon_0=9 +x_0=3500000');
<br>
<br>
...but I am not very familiar/experienced yet.
<br>
<br>
Anyway I have test coordinates from GoogleMaps, e.g. (50.1056069418592,
8.404541015625). The region this coodinates lay in as exactly the
region that is covered by shapes in the shape file. The bounds of the
shape file are, according to what the ShapeAPI returned:
<br>
( 3394468.028, 5504381.719,0.00,0.00) to ( 3424916.697,
5537463.422,0.00,0.00)
<br>
<br>
But the translated Google coordinates are:
<br>
8451430,97 m, 1229074.77 m
<br>
<br>
Which is totally elsewhere.
<br>
<br>
My question is: Did I read the values from the shape's prj file wrong?
Or did I use the wrong parameters when setting up the
TCoordinateTranslator?
<br>
</blockquote>
<br>
I think you have passed the latitude and longitude values in the wrong
order. It should be longitude first, followed by latitude. Here is
quick test I did using your values and the cs2cs program that comes
with PROJ.4:
<br>
<br>
cs2cs +proj=longlat +a=6377397.155 +rf=299.1528128 \
<br>
+towgs84=606.000,23.000,413.000 +to +proj=tmerc +lat_0=0 +lon_0=9 \
<br>
+k=1 +x_0=3500000 +y_0=0 +no_defs +a=6377397.155 +rf=299.1528128 \
<br>
+towgs84=606.000,23.000,413.000 +to_meter=1
<br>
8.404541015625 50.1056069418592
<br>
3457407.04 5552194.69 0.00
<br>
50.1056069418592 8.404541015625
<br>
8451430.97 1229074.77 0.00
<br>
<br>
Best regards,
<br>
<br>
Paul
<br>
_______________________________________________
<br>
Proj mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Proj@lists.maptools.org">Proj@lists.maptools.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.maptools.org/mailman/listinfo/proj">http://lists.maptools.org/mailman/listinfo/proj</a>
<br>
</blockquote>
</body>
</html>