Rép. : [mapserver-users] GetFeatureInfo from Oracle Spatial

SIMON MERCIER simon.mercier at msp.gouv.qc.ca
Mon Jun 9 15:21:06 EDT 2008


maybe you can try to limite the output field in the metadata
"$$$_include_items" "$$$_exclude_items" tag :
...
DATA "SHAPE FROM  MAPSERVER_TRIMQ USING UNIQUE MAXIMO_ID SRID 32632
VERSION 10g"
...
METADATA
    ...
      "wms_exclude_items" "ALL"
      "wms_include_items" "MAXIMO_ID, ASSETTYPE"
      "oms_exclude_items" "ALL" 
      "ows_include_items" "MAXIMO_ID, ASSETTYPE"
      "gms_exclude_items" "ALL"
      "gml_include_items" "MAXIMO_ID, ASSETTYPE"
END
 ...

>>> Kristian Thy <thy at 42.dk> 7/6/2008 18:49 >>>

Hi list

I've made a small openlayers viewer that shows a data layer from a
materialized view in Oracle Spatial. When clicking on the map, I do a
simple GetFeatureInfo which works when I test it with a
shapefile-based
layer, but when I move to the Oracle layer, I get an error message
saying that no features were found with MAXIMO_ID = 0 (something to
that
effect, anyways). Unfortunately this is an internal GIS app, so I
can't
demo it.

The relevant layer definition in my map file:
------------------------------------------------------------------------
  LAYER
    NAME 'TRIM-Q'
    TYPE POINT
    CONNECTIONTYPE oraclespatial
    CONNECTION "******@******"
    DATA "SHAPE FROM (SELECT MAXIMO_ID, ASSETTYPE, SHAPE FROM
MAPSERVER_TRIMQ) USING UNIQUE MAXIMO_ID SRID 32632 VERSION 10g"
    TEMPLATE "trim.html"
    HEADER "trim_header.html"
    FOOTER "trim_footer.html"
    TOLERANCE 20
    DUMP true 

    METADATA
      "wms_title" "TRIM-Q"
      "wms_srs" "EPSG:32632"
      "wms_include_items" "ALL"
      "ows_include_items" "ALL"
      "gml_include_items" "ALL"
    END #metadata

    CLASS
      NAME 'vejskab' 
      EXPRESSION ('[ASSETTYPE]' = 'VEJSKAB')
      STYLE
        SYMBOL 'square'
        OFFSET -4 -2
      END #STYLE
      LABEL
        type truetype
        antialias true
        font arial_black
        size 8
        position ll
        color 0 0 0
        outlinecolor 255 255 255
        buffer 2
        partials false
      END #label
      TEXT ([MAXIMO_ID])
    END #class

    CLASS
      #NAME faerdselstavle
      EXPRESSION ('[ASSETTYPE]' = 'TAVLE')
      STYLE
        SYMBOL 'triangle'
        OFFSET -10 2
      END #STYLE
      LABEL
        FORCE true
        type truetype
        antialias true
        font arial_black
        size 8
        position lc
        color 0 0 0
        outlinecolor 255 255 255
        buffer 0
        partials false
      end #label
      TEXT ([MAXIMO_ID])
    END #class

    CLASS
      #NAME 'other values'
      STYLE
        SYMBOL 'circle'
        SIZE 2
        COLOR 100 0 0
      END #STYLE
      LABEL
        type truetype
        antialias true
        font arial_black
        size 8
        position uc
        color 0 0 0
        outlinecolor 255 255 255
        buffer 2
        partials false
      end #label
      TEXT ([MAXIMO_ID])
    END #class

    SIZEUNITS PIXELS
    STATUS ON
    UNITS meters
    MAXSCALE 60000
    LABELMAXSCALE 60000    
  END #layer
------------------------------------------------------------------------

The OpenLayers code I use for calling GetFeatureInfo:
------------------------------------------------------------------------
            map.events.register('click', map, function (e)
            {
                var url = trimq.getFullRequestString({
                    REQUEST: 'GetFeatureInfo',
                    EXCEPTIONS: 'application/vnd.ogc.se_xml',
                    BBOX: trimq.map.getExtent().toBBOX(),
                    X: e.xy.x,
                    Y: e.xy.y,
                    INFO_FORMAT: 'text/plain',
                    QUERY_LAYERS: 'TRIM-Q',
                    RADIUS: 5,
                    WIDTH: trimq.map.size.w,
                    HEIGHT: trimq.map.size.h});
                document.getElementById('map').style.cursor = 'wait';
                OpenLayers.loadURL(url, '', this, handleResponse);
                Event.stop(e);
            });

            function handleResponse(response)
            {
                document.getElementById('map').style.cursor = 'auto';
                alert(response.responseText);
            }
------------------------------------------------------------------------

As mentioned, this works if I query a shapefile-based layer, so I
assume
the javascript is ok. Any ideas what my problem is?

\\kristian
-- 
... et nemo ex vobis interrogat me: »Quo vadis?«
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org 
http://lists.osgeo.org/mailman/listinfo/mapserver-users 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080609/9b16c1ea/attachment.html


More information about the mapserver-users mailing list