[mapserver-users] Coverting lat/long to pixel

Sucharita Samuel iworktech.sucharita at gmail.com
Wed May 7 07:41:54 EDT 2008


  Thanks a lot Sandeep. I think the code works.

Regards,
Sucharita

On Wed, May 7, 2008 at 3:40 PM, Sandeep Kumar Jakkaraju <
sandeepkumar.jakkaraju at gmail.com> wrote:

>
> Hi Sucharita
>
>
> these are example values........
>
>  private double minlat=28.6023 ;
>     private double minlon=77.2018 ;
>     private double maxlat=28.6382 ;
>     private double maxlon=77.2493 ;
>
>     private int screenwidth=2156;
>     private int screenheight=1674;
>     private Point p;
>
>
>     public Point convertLatLonToPixel(double lat,double lon)
>     {
>         double cellsizex = (maxlon-minlon)/screenwidth;
>         double cellsizey = (maxlat-minlat)/screenheight;
>
>         int ix = (int) ((lon-minlon)/cellsizex);
>         int iy1 = (int) ((maxlat-lat)/cellsizex);
>         int iy2 = (int) ((maxlat-lat)/cellsizey);
>         int iy = (int) (iy1+iy2)/2;
>
>         p = new Point(ix,iy);
> return p;
> }
>
>
>
>
> On 5/7/08, Sucharita Samuel <iworktech.sucharita at gmail.com> wrote:
> >
> >  Hi Sandeep,
> >                    A code fragment will be really helpful.
> >
> > Thanks,
> > Sucharita
> >
> >
> > On Wed, May 7, 2008 at 3:20 PM, Sandeep Kumar Jakkaraju <
> > sandeepkumar.jakkaraju at gmail.com> wrote:
> >
> > >
> > > This can be done using simple interpolation also
> > > ....................................
> > >
> > >
> > >   On 5/7/08, Sucharita Samuel <iworktech.sucharita at gmail.com> wrote:
> > >
> > > >  Hi friends,
> > > >               Can somebody please help me with a code to convert the
> > > > latitude and longitude of a point to pixel co-ordinates? I am using
> > > > ASP.NET <http://asp.net/>. I have heard that GDAL has a method for
> > > > this conversion. MS4W comes with GDAL as its tools, but I don't know how to
> > > > implement it in C#.NET.
> > > >
> > > >
> > > > Thanks in advance,
> > > >
> > > > Regards,
> > > > Sucharita
> > > >
> > > >
> > > > _______________________________________________
> > > > mapserver-users mailing list
> > > > mapserver-users at lists.osgeo.org
> > > > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > > >
> > > >
> > >
> > >
> > > --
> > > Thanks
> > > Regards
> > >
> > > Sandeep Kumar Jakkaraju
> > > _______________________________________________
> > > mapserver-users mailing list
> > > mapserver-users at lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > >
> > >
> >
>
>
> --
> Thanks
> Regards
>
> Sandeep Kumar Jakkaraju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080507/6a3cfce3/attachment.html


More information about the mapserver-users mailing list