Open tbonfort opened 12 years ago
Author: hobu Date: 2004/12/08 - 18:20
ok. What's going on is it's trying to read the extent of the layer in
msOWSGetLayerExtent, which is provoking it to open the layer. If an extent is
defined for the layer via wms_extent, then it skips this step and doesn't try to
open the layer
I'm seeing an effect, now that I get this to reproject, where one of my layers
is swallowed up and not drawn. If I make a copy of it and give it a different
name, the copy draws ok. If I do not do the reprojection, it draws fine.
Author: fwarmerdam Date: 2005/02/25 - 22:36
It turns out that shp2img on pretty much any map with a WMS layer does
produce this error, it is just supressed. MapScript is sensitive to "set
errors" and reports it to the user where shp2img does not. Breaking in
msSetError() in shp2img is helpful.
MAP
NAME "Testing"
EXTENT -0.5 50.977222 0.5 51.977222
IMAGETYPE PNG
IMAGECOLOR 255 255 255
STATUS ON
SIZE 200 200
FONTSET "fonts.txt"
SYMBOLSET "symbols.txt"
WEB
IMAGEPATH "/tmp"
END
LAYER
NAME "WMS_RASTER"
TYPE RASTER
PROJECTION
"init=epsg:4326"
END
#EXTENT -0.5 50.977222 0.5 51.977222
CONNECTIONTYPE WMS
CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?"
METADATA
wms_srs "EPSG:4326"
wms_server_version "1.1.1"
wms_name "global_mosaic"
wms_style "visual"
wms_format "image/jpeg"
END
STATUS DEFAULT
END
END
My "fix" is to avoid calling msLayerGetExtent() for layers of type
MS_LAYER_RASTER. For a regular raster layer, or a WMS layer, the
whole layer API does not provide a constructive access to layer extents.
I am a bit concerned that this will prevent use of raster tile indexes
to get extents even though that might be a very effective way of collecting
the extent. But for now I'm going to disregard that possibility.
BTW, the getextents is being called from msGDALGetGeoTransform() which
tries msOWSGetLayerExtent() as a way of checking for metadata extents if
nothing else is available.
I will apply the following change in 4.5 and 4.4.x.
else if( lp->type != MS_LAYER_RASTER )
{
return msLayerGetExtent(lp, ext);
}
Reporter: hobu Date: 2004/12/07 - 23:05