It works! Thanks much!
That was definitely the issue. Thanks also to Josh for spending a lot of time trying to help me figure this out.

Here is a summary of the problem for the record:

I was trying to get the WMS GetFeatureInfo request working on my mapserver copy. I kept getting a response that looked like this:

GetFeatureInfo results:

Layer 'ira_fill2'
Feature 689:


The solution was to put 'wms_include_items' 'all' in the METADATA block for the layer.

You can see the results here: http://roadlessland.org
It is a site that allows users to get info about inventoried roadless areas in US Forest Service lands. The spatial data is a shapefile that is about 32mb. The site uses Google maps and overlays the map with a wms layer from mapserver. User clicks on the map are processed with a GetFeatureInfo request to mapserver.

Thanks for all your help, everyone.

nelson


On Jan 6, 2008, at 9:35 AM, Arnd Wippermann wrote:

Hi Nelson,

put this

    'wms_include_items' 'all'
in the METADATA block for your layer.

Mit freundlichen GrĂ¼ssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/



Von: UMN MapServer Users List [mailto:MAPSERVER- [EMAIL PROTECTED] Im Auftrag von nelson guda
Gesendet: Freitag, 4. Januar 2008 22:59
An: [email protected]
Betreff: Re: [UMN_MAPSERVER-USERS] WFS request options

Thanks Josh,

I looked over the WMS GetFeatureInfo request, and this is exactly what I need. For some reason, though the only data I am getting back looks like this:

GetFeatureInfo results:

Layer 'ira_fill2'
Feature 689:


The feature number appears to correspond to the correct place in the dbf file, but none of the rest of the feature data is being returned. I don't understand. Does anyone have any ideas?

thanks,
nelson


Here is the mapfile and request that I made:

Request:
http://thewildwoodstudios.com/cgi-bin/mapserv?map=../roadlessland/ maps/ ira.map&REQUEST=GetFeatureInfo&SERVICE=WMS&reaspect=false&VERSION=1.1. 1&LAYERS=ira_fill2&STYLES=default&FORMAT=image/ gif&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG: 4326&WIDTH=256&HEIGHT=256&QUERY_LAYERS=ira_fill2&x=254&y=165&BBOX=-122 .16796875,46.37725420510028,-122.080078125,46.4378568950242

Mapfile:

MAP

NAME "Roadless"
STATUS ON
SIZE 800 600
STATUS ON
EXTENT -124.40950012207 18.2457218170166 -65.7071533203125 49.0011405944824
IMAGETYPE PNG
SHAPEPATH "../shapefiles"
FONTSET ../fonts/fonts.txt


PROJECTION
"init=epsg:54004"
END

WEB
IMAGEPATH "/tmp/"
IMAGEURL "/tmp/"
METADATA
"wms_title" "ira_wms"
"wms_onlineresource" "http://thewildwoodstudios.com/cgi-bin/mapserv? map=../roadlessland/maps/ira.map&"
"wms_srs" "EPSG:4326 EPSG:54004 EPSG:4269"
END
END


LAYER
NAME "ira_fill2"
TYPE POLYGON
METADATA
"wms_title" "ira_fill2"
"wms_srs" "EPSG:4326 EPSG:54004"
END


PROJECTION
"init=epsg:4269"
END
DATA ira_by_name_nad83
STATUS ON
TRANSPARENCY 75
LABELITEM "NAME"
LABELMAXSCALE 1000000
TEMPLATE "query.html"
TOLERANCE 3
TOLERANCEUNITS PIXELS
DUMP TRUE
CLASSITEM "ID"

CLASS
STYLE
COLOR 0 255 0
END
LABEL
COLOR 0 0 0
OUTLINECOLOR 255 255 255
MINFEATURESIZE 40

TYPE TRUETYPE
FONT arial-narrow-italic
SIZE 8
ANTIALIAS TRUE
POSITION cc
PARTIALS FALSE
MINDISTANCE 300
WRAP '/'
END

END
END


END




On Jan 4, 2008, at 10:48 AM, Josh Livni wrote:

Nelson,

Using this method, you don't want to make a WFS request - you want to make a WMS request. The mapserver site has documentation on how to set up your mapfile to respond to WMS requests (http:// mapserver.gis.umn.edu/docs/howto/wms_server) as well as the template (which can be very simple for your use case).

There's a thread on the google groups list about using getFeatureInfo, but since the guy's WMS is down it's probably not the best example (though you could still look at his code). http://openlayers.org/dev/examples/getfeatureinfo.html is another example that you could probably start with for assistance on the client side -- you'd need to modify it to work with Google Maps (eg using Google's methods to get at their bbox and other criteria while creating the queryUrl, and to parse the result) but the concept is the same, so this should get you started.

Also - glad to hear my old comments helped on the roadlessland site - it looks nice.

Cheers,

-Josh

PS - Please be sure to CC the mapserver list if this doesn't make sense - others here may well have better ideas on how to help than me, and chances are if you want to know something, others may be in the same boat, and thus find the thread helpful.



nelson guda wrote:
Hi again, Josh,

I just tried "DescribeFeatureType", which works but the response only give the names of the variables. Any idea on how to get the actual data about those variables?

many thanks,
nelson

DescribeFeatureType response:


<element name="ira"
type="ms:iraType"
substitutionGroup="gml:_Feature" />

<complexType name="iraType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="msGeometry" type="gml:GeometryPropertyType" minOccurs="0" maxOccurs="1"/>
<element name="NAME" type="string"/>
<element name="ID" type="string"/>
</sequence>
</extension>
</complexContent>
</complexType>






On Jan 4, 2008, at 8:53 AM, Josh Livni wrote:

This doesn't answer you question exactly, but have you considered using a WMS getFeatureInfo request instead? Then you can use a simple template.html to decide which attributes you want to return for later parsing. I've done this a few times myself with Google Maps.

-Josh

nelson guda wrote:
Hi all,

I have an odd request regarding WFS capabilities. Is it possible to have a WFS mapserver request return gml results without the geometry data?

I know that this seems odd, but it makes sense for what I am doing. I am using a WMS overlay to serve tiles for a large dataset to an overlay on google maps. In order to query specific polygons from that dataset (a shapefile), I am using a WFS GetFeature request. All I need is the id and other parameters of the feature, but not the geometry data (because it is already there from the WMS. Right now I am just parsing out the info I need from the gml at the server level, but it would be much faster if I could get the WFS to return only the feature info minus the geometry data. Is this possible?

Thanks, and thanks for your previous help.

nelson


Reply via email to