[Mapserver-users] Projection on the Fly Problems

John Norton jnorton at fs.fed.us
Wed Apr 30 16:48:58 EDT 2003


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/
------------------------------------------------------





More information about the mapserver-users mailing list