[Proj] dmstor return negative value

Lars Geldner geldner.list.reg at gmx.net
Fri Jan 19 00:10:45 PST 2007


Dear Jose,

you're right, the longitude is in zone 32. Thus, I changed my program to the
following:

static char *parms[] = 
{
	"proj=utm",
	"zone=32u",
	"datum=WGS84"
};

My DMS longitude is 8d29'30.74. Starting from this longitude my task is to
add an x distance in UTM projection. After that, the task is to re-transform
the x value of UTM projection back to DMS (WGS84).

At first, I used dmstor function:
data.u = dmstor(lPos, 0); // lpos is 8d29'30.74

Then I used the proj forward transform function:
data = pj_fwd(data, ref);

Now, data.u is negative: data.u is -90178.546738 (Zone 32 used!)

For testing issues, I did not add an x distance in UTM projection but
re-transformed data.u (x) back to DMS (WGS84). The result has to be
8d29'30.74:

in.u = data.u;
in = pj_inv(in, ref); // re-transform
char dms_x[20];
rtodms(dms_x, in.u, 'E', 'W');
printf("dms_x is: %s\n", dms_x);

OUTPUT: dms_x is: 0d0'0.001"

My question is: Why I'm getting 0d0'0.001" instead of 8d29'30.74? I can't
face it!
The same proceeding works fine with the latitude of 53d55'49.03! My problem
is the longitude.

What is the correct proceeding to get the longitude 8d29'30.74?

Thanks,

Lars


José Alberto Gonçalves wrote:
> 
> Your longitude (8d... East) is in Zone 32. Zone 33 goes from 12  to 18 
> degrees East longitude, so it is likely that you get a negative X when 
> you project your point in zone 33.
> 
> Regards
> 
> 
> Jose Gonçalves
> 
> 
> 
> 
> 
> 
> Lars Geldner wrote:
> 
>>Dear all,
>>
>>I'm transforming WGS84 coordinates into x/y coordinates of the UTM
>>projection.
>>
>>The input WGS84 values have the following format, e.g. 8d29'30.74 as
>>longitude.
>>
>>UTM Zone is 33.
>>
>>The first step is to transform the DMS data (8d29'30.74 as longitude) to
>>radian data using dmstor function.
>>The second step is to transform the radian data (returned by dmstor) to
UTM
>>using pj_fwd function.
>>
>>The result of the steps mentioned above is a negative value
(-481324.644767)
>>returned by pj_fwd.
>>
>>What indicates the UTM x-value -481324.644767 of the WGS84 longitude
>>8d29'30.74?
>>
>>The inverse transformation of -481324.644767 returns a longitude of
>>0d0'0.085"E but not 8d29'30.74.
>>
>>Any help is appreciated!
>>
>>TIA,
>>
>>Lars Geldner
>>
> 
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
> 
> 

-- 
View this message in context: http://www.nabble.com/dmstor-return-negative-value-tf3034418.html#a8445519
Sent from the PROJ.4 mailing list archive at Nabble.com.





More information about the Proj mailing list