[OSM-newbies] Converting lat/lon to pixel within a tile

root john at mckerrell.net
Wed Apr 30 11:42:48 BST 2008


If you convert the lat/lon to a floating point tile coordinate you can
then use the decimal part to tell you how much you need to shift the
tiles. Multiply it by 256 and that'll tell you how far. That help?

On Wed, Apr 30, 2008 at 03:55:55PM +0530, Vishwa wrote:
> i am doing this using C#.Net to create a image out of tiles, and i have to
> center the image to the given image
> 
> i know the zoom level, and the center coordianates, and the size of the 3x3
> grid. how to center align the map when the center can be anywhere within the
> 256x256 center tile?
> 
> thanks
> vishwa
> 
> 
> > On Wed, Apr 30, 2008 at 1:15 PM, Iv??n S??nchez Ortega <
> > ivan at sanchezortega.es> wrote:
> >
> > > El Mi??rcoles, 30 de Abril de 2008, Vishwa escribi??:
> > > > In other words, how to know the pixel (x,y) *within the center tile*
> > > for a
> > > > given lon,lat value.
> > >
> > > If you're using javascript, please keep in mind that there are
> > > OpenLayers
> > > functions for this.
> > >
> > > --
> > > ----------------------------------
> > > Iv??n S??nchez Ortega <ivan at sanchezortega.es>
> > >
> > > "Anything that is too stupid to be spoken is sung."
> > >  - Voltaire (1694-1778) [poor guy, never knew about rap]
> > >
> >
> >

> _______________________________________________
> newbies mailing list
> newbies at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/newbies





More information about the newbies mailing list