Thanks for your help<br><br>1. You were write about the number of parameters, so I changed the number to 10 and also to 11 and neither one of them worked.<br> It seems that the problem is related to the scale factor, namely the parameter <i><b>"k=0.999600"</b>. </i>When I am not including the scale factor in the parameters list is working <br>
but of course the output coordinates are wrong.<i><br><br></i>2. Also the use of ESPG codes returns and error:<br><font style="font-family: times new roman,serif;" size="2"><br>if (! (pj_merc =
pj_init_plus("+init=EPSG:<b>2100</b>") ) ) return ;</font><br><br>Could that be related to a missing header or library?<br>Thanks again.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>
From: <b class="gmail_sendername">nicolas david</b> <span dir="ltr"><<a href="mailto:ericnico.david@gmail.com">ericnico.david@gmail.com</a>></span><br>Date: Tue, Jul 27, 2010 at 10:18 AM<br>Subject: Re: [Proj] transformation wrong results from ESPG:4326 to ESPG:2100<br>
To: "PROJ.4 and general Projections Discussions" <<a href="mailto:proj@lists.maptools.org">proj@lists.maptools.org</a>><br><br><br>Hello<br><br>1-) about your code :<br><pre>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"};<br>
<br>if (!(pj_merc = pj_init(3,params)))<br>        return;<br></pre>I think that "3" is a wrong argument, in your case it must be "11", the number of argument that your params variable contains.<br><br>2-) to use EPSG code you could use pj_init_plus and the "+init" parameters. <br>
<br><font style="font-family: georgia,serif;" size="2">if (! (pj_merc = pj_init_plus("+init=EPSG:2100") ) ) return ;</font><br><br><br><br>Nicolas DAVID<br><br><div class="gmail_quote">2010/7/27 Nikos Gerontidis <span dir="ltr"><<a href="mailto:geronik444@gmail.com" target="_blank">geronik444@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5"><br clear="all">Hello list<br><br>I want to transform coordinates from a projection with ESPG:4326 to <br>
a projection ESPG:2100, but some problems exist. In more details I am trying to <br>use the proj4 library so the problem is related with function : <i><b>pj_transform</b></i>(..) :<br>
<br>Here are the parameters used for ESPG:2100<br><br><i>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 "<br>
ESPG:4326------> "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs "</i><br><br>Code is included inside the attached file.<br><br>the projection parameters are a copy paste from PostGis.<br>And another thing, is it possible to use directly the ESPG codes inside <i><b>pj_transform</b></i>("Something like+ESPG:2100","ESPG:4326")<br>
<br>Any ideas? Am I doing something wrong?<br>Thanks in advance.<br><br>-- <br>Best Regards<br><font color="#888888">Nikos Gerontidis<br>
</font><br></div></div>_______________________________________________<br>
Proj mailing list<br>
<a href="mailto:Proj@lists.maptools.org" target="_blank">Proj@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/proj" target="_blank">http://lists.maptools.org/mailman/listinfo/proj</a><br></blockquote></div><br>
<br>_______________________________________________<br>
Proj mailing list<br>
<a href="mailto:Proj@lists.maptools.org">Proj@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/proj" target="_blank">http://lists.maptools.org/mailman/listinfo/proj</a><br></div><br><br clear="all"><br>-- <br>Best Regards<br>Nikos Gerontidis<br>