Marco Krage | 13 Jun 2012 07:17
Picon
Favicon
Gravatar

Koordinaten Format LonLat vs. LatLon

Hallo,
ich beginne gerade mit Openlayers und möchte gerne meine GPX Tracks  
darstellen.
Was ich nun nicht ganz verstehe ist, wieso Openlayers die Koordinaten  
nur im LonLat Format annimmt und ausgibt.

Alle Quellen, sei es Google Maps oder GPX Tracks liefern die  
Koordinaten im LatLon Format.

Google Maps (Dortmund City): 51.512161,7.465782
GPS Tracker (Dortmund City): 51.512161,7.465782
Openlayers (Dortmund City): 7.465782,51.512161

Wie soll ich damit umgehen, dass Openlayers die Koordinaten umgekehrt annimmt?

Gruß Marco

--

-- 
www.my-azur.de - einfach wunderbar

_______________________________________________
Users mailing list
Users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Javier Mr | 13 Jun 2012 08:04
Favicon

Re: Koordinaten Format LonLat vs. LatLon


Hi marco,

I have never used it but it looks like the GPX parser is what you are looking for (http://dev.openlayers.org/releases/OpenLayers-2.11/doc/apidocs/files/OpenLayers/Format/GPX-js.html), but can't tell how to use it, here is an example of how to use another formater in this case for JSON (http://www.openlayers.org/dev/examples/geojson.html).

About the order of the coordinates, i really dont see the problem, and object containing the coordinates should have a getLat and getLon methods, just like OpenLayers, how to show then to the user depends of the user/developer preference.

But maybe i haven't understand your question deeply enough.

Gruß
Javi

De: Marco Krage <marco-bV7dvVS3QSCELgA04lAiVw@public.gmane.org>
Para: openlayers-users <at> lists.osgeo.org
Enviado: Miércoles 13 de junio de 2012 7:17
Asunto: [OpenLayers-Users] Koordinaten Format LonLat vs. LatLon

Hallo,
ich beginne gerade mit Openlayers und möchte gerne meine GPX Tracks darstellen.
Was ich nun nicht ganz verstehe ist, wieso Openlayers die Koordinaten nur im LonLat Format annimmt und ausgibt.

Alle Quellen, sei es Google Maps oder GPX Tracks liefern die Koordinaten im LatLon Format.

Google Maps (Dortmund City): 51.512161,7.465782
GPS Tracker (Dortmund City): 51.512161,7.465782
Openlayers (Dortmund City): 7.465782,51.512161

Wie soll ich damit umgehen, dass Openlayers die Koordinaten umgekehrt annimmt?

Gruß Marco

--www.my-azur.de - einfach wunderbar

_______________________________________________
Users mailing list
Users-qjLDD68F18NyQMAyxoHuMA@public.gmane.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users


_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Marco Krage | 13 Jun 2012 08:21
Picon
Favicon
Gravatar

Re: Koordinaten Format LonLat vs. LatLon

Hi,
of course i can use the following to display the coords in LatLon order in UI.
console.log(OpenLayers.LonLat.lat+","+OpenLayers.LonLat.lon);

But for example
map.addControl(new OpenLayers.Control.MousePosition());

Prints the coords in LonLat order. Not very usable for the User (me).  
Because it's the wrong order. if you use this coords in google maps,  
it will point you to a different position.
I know there are custom methods to print the MousePosition. But i  
don't know any system that is using this order Openlayer uses.

If you get the coords, 23.545,24.787 you dont know which is the lat wn  
what the lon.

excuse me for that bad english ;-)

Zitat von Javier Mr <javiersdevmail <at> ymail.com>:

>
>
> Hi marco,
>
> I have never used it but it looks like the GPX parser is what you  
> are looking for  
>
(http://dev.openlayers.org/releases/OpenLayers-2.11/doc/apidocs/files/OpenLayers/Format/GPX-js.html),
but can't tell how to use it, here is an example of how to use another formater in this case for JSON  
> (http://www.openlayers.org/dev/examples/geojson.html).
>
> About the order of the coordinates, i really dont see the problem,  
> and object containing the coordinates should have a getLat and  
> getLon methods, just like OpenLayers, how to show then to the user  
> depends of the user/developer preference.
>
> But maybe i haven't understand your question deeply enough.
>
> Gruß
> Javi
>
>
>
>
>> ________________________________
>> De: Marco Krage <marco <at> my-azur.de>
>> Para: openlayers-users <at> lists.osgeo.org
>> Enviado: Miércoles 13 de junio de 2012 7:17
>> Asunto: [OpenLayers-Users] Koordinaten Format LonLat vs. LatLon
>>
>> Hallo,
>> ich beginne gerade mit Openlayers und möchte gerne meine GPX Tracks  
>> darstellen.
>> Was ich nun nicht ganz verstehe ist, wieso Openlayers die  
>> Koordinaten nur im LonLat Format annimmt und ausgibt.
>>
>> Alle Quellen, sei es Google Maps oder GPX Tracks liefern die  
>> Koordinaten im LatLon Format.
>>
>> Google Maps (Dortmund City): 51.512161,7.465782
>> GPS Tracker (Dortmund City): 51.512161,7.465782
>> Openlayers (Dortmund City): 7.465782,51.512161
>>
>> Wie soll ich damit umgehen, dass Openlayers die Koordinaten  
>> umgekehrt annimmt?
>>
>> Gruß Marco
>>
>> --www.my-azur.de - einfach wunderbar
>>
>> _______________________________________________
>> Users mailing list
>> Users <at> lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>>

--

-- 
www.my-azur.de - einfach wunderbar

_______________________________________________
Users mailing list
Users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Andreas Hocevar | 13 Jun 2012 09:31
Favicon
Gravatar

Re: Koordinaten Format LonLat vs. LatLon

Your GPX tracks should work fine. The only thing is that OpenLayers has an unusual LonLat class, whereas other frameworks have LatLng or something similar. The tracks should get drawn correctly, and if you look at the properties of the LonLat object, you will see that latitude and longitude are assigned correctly.

What exactly were you looking at when you saw the reversed coordinates?

Andreas.

On Wednesday, June 13, 2012, Marco Krage <marco-bV7dvVS3QSCELgA04lAiVw@public.gmane.org> wrote:
> Hallo,
> ich beginne gerade mit Openlayers und möchte gerne meine GPX Tracks darstellen.
> Was ich nun nicht ganz verstehe ist, wieso Openlayers die Koordinaten nur im LonLat Format annimmt und ausgibt.
>
> Alle Quellen, sei es Google Maps oder GPX Tracks liefern die Koordinaten im LatLon Format.
>
> Google Maps (Dortmund City): 51.512161,7.465782
> GPS Tracker (Dortmund City): 51.512161,7.465782
> Openlayers (Dortmund City): 7.465782,51.512161
>
> Wie soll ich damit umgehen, dass Openlayers die Koordinaten umgekehrt annimmt?
>
> Gruß Marco
>
> --
> www.my-azur.de - einfach wunderbar
>
> _______________________________________________
> Users mailing list
> Users-qjLDD68F18NyQMAyxoHuMA@public.gmane.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>

--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Gmane