VS: [mapserver-users] GetFeatureInfo results: Search returned no results

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Tue Apr 10 05:55:28 EDT 2012


Hi,

You do not want to use meters as tolerance units. Use pixels. The default is 3, try to increase it to 10 or something.
I did not find any point layer we use with GetFeatureInfo but this one works for polygon shapefile

LAYER
        NAME "Natura2000"
        STATUS ON
        DATA "\Data\natura06_poly"
        TYPE POLYGON
        DUMP TRUE
        UNITS METERS
        SIZEUNITS PIXELS
        TOLERANCE 3
        HEADER    "d:\data\template\natura_header.html"
        TEMPLATE  "d:\data\template\natura_template.html"
        FOOTER    "d:\data\template\natura_footer.html"
        TOLERANCEUNITS PIXELS
        METADATA
          "wms_include_items" "SPA,SCI,SCI2"
          "gml_include_items" "all"
          "wms_title"    "Natura2000"
          "wms_srs" "EPSG:2393 EPSG:3067 EPSG:4326"
        END
        CLASS
        NAME "Natura2000"
        STYLE
        COLOR 200 50 0
        END
        END
        PROJECTION
          "init=epsg:2393"
        END
  END

-Jukka Rahkonen-

________________________________
Lähettäjä: Neelima Emmani [mailto:neelima.emmani at iictechnologies.com]
Lähetetty: 10. huhtikuuta 2012 12:12
Vastaanottaja: Rahkonen Jukka
Kopio: mapserver-users at lists.osgeo.org
Aihe: RE: [mapserver-users] GetFeatureInfo results: Search returned no results

Hi Rahkonen,

Tried giving Tolerance as 3 and it's units as meters , but it did not work. Also tried with the mapfile that has shapefile layer. The case is same.
Do you any other idea that can solve my problem. And if you have already worked on this can you please send a piece of code that works.

With Regards,
Neelima Emmani
________________________________
From: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] on behalf of Rahkonen Jukka [Jukka.Rahkonen at mmmtike.fi]
Sent: Tuesday, April 10, 2012 12:29 PM
To: 'mapserver-users at lists.osgeo.org'
Subject: Re: [mapserver-users] GetFeatureInfo results: Search returned no results

Hi,

Perhaps you do not hit the points? See tolerance and toleranceunits in http://mapserver.org/mapfile/layer.html and set tolerance to quite many pixels for eliminating the possibility that your click just does not hit the target.

If that does not help I would have another try by copying the data from PostGIS ínto shapefile and dublicating the layer. If GetFeatureInfo works with shapefile then the trouble must have something to do with communication with PostGIS.

I wonder why do you have layer status=OFF instead of ON.

-Jukka Rahkonen-

Neelima Emmani  wrote:

Hi All,

I  am having a problem in retrieving getfeatureinfo. Result in the browser is

GetFeatureInfo results:  Search returned no results.

  *   Below is the url, i am accessing to get feature info -

http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/openlayers-2.10/examples/mh.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&Layers=maps&SRS=EPSG:4326&BBOX=-83.61145,24.726875,-78.118286,27.196014&X=529&Y=228&WIDTH=1000&HEIGHT=500&QUERY_LAYERS=maps


  *   Map file -

MAP
  NAME "MH"
  # Map image size
  SIZE 600 600
  UNITS meters
  EXTENT -86.731680 24.422064 -76.149835 30.424575
  FONTSET './etc/fonts.txt'
  SYMBOLSET './etc/symbols.txt'
  CONFIG "PROJ_LIB" "C:/ms4w/httpd.d/proj/nad/"

  PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'towgs84=0,0,0,0,0,0,0'
    'no_defs'
  END

  # Background color for the map canvas -- change as desired
  IMAGECOLOR 255 255 255
  IMAGEQUALITY 95
  IMAGETYPE agg

  OUTPUTFORMAT
    NAME agg
    DRIVER AGG/PNG
    IMAGEMODE RGB
  END

  # Legend
  LEGEND
      IMAGECOLOR 255 255 255
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    END
  END

  # Web interface definition. Only the template parameter
  # is required to display a map. See MapServer documentation
  WEB
    # Set IMAGEPATH to the path where MapServer should
    # write its output.
    IMAGEPATH '/ms4w/tmp/ms_tmp/'

    # Set IMAGEURL to the url that points to IMAGEPATH
    # as defined in your web server configuration
    IMAGEURL '/ms_tmp/'

    # WMS server settings
    METADATA
      'ows_title'           'MH'
      'ows_onlineresource'  'http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/openlayers-2.10/examples/mh.map&'
      'ows_srs'             'EPSG:4326 EPSG:900913'
      'ows_enable_request'  'GetMap GetFeature GetFeatureInfo *'   ##necessary
      "wms_feature_info_mime_type" "text/html"
      "wms_getfeatureinfo"
"http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/openlayers-2.10/examples/mh.map&"
      "wms_featureinfoformat" "text/html"
      "wfs_abstract"       "This text describes my WFS service."

    END

    #Scale range at which web interface will operate
    # Template and header/footer settings
    # Only the template parameter is required to display a map. See MapServer documentation
    TEMPLATE 'template.html'
  END

  LAYER
    NAME 'maps'
    TYPE POINT
    DUMP true
    TEMPLATE  'template.html'
    HEADER 'header.html'
    FOOTER 'footer.html'
    EXTENT -86.731680 24.422064 -76.149835 30.424575
    CONNECTIONTYPE postgis
    CONNECTION "dbname='postgis' host=localhost port=5432 user='postgres' password='xxxxxx' sslmode=disable"
    DATA 'the_geom FROM "maps" USING UNIQUE id USING srid=4326'
    FILTER ( geometrytype("the_geom") IN ('POINT','MULTIPOINT') )
    METADATA
      'ows_title' 'maps'
      'wfs_typename' 'maps'
      'wfs_version' '1.0.0'
      'wfs_connectiontimeout' '60'
      'wfs_maxfeatures' '150'
      'wfs_filter' 'GET'
      'wms_include_items' 'all'
      'wfs_featureid' 'the_geom'
      'gml_include_items' 'all'

    END
    STATUS OFF
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'towgs84=0,0,0,0,0,0,0'
    'no_defs'
    END
    CLASS
       NAME 'maps'
       STYLE
         SYMBOL "circle"
         SIZE 7.0
         OUTLINECOLOR 0 0 0
         COLOR 170 211 227
       END
    END
  END

END


Template.html --
<!-- MapServer Template -->
<tr><td>[lrn]</td><td>[NAME]</td><td>[LAT]</td><td>[LON]</td><td>[ELEVATION]</td><td>[QUADNAME]</td></tr>

header.html--
<!-- MapServer Template -->
<font size+1><b>Layer: airports</b></font><p>
<table cellpadding=5 cellspacing=2 border=0>
<tr bgcolor=#CCCCCC><td bgcolor=#ffffff>&nbsp;</td><th>name</th><th>latitude</th><th>longitude</th><th>address</th><th>description</th></tr>

footer.html --
<!-- MapServer Template -->
</table><p>

If any finds any fault with my code or anything that should be added to get feature info then please let me know.
Awaiting reply.

With Regards,
Neelima Emmani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120410/c24955d8/attachment.html


More information about the mapserver-users mailing list