[mapserver-users] Projection question
Helen Eskina
heskina at ubitech.com
Fri Nov 13 12:51:35 PST 2009
Hello,
I have just started working with MapServer and MapScript.
I would really appreciate any help!
I tried to create a point on the map using GMap Demo. My point is presented
by latlong coordinates. Below is the code.
------------------------------------------------------------
$map = ms_newMapObj($map_path."mymap.map");
$daLayer = ms_newLayerObj($map);
$daLayer->set("type", MS_LAYER_POINT);
$daLayer->set("status", MS_ON);
$class = ms_newClassObj($daLayer);
$style = ms_newStyleObj($class);
$style->color->setRGB(255,0,0);
$style->set("symbolname", "circle");
$style->set("size", 10);
$my_point = ms_newpointObj();
$my_point->setXY(45.322500,-75.669167);
$image=$map->draw();
$my_point->draw( $map, $daLayer, $image, 0, "Point" );
$image_url=$image->saveWebImage();
-----------------------------------------------------------------------
The point is shown on the map, but in the wrong place. I understand that it
is probably because the projection is wrong.
How to find out which projection is used in the map file?
MAP file:
MAP
NAME DEMO
STATUS ON
#SIZE 400 300
SIZE 800 600
SYMBOLSET ../etc/symbols.sym
EXTENT -2200000 -712631 3072800 3840000
UNITS METERS
SHAPEPATH "../data"
IMAGECOLOR 255 255 255
FONTSET ../etc/fonts.txt
LAYER
NAME bathymetry
METADATA
"DESCRIPTION" "Elevation/Bathymetry"
END
TYPE RASTER
STATUS ON
DATA bath_mapserver.tif
END
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091113/0e35eac8/attachment.htm>
More information about the MapServer-users
mailing list