php3-mapscript and projections

Stephen Lime steve.lime at dnr.state.mn.us
Thu Aug 31 12:35:55 EDT 2000


Projections are largely set up in the map file. You can set projections via mapscript.
With mapscript proper there are setProjection methods for layer and map objects.
The argument is just a single string made up of proj parameters separated by commas.

For example $layer->setProjection("proj=utm,ellps=GRS80,zone=15,north,no_defs");

I don't know if Dan et al. has moved that to the php version or not.

The output map projection goes in the map (i.e. outside every other object) section.

If a layer has the same projection as the output projection you don't want to define
it's projection as they are assumed to be the same. Projection definition degrades
performance.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Doyon, Jean-Francois" <Jean-Francois.Doyon at CCRS.NRCan.gc.ca> 08/31/00 10:29AM >>>
Hey guys,

How do I setup projections using MapScript (PHP3) ?

I have a temporary shapefile that is in a different porjection than the rest
of my data ...

I haven't seen anything in the docs talking about a "projection object" or
anything like that ...

When I create a new layer from scratch in mapscript, how do I specify PROJ.4
parameters ?

Also, exactly where in the map file do I specify the projection for the
"output image" ?
So far I've done all the layers (except the temp one mentionned above), and
everything works 
fine, but then as it stands no conversion is being done. Do I put it at the
top, in no section in
particular ? Or in the "Web" section ?

Also, is it possible that specifying the projection for all your layers
(even if they all have the exact
same projection), makes things slightly faster ? Could be just an illusion
though :)

Thank you,

J.F.

> ----------
> From: 	Christian[SMTP:christian at gottschling.net] 
> Sent: 	Wednesday, August 30, 2000 2:22 PM
> To: 	Assefa Yewondwossen
> Cc: 	mapserver-users at lists.gis.umn.edu 
> Subject: 	php3-expression and zoom
> 
> Hi,
> this answer was damn fast! Many thanks, I try it tomorrow when I am back
> in 
> the office.
> This helps a lot!
> Has there anybody an example for the zooming-buttons, too? I haven't found
> 
> out from the gmap-example.
> 
> Can I even set a dynamic label  to the regions selected by "expression"?
> 
> 
> >  Here is an example that dynamically creates classes
> >on a certain layer (assumes here that $gpoMap is the
> >map object and there is a layer called classified in
> >the .map file) :
> >
> >$poLayer = $gpoMap->getlayerbyname("classified");
> >
> >$poLayer->set("classitem", "VW");
> >
> >$nColorId = $gpoMap->addColor(255, 0, 0);
> >
> >$poClass = ms_newClassObj($poLayer);
> >
> >$poClass->set("color", $nColorId);
> >
> >$poClass->setExpression("069");
> 
> What is the maximum number of classes and what is the practical maximum so
> 
> that the map is served in time?
> I like to run this within a loop and in the worst case I would have more 
> than 5000,  (all prefixes of germany).
> 
> 
> --
> Christian
> 
> --
> christian
> 




More information about the mapserver-users mailing list