[Mapserver-users] Projection on the Fly Problems

Ed McNierney ed at topozone.com
Wed Apr 30 20:22:27 EDT 2003


John -

I would recommend "init=epsg:4267", but those should be fine.  Can you
send the PROJECTION object for the main MAP file, too, along with the
EXTENT (either in the mapfile or as a parameter) that you're trying to
view?  The most common cause of invisible reprojections is data that's
reprojected right out of the view frame.

	- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: (978) 251-4242  Fax: (978) 251-1396
ed at topozone.com


-----Original Message-----
From: John Norton [mailto:jnorton at fs.fed.us] 
Sent: Wednesday, April 30, 2003 7:02 PM
To: Ed McNierney
Cc: mapserver-users at lists.gis.umn.edu;
mapserver-users-admin at lists.gis.umn.edu
Subject: RE: [Mapserver-users] Projection on the Fly Problems


Thanks Ed, I agree the UTM zone is required for the example I provided.
But, actually I grabbed the example from the wrong map file )-:  The
projection that is causing problems is the latlong which I am trying to
convert to aea. So my layers look like...
LAYER
   NAME "Fires"
   TYPE POLYGON
   CONNECTIONTYPE OGR
   CONNECTION "c:/msapps/maplab/large_fires/data/l48/tburn111,3"
   STATUS ON
   PROJECTION
     "proj=latlong"
     "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=latlong"
     "ellps=clrk66"
     "datum=NAD27"
   END
    CLASS
      NAME "Boundary"
      SYMBOL 14
      COLOR 120 120 120
      SIZE 1
    END
  END
------------------------------------------------------
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/
------------------------------------------------------


 

                      "Ed McNierney"

                      <ed at topozone.com>                    To:
"John Norton" <jnorton at fs.fed.us>, <mapserver-users at lists.gis.umn.edu>

                      Sent by:                             cc:

                      mapserver-users-admin at lists.         Subject: RE:
[Mapserver-users] Projection on the Fly Problems                     
                      gis.umn.edu

 

 

                      04/30/2003 03:06 PM

 

 





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

_______________________________________________
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