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.

I need to select from a layer(s) and I am wondering what way I should serve the layer.

The requirements are that I need to be able to select multiple features at a time by drawing a box or polygon. They should become highlighted and I should display the data for all the features. I don't need to do any editing of them.

I'm using geoserver and openlayers

share|improve this question
    
Were you able to execute this application? I wanted to know how can it be implemented? –  Sam007 Jun 7 '12 at 21:17
add comment

2 Answers

up vote 8 down vote accepted

It sounds like you want to store the vectors in the browser, and query them client side. To do that, you'll need to use WFS.

One caveat, though, is that browsers have limitations on how many vectors they can display at one time. If you're dealing with large or complicated data sets, it may be that your only option will be to use WMS. That would be more complicated to implement, though, because the queries would then have to be done server side.

share|improve this answer
7  
actually OpenLayers has no limit on the number of features it can display, browsers have limits on the number of features they can display. –  iant Jul 28 '11 at 8:43
2  
The maximum number of features will not only depend on the web browser, but also on the client computer features like the processor or RAM memory. Given that, you, the developer, do not know what client computer will run 'your' OpenLayers based map viewer, being conservative when estimating this limit is advisable. –  dariapra Jul 28 '11 at 9:53
1  
I'm thinking WMS would serve his purpose quiet nicely. Keep the complicated processing at the server side (if possible), and result rendering at the client side. You'll have better performance, and you can still use scripted filters like Intersections, Contains, Within etc. Have a look at geoserver. –  OptimizePrime Jul 28 '11 at 19:55
2  
I'd suggest you commit to either paradigm. 1. Client Retrieves the data and processes/queries it accordingly, server only serves data (WFS). 2. Client takes care of rendering only, server performs processing/query tasks and delivers the result (WMS). Both have pro's and con's, but do not muddy the process and download the data (WFS) and get the server to also do the processing/queries. This creates unnecessary overhead and complicates the situation –  OptimizePrime Jul 28 '11 at 19:59
    
@iant: I understand that openlayers doesn't have a limit on the number of features it can display. I think we can both agree that it has limitations, though ;) –  canisrufus Jul 28 '11 at 19:59
show 2 more comments

If you are already have visual data such as a basemap and just need to select features the WFS would work very well for that. Although, if you need a visual component to go along with your selection, you would be better served by a WMS service, since it was created for that.

Although hearing your use-case as you described it, I would personally would just use a WMS service.

Also, the GeoServer Blog as a great write-up on the two services and when you should should leverage them.

Edit: On an additional note if you are doing anything other than simply querying the feature data, I as a general rule just use WFS, it excels when it comes to data manipulation in comparison to the other OGC services I have used lately. Also, take that with a grain of salt, that is just what I had experienced in my use of the services, which is why I have attached the preceding and following links.

OGC Standards:
WMS
WFS

share|improve this answer
    
+1 for the link about when to leverage the service types. –  OptimizePrime Jul 28 '11 at 20:00
    
I think there is a typo. Your second occurrence of "WFS" seems like it should read "WMS". –  canisrufus Jul 28 '11 at 20:17
    
Thanks, what happened was that I had edited to fix sentence flow, and then I believe that I had accidentally changed what I had originally meant to say. –  dkroy Jul 29 '11 at 4:46
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.