[Proj] transformation wrong results from ESPG:4326 to ESPG:2100

Nikos Gerontidis geronik444 at gmail.com
Mon Jul 26 23:39:33 PDT 2010


Hello list

I want to transform coordinates from a projection with ESPG:4326 to
a projection ESPG:2100, but some problems exist. In more details I am trying
to
use the proj4 library so the problem is related with function : *
pj_transform*(..) :

Here are the parameters used for ESPG:2100

*ESPG: 2100----->  "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.999600 +x_0=500000
+y_0=0 +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0 +units=m +no_defs
"
ESPG:4326------> "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs "*

Code is included inside the attached file.

the projection parameters are a copy paste from PostGis.
And another thing, is it possible to use directly the ESPG codes  inside *
pj_transform*("Something like+ESPG:2100","ESPG:4326")

Any ideas? Am I doing something wrong?
Thanks in advance.

-- 
Best Regards
Nikos Gerontidis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20100727/c410df1e/attachment.html>
-------------- next part --------------
char *params[] = { "proj=merc", "lat_0=0", "lon_0=24", "k=0.999600", "x_0=500000", "y_0=0", "ellps=GRS80", "towgs84=-199.87,74.79,246.62,0,0,0,0", "units=m", "no_defs"};

if (!(pj_merc = pj_init(3,params)))
	return;
if (!(pj_latlong = pj_init_plus("+proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs")))
	return;
double x = 0.69241249012994599;
double y = 0.39130891160970277;

qint32 code = pj_transform(pj_latlong, pj_merc, 1, 1, &x, &y, NULL );

// Output coordinates

// x equals to 1744633.9435213772
// y equals to 2545764.3957969979




More information about the Proj mailing list