[mapguide-internals] WMS configuration and SRS different from WGS84

Gabriele Monfardini gabrimonfa at gmail.com
Mon Aug 20 08:12:49 PDT 2012


Hi all,

I'm facing some problems in trying to configure Mapguide 2.4 to act as
a WMS server using a SRS different from WGS84.

I have modified MAPGUIDE_DIR/server/Wfs/1.3.0.xml.awd adding after

 <Define item="EX_GeographicBoundingBox.translate.xml">
    <translate from="EPSG:4326" ?>
        <EX_GeographicBoundingBox>
            <westBoundLongitude>&Enum.item.west;</westBoundLongitude>
            <eastBoundLongitude>&Enum.item.east;</eastBoundLongitude>
            <southBoundLatitude>&Enum.item.south;</southBoundLatitude>
            <northBoundLatitude>&Enum.item.north;</northBoundLatitude>
        </EX_GeographicBoundingBox>
    </translate>

a section that read

    <translate from="EPSG:3003" ?>
        <EX_GeographicBoundingBox>
            <westBoundLongitude>&Enum.item.west;</westBoundLongitude>
            <eastBoundLongitude>&Enum.item.east;</eastBoundLongitude>
            <southBoundLatitude>&Enum.item.south;</southBoundLatitude>
            <northBoundLatitude>&Enum.item.north;</northBoundLatitude>
        </EX_GeographicBoundingBox>
    </translate>

After that there is another tag that reads

 <Define item="BoundingBox.xml">
  <BoundingBox CRS="&Enum.item.SRS;" minx="&Enum.item.west;"
miny="&Enum.item.south;" maxx="&Enum.item.east;"
maxy="&Enum.item.north;"/>
 </Define>


If I understood correctly WMS specifications,
<EX_GeographicBoundingBox> tag is used to serve the bounding box in
WGS84 for rapid filtering without SRS reprojection, while <BoundingBox
/> tag is the real Bounding Box in the correct SRS (that in my case is
ESPG:3003).

The variables "Enum.item.west;", "Enum.item.east;" and so on are read
from the Library dbxml, as I can see from the (wonderful) "Edit raw
header" feature of the layer in Maestro..

And here comes the problem.
Using the very same variables in <EX_GeographicBoundingBox> and in
<BoundingBox /> makes impossible to specify both the correct Bounding
Box and <EX_GeographicBoundingBox> if the SRS is not WGS84.

I've tried to solve the problem defining other elements inside the
Bounds tag of the raw headers, namely west2, east2, south2 and north2
and modifying the <EX_GeographicBoundingBox> to read from them.

It appears to work, according to the WMS clients that I'm trying (the
other way, a.k.a., using the  west2, east2, south2 and north2 for the
BoundingBox instead does not work, probably because the variables are
used elsewhere)

But obviously is an ugly hack (also because bounding box in WGS84
should be computed by hand).

Is there a better solution?

Regards,

Gabriele Monfardini


More information about the mapguide-internals mailing list