AW: [mapserver-users] Mapserver Projection Errors

SixDegrees paulcarlisle at comcast.net
Fri Oct 21 08:56:16 PDT 2011


Well, that certainly seems to explain things. If I supply a wms_srs setting,
the errors disappear. Sadly, I do not have the epsg codes, only the proj4
strings, and I'm not sure the WMS XML concocted by Mapserver is correct. If
I supply

   "wms_srs" "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs"

for example, the GetCapabilities request generates the following layer:

<Layer queryable="0" opaque="0" cascaded="0">
        <Name>MyImage</Name>
        <Title>MyImage</Title>
        <SRS>+proj=longlat</SRS>
        <SRS>+ellps=WGS84</SRS>
        <SRS>+towgs84=0,0,0,0,0,0,0</SRS>
        <SRS>+no_defs</SRS>
        <LatLonBoundingBox minx="51.4432" miny="35.7193" maxx="51.6412"
maxy="35.8732" />
        <BoundingBox SRS="+proj=longlat"
                    minx="51.4432" miny="35.7193" maxx="51.6412"
maxy="35.8732" />
</Layer>

Note how each term in the projection is given its own SRS tag, and the SRS
of the BoundingBox only uses the first element. This does not look right to
me, although things seem to work OK, as before. The Mapserver documentation
states that the layer will use the map-level wms_srs, which is defined as
"init=epsg:4326", but I worry that if I supply that in the layer metadata,
Mapserver will think this layer is already in that format and fail to
reproject when the image is acually in, say, a UTM format.

I have no way of retrieving or constructing the actual epsg code for each
layer; most often it simply isn't in the file in any form other than Proj.4.
If the layer-level wms_srs needs the actual epsg code of the file the layer
references, then this is never going to work.

Thank you very much for taking the time to sort this all out, though. It's
much, much farther than I ever would have got on my own.




Eichner, Andreas - SID-NLK wrote:
> 
> The error is caused by the msOWSPrintBoundingBox() function during the
> GetCapabilities request because there's no {ows,wms}_srs metadata set.
> The used function msOWSGetEPSGProj() tries to fall back to the
> projections "init=" parameter but isn't available here.
> It seems the whole thing is used to support bounding boxes for multiple
> coordinate systems in the GetCapabilities document. This might only have
> an effect if using WMS v1.3.0, {ows,wms}_bbox_extended metadata set to
> "true" and {ows,wms}_srs projection list with more than one entry. In
> such a case the original layer extent must be reprojected in  the listed
> SRS which might fail. In your case this might have no negativ impact
> beside the error message.
> To get rid off the message you need to set a {ows,wms}_srs metadata at
> layer level. It seems to be used to advertise the layer's CRS and build
> the multi BBOX feature only. Altough it might not harm you it might
> cause trouble in the future....
> 
> 
>> LAYER 
>>    NAME "test_image"
>>    EXTENT 51.44325 35.71925 51.64125 35.87325
>>    METADATA 
>>       "wms_title" "test_image"
>>       "wms_extent" "51.44325 35.71925 51.64125 35.87325"
>>    END
>>    PROCESSING "SCALE=AUTO" 
>>    PROCESSING "SCALE_BUCKETS=256" 
>>    TYPE RASTER 
>>    DATA "/data/geodata/yongbyon/test_image.vrt"
>>    PROJECTION 
>>       "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs"
>>    END
>> END
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at .osgeo
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Mapserver-Projection-Errors-tp6908527p6917339.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the MapServer-users mailing list