[mapserver-users] confused on working PointObj

Steve Lime Steve.Lime at dnr.state.mn.us
Thu Jul 3 09:21:30 EDT 2008


Hi: A pointObj is just a container for an x, y. It doesn't know or care
about the
coordinate system those values represent. By itself it doesn't hold
enough information
to do the computation anyway. In the Swig-based languages I believe a
few macros 
are available to ease that computation:

So, if you wanted to fill pt1 with map coordinates, in Perl it would
look like:

  $pt1->setXY(mapscript::MS_IMAGE2MAP_X($dximg, $map->{extent}->{minx}),
$map->{cellsize},
                     mapscript::MS_IMAGE2MAP_X($dyimg,
$map->{extent}->{maxy}), $map->{cellsize});

It is verbose and we could do better, probably by attaching a few new
methods to a mapObj:

  $pt1.setXY($dximg,$dyimg);
  $pt2 = $map->pixToGeo($pt1);

or something like that. I'll file a bug... 

Steve

>>> orkun <temiz at deprem.gov.tr> 07/03/08 2:26 AM >>>
hello

I am confused on working PointObj;

Does pt1.setXY(dximg,dyimg,0) convert image coordinates to
geocoordinates ?

if not, what is the way ?

regards 
-- 
Ahmet Temiz
Jeo. Müh.
Afet İşleri Gen. Md.lüğü
Deprem Ar. D.

Ahmet Temiz
Geo. Eng.
General Dir. of 
Disaster Affairs



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list