[Mapserver-users] Projection on the Fly Problems
Ed McNierney
ed at topozone.com
Wed Apr 30 14:06:07 PDT 2003
John -
You aren't providing enough information to specify your UTM projections. You need to specify the central meridian (i.e. the UTM zone) each is in.
You might find it easier to look up the EPSG codes for each projection and just use the codes. They're more cryptic but less error-prone. You can find them at http://mapserver.gis.umn.edu/doc/proj.html
The NAD27 UTM zones are five-digit numbers of the form "267zz" where zz is the two-digit (pad with a leading zero) zone number. So to define a UTM Zone 9, NAD27 projection you can say:
PROJECTION
"init=epsg:26709"
END
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
ed at topozone.com
(978) 251-4242
-----Original Message-----
From: John Norton [mailto:jnorton at fs.fed.us]
Sent: Wednesday, April 30, 2003 4:49 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Projection on the Fly Problems
I Have a map file with two layers...
LAYER
NAME "Fires"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "c:/msapps/maplab/large_fires/data/l48/tburn111,3"
STATUS ON
PROJECTION
"proj=utm"
"ellps=clrk66"
"datum=NAD27"
END
CLASSITEM "Status"
CLASS
NAME Burning
Expression "502"
COLOR 255 0 0
END
CLASS
NAME Burnt
Expression "501"
COLOR 255 255 0
END
END
LAYER
NAME "States"
STATUS ON
DATA "states"
TYPE LINE
PROJECTION
"proj=utm"
"ellps=clrk66"
"datum=NAD27"
END
CLASS
NAME "Boundary"
SYMBOL 14
COLOR 120 120 120
SIZE 1
END
END
I am trying to project these using mapscript with code that looks like
this...
$map = ms_newMapObj($map_path."l48c.map");
$result=$map->setProjection
("proj=aea,ellps=clrk66,datum=NAD27,lat_1=29.5,lat_2=45.5,lat_0=23,lon_0
=-96,x_0=0,y_0=0,units=m",MS_TRUE);
$image=$map->draw();
$image_url=$image->saveWebImage(MS_PNG,1,1,0);
$projection = $map->getProjection();
No errors, setProjection returns 0 which I guess means the projection
didn't take but, when I echo $projection it reports the projection string
with commas replace by plus signs. The problem is I get no image. I am
using Mapscript...
MapServer version 3.6.6-dev OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
INPUT=EPPL7 INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
Same thing happens when I run mapscript as a CGI....
MapServer version 3.7 (development) OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PD
F OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=GD2_RGB INPUT=EPPL7 INPUT=OGR INPUT=GDAL
INPUT=SHAP
EFILE
Is this a units problem my data is in decimal degrees? I think I have PROJ
installed correctly it is in c:\proj with a path to the bin directory. I
also tried (meaning I added it to the PHP.ini file as an extension) the PHP
extension php_proj.dll. Are these conflicting?
Cheers
------------------------------------------------------
John Norton
USDA-RSAC
2222 W 2300 S
Salt Lake City, UT 84119
Phone: 801-975-3766
Fax: 801-975-3478
Intranet: fsweb.rsac.fs.fed.us
Internet: www.fs.fed.us/eng/rsac/
------------------------------------------------------
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list