Are there any methods to query several features by id other than one entry by a single url request?

The scenario is I store around 200 point layers in PostgreGIS. Each maintains 100k entries GPS points. My boss wants to let them "move" in the browser. Obviously it's impossible to query all entries at once. So I want to query like 1k entries for one layer in every query. So basically I want to query the features by their id, like "starID<=ID<=endID". But it seems like by WFS url query, it can only query one entry every time by the featureID=ID. I'm also thinking about using the ordinary Postgre other then PostgreGIS, but just in case there might be spatial queries in the future.

migrated from stackoverflow.com Oct 2 '12 at 14:26

This question came from our site for professional and enthusiast programmers.


As of version 1.0.0 of the WFS, specification the request GetCapabilities had an optional attribute named maxFeatures that allows limiting the number or returned features.

Another optional attribute GetCapibilities had was featureId, which allows giving the list of desired features, identified by its id.

As said before, these attributes are optional. Thus, if you are planning using any of them, check before that your WFS server implements them.

  • Yes, Ii use geoserver and it supports these two parameters. I know about the maxFeatures and featureId. For maxFeatures, the problem is after each query, the pointer keeps going. Say if I make a simple query without sorting, I get two sets of different points by using maxFeatures twice. And for featureID, I actually doesn't know the ids. My scenario is I try to load 5000 gps points one time and the total points are up to 100,000. – user1056824 Oct 5 '12 at 15:11

You can use a filter, where you provide the Query. This Answer will show you how to use a filter in the WFS query: https://gis.stackexchange.com/a/26298/442

The filter can be something like this:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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