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

Neelima Emmani neelima.emmani at iictechnologies.com
Tue Apr 10 02:02:14 EDT 2012


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/6857a1d2/attachment-0001.html


More information about the mapserver-users mailing list