[mapserver-users] Doubt about MapServer projections and WMS

Havard Tveite havard.tveite at umb.no
Mon Nov 28 04:17:38 EST 2011


Hello Jorge,

Your interpretation of the documentation seems correct.

Regarding the need for a PROJECTION object at the MAP
level:
Without it, Mapserver will generate an error message.
I agree with you that for a WMS service it seems illogical
to have to provide a PROJECTION element at the MAP level
if there are projections defined in the MAP METADATA
section.

Perhaps one of the developers can explain.

Håvard Tveite

On 11/10/2011 7:49 PM, Jorge Arévalo wrote:
> Hello,
>
>> From http://mapserver.org/mapfile/projection.html
>
> I get this:
>
> "(...) To set up projections you must define one projection object for
> the output image (in the MAP object) and one projection object for
> each layer (in the LAYER objects) to be projected.
>
> (..)
>
> Think of the MAP-level projection object as your output projection.
> The EXTENT and UNITS values at the MAP-level must be in the output
> projection units. Also, if you have layers in other projections (other
> than the MAP-level projection) then you must define PROJECTION objects
> for those layers, to tell MapServer what projections they are in."
>
> Ok, pretty clear so far. Mapserver will render one or more data
> layers. Each data layer will have its own projection, and this is
> specified in the PROJECTION property of the layer object. The layers
> will be render to a image map with another projection. This projection
> is specified in the PROJECTION property of the MAP object, at highest
> level. This is the output projection.
>
> Now, I want to serve my maps under WMS protocol.
> http://mapserver.org/ogc/wms_server.html#setup-a-mapfile-for-your-wms
>
> So, I need to define a MAP PROJECTION. And that projection will be
> used to generate a BoundingBox tag for the GetCapabilities XML
> response. But, my first question: Is this the projection in which the
> data will be rendered? What about if I want to serve my data in
> different projections? Do I need to specify several PROJECTION objects
> at MAP level?
>
> I guess not, because I read: "(...)  it is often impossible to find an
> EPSG code to match the projection of your data. In those cases, the
> “wms_srs” metadata is used to list one or more EPSG codes that the
> data can be served in, and the PROJECTION object contains the real
> PROJ4 definition of the data’s projection"
>
> So, if I understood, I specify the output projections I offer for my
> data in "wms_srs" at WEB object level. But then, why do I need a
> PROJECTION object at MAP level? I specified the projection of all my
> input data in each LAYER object. Or other way:
>
> - My input data projection is defined at LAYER level
> - The output projections offered are specified in "wms_srs" at WEB level
>
> Then,,, why do I need PROJECTION object at MAP level when I want to
> configure my WMS server?
>
> Sorry for the basic questions, and many thanks in advance
>
> Best regards,
>

-- 
Håvard Tveite
Department of Mathematical Sciences and Technology, UMB
Drøbakveien 31, POBox 5003, N-1432 Ås, NORWAY
Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt/


More information about the mapserver-users mailing list