Changes between Version 1 and Version 2 of RasterQuery
- Timestamp:
- Jan 29, 2009, 12:02:08 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RasterQuery
v1 v2 5 5 == General Approach == 6 6 7 Raster query support is setup to return a set of request result "shapes" for each pixel matching the query. In MapServer CGI, normal template substitution is done. In MapScript the normal mechanisms for reading a query result can be applied.7 Raster query support is setup to return a set of request result "shapes" for each pixel matching the query. In MapServer CGI, normal template substitution is done. In !MapScript the normal mechanisms for reading a query result can be applied. 8 8 9 Currently QueryByPoint? (with single or multiple modes), QueryByRect? and QueryByShape?are supported. Care should be taken to avoid providing a large query area (selecting alot of pixels) as each selected pixel requires over 100 bytes of memory for temporary caching. The RASTER_QUERY_MAX_RESULT PROCESSING item can be used to restrict the maximum number of query results that will be returned. The default is one million which would take on the order of 100MB of RAM.9 Currently !QueryByPoint (with single or multiple modes), !QueryByRect and !QueryByShape are supported. Care should be taken to avoid providing a large query area (selecting alot of pixels) as each selected pixel requires over 100 bytes of memory for temporary caching. The RASTER_QUERY_MAX_RESULT PROCESSING item can be used to restrict the maximum number of query results that will be returned. The default is one million which would take on the order of 100MB of RAM. 10 10 11 11 Each pixel matching the query has (potentially) the following attributes: … … 20 20 * blue: blue component of display color for this pixel. 21 21 22 == MapScript Example ==22 == !MapScript Example == 23 23 24 This Python MapScript example gives an idea of how the query can be done, and results fetched in MapScript.24 This Python !MapScript example gives an idea of how the query can be done, and results fetched in MapScript. 25 25 {{{ 26 26 #!python … … 48 48 layer.close() 49 49 }}} 50 Note that the normal vector feature layer mechanism (layer.open(), layer.getShape()) is used to fetch the query results. The query operation creates an internal fake set of shapes representing the pixels that matched the query. Attempts to use layer.open() and layer.getShape() on a raster layer that has not been previously queried will just return zero shapes (and an empty item list). Furthermore, saving query results and re-loading them won't work since the way MapServer saves query results is to just save the id's, not the actual contents.50 Note that the normal vector feature layer mechanism (layer.open(), layer.getShape()) is used to fetch the query results. The query operation creates an internal fake set of shapes representing the pixels that matched the query. Attempts to use layer.open() and layer.getShape() on a raster layer that has not been previously queried will just return zero shapes (and an empty item list). Furthermore, saving query results and re-loading them won't work since the way !MapServer saves query results is to just save the id's, not the actual contents. 51 51 52 52 == Query With Templates == … … 64 64 == Working Notes == 65 65 66 * Note that WMS GetFeatureInfo ?requests work against raster layers!66 * Note that WMS GetFeatureInfo requests work against raster layers! 67 67 * Currently scaling is not applied to non-eight bit values in before computing class or color. Thus class, red, green and blue results may be a little or alot wrong in some circumstances. See 68 * The _msQueryByIndex ?(), msQueryByIndexAdd?(), msQueryByAttributes?() and msQueryByFeatures?() are not supported for rasters. I don't really understand what they are or what they do.68 * The _msQueryByIndex(), msQueryByIndexAdd(), msQueryByAttributes() and msQueryByFeatures() are not supported for rasters. I don't really understand what they are or what they do. 69 69 * The raster layer follows similar rules to other layers to enable query. Basically a template must be enabled on the layer. Also, min/max scale, and status checks are applied. 70 * There is a bug with classified layers that use [red], [green] and [blue] in expression. See bug 1021 (http:// mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1021). [[BR]]70 * There is a bug with classified layers that use [red], [green] and [blue] in expression. See bug 1021 (http://trac.osgeo.org/mapserver/ticket/1021).