Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.


My project is coming along nicely! A brief background on my project. I have a world map that is colored to show the country of origin of the students at a college. Each color represents the number students (a range). E.g. any country colored red has 1 to 20 students at the college. When you click on a country, I was successful in displaying data specific to that country in a pop-up.

Hopefully I can describe what I want to do next.... I want to add the ability to query the map such that the countries that satisfy the query will be highlighted on the map.
So for example, in my html form I enter > 300... click on submit.... England, India and USA are highlighted. I've figured out that I need to use WFS getFeature but as you can see it's the how that I need help with...

Can anyone direct me to an example of the above or give me some suggestions, I would be most appreciative.

I am using MapSever, PostGIS and Openlayers

Chris

share|improve this question
    
So you have built a Mapserver WMS and want to highlight certain features (dependent on queries) on the map? –  underdark Dec 12 '10 at 21:11
    
Yeah!! you hit the nail on the head!! Any ideas as to how I can do it? –  Chris Dec 12 '10 at 21:17
    
I don't get the title. What are you doing with shapefiles? You say you have your data in PostGIS. –  Nicklas Avén Dec 12 '10 at 22:10
    
My bad... Thanks for the heads-up!! –  Chris Dec 12 '10 at 22:33
2  
If you are using WMS/WFS then the fact your data is in postgis is irrelevant. –  iant Dec 12 '10 at 23:15
add comment

2 Answers

Maybe "Drawing selected features in Mapserver with mapscript" can get you started.

Mapserver's Querymap feature seems to be another way to go.

share|improve this answer
add comment

I don't know how to do it through a wms-service, but Mapserver has the ability to both handle a custom sql-query for getting the data (take a look at the third and fourth example here)

, and you can use run-time substitution to insert some value from the client into that query. I remember I struggled some to get it working because I missed the validation against the datapattern. You can read about that here.

HTH Nicklas

share|improve this answer
    
Nicklas: Thanks for the reply... I think I have the MAP and MAPSCRIPT files set up correctly.... My problem is with openlayers... I don't know how to setup/define the vector layer. I looked at the various openlayers examples but could get any to work for me... Are there any openlayers examples that uses mapserver I can review?? –  Chris Dec 12 '10 at 23:36
    
@Chris: did you solve this problem. I am struggeling with the same issue in OpenLayers. –  Stefan Jan 14 '13 at 11:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.