[Mapnik-users] Getting UTM coordinates from Mapnik Viewer
Artem Pavlenko
artem at mapnik-consulting.com
Tue Jan 13 15:28:48 CET 2009
Hi Carl,
2009/1/11 Carl Johansson <mail at carl-johansson.com>:
>
> Hi Artem
>
> You're right, just subscribed.
>
> Again you are right, I want to turn screen coordinates into real world ones
> and from there on I will be able to turn them into MGRS rather than just
> UTM.
>
> I've been trying this with the simple viewer:
>
> CoordTransform
> t(map_->getWidth(),map_->getHeight(),map_->getCurrentExtent());
> double x = (double) e->x();
> double y = (double) e->y();
> coord2d coord;
> coord = coord2d(x, y);
> t.backward(coord);
> std::cout << coord << std::endl;
>
> Stockholm, Sweden is here coord2(1614085.074371404,6574896.886350079).
>
> Now I've really been trying to figure out what this represents but I
> couldn't find it anywhere.
OK, you get world coordinates in your Map (master) projection. Looks
like Mercator to me, but better check your *.xml file.
HTH
Artem
>
> Best regards,
> Carl
>
>
> Artem Pavlenko-5 wrote:
>>
>> Hi Carl,
>>
>> Could you provide more details. Are you not sure how to translate 'screen'
>> coordinates into 'world' ? Or do you want to re-project them into UTM also
>> ?
>>
>> Please, consider subscribing to mapnik-users as anonymous postings are not
>> allowed.
>>
>> Regards
>> Artem
>>
>> 2009/1/2 Carl Johansson <mail at carl-johansson.com>
>>
>>>
>>> Hi,
>>>
>>> I've been trying to get a QString representation of the UTM coordinate
>>> pressed at in the Mapnik Viewer. Now I think that I should use some
>>> member
>>> of CoordTransform passing it the coordinates from the widget. However
>>> that's
>>> where I get rather lost. Could anyone point me in the right direction?
>>> Already tried looking at posts like
>>>
>>> http://www.nabble.com/how-to-put-a-symbol-in-a-given-coord--tp19164492p19164492.html
>>> .
>>>
>>> Carl
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Getting-UTM-coordinates-from-Mapnik-Viewer-tp21250174p21250174.html
>>> Sent from the Mapnik - Users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Mapnik-users mailing list
>>> Mapnik-users at lists.berlios.de
>>> https://lists.berlios.de/mailman/listinfo/mapnik-users
>>>
>>
>> _______________________________________________
>> Mapnik-users mailing list
>> Mapnik-users at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/mapnik-users
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Re%3A-Getting-UTM-coordinates-from-Mapnik-Viewer-tp21370149p21405648.html
> Sent from the Mapnik - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Mapnik-users mailing list
> Mapnik-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/mapnik-users
>
More information about the Mapnik-users
mailing list