Changes between Version 1 and Version 2 of RasterQuery


Ignore:
Timestamp:
Jan 29, 2009, 12:02:08 PM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RasterQuery

    v1 v2  
    55== General Approach ==
    66
    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.
     7Raster 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.
    88
    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.
     9Currently !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.
    1010
    1111Each pixel matching the query has (potentially) the following attributes:
     
    2020    * blue: blue component of display color for this pixel.
    2121
    22 == MapScript Example ==
     22== !MapScript Example ==
    2323
    24 This Python MapScript example gives an idea of how the query can be done, and results fetched in MapScript.
     24This Python !MapScript example gives an idea of how the query can be done, and results fetched in MapScript.
    2525{{{
    2626#!python
     
    4848layer.close()
    4949}}}
    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.
     50Note 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.
    5151
    5252== Query With Templates ==
     
    6464== Working Notes ==
    6565
    66     * Note that WMS GetFeatureInfo? requests work against raster layers!
     66    * Note that WMS GetFeatureInfo requests work against raster layers!
    6767    * 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.
    6969    * 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).