[OpenLayers-Users] Function to convert coordinates from one format to another

Christopher Schmidt crschmidt at metacarta.com
Mon Jan 21 16:42:08 EST 2008


On Mon, Jan 21, 2008 at 09:38:29PM +0000, Thomas Wood wrote:
> On Jan 21, 2008 9:28 PM, SenTnel <elvin.pimentel at gmail.com> wrote:
> >
> > Hi !
> >
> > Im having problems setting some functionality to my openlayers app, and has
> > to do with coordinates format:
> > Openlayers gives me coords in this format:
> >
> > -69.96276793770809,18.44972224450691
> >
> > I need to convert it to a format like this:
> >
> > N1826.9892W06957.7562
> >
> > to send it to my gps to setup a geofence and this is the format the gps
> > recognizes.
> >
> > Thanks ! :-D
> >
> 
> This is possible in the current development trunk, and in the upcoming
> 2.6 release.

Well, not really. Transforming the projection is supported, but this
isn't related to the projection: it's just simple string manipulation.
You'll note that '1826.989' is actually the degrees, minutes, and
decimal minutes of the 18.44, and the same is true of -69.962 ->
69d 57.7562'.

This is perfectly reasonablye to transform in your application, but it's
unlikely that OpenLayers will ever make this transformation for you.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list