Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not able to use the featureID parameter in a WFS URL request for my dataset on GeoServer.


The above URL returns ONE feature because i have appended the &featureID=tasmania_roads.2

The featureID paramter works great with the topp:tasmania_roads dataset on the geoserver and on my geoserver as well.

Howerver, It does NOT work on the layer I have published. And I cannot see any differences. My geoserver is internal so I regret that I cannot provide a URL. But this is how i'm constructing my URL (same way I did for tasmania_roads):

From the GetCapabilities:

<FeatureType xmlns:catalog="">

From the GetFeature:

  <catalog:myData gml:id="myData.fid--57bd457b_134ae684781_8989">

So based on the above information my url should be:

But I get ZERO results.

I tried URLencoding, republishing and different namespace/feature type naming configurations, with no luck.

I'm thinking there must be a setting on GeoServer when publishing the dataset that I'm overlooking?

share|improve this question
what is your data store? If it doesn't have a primary key then the features get a new fid with each request. – iant Apr 7 '12 at 15:13
@iant My data store is a postgis view. As you mention, that's probably why geoserver doesn't pick up the primary key. Thanks for the info, it supports what unicoletti says and I'm pretty confident that's the issue. (+1) – CaptDragon Apr 7 '12 at 18:18
up vote 8 down vote accepted

Your feature ID looks suspiciously random as in randomly generated by Geoserver. The reason for that is that Geoserver (GeoTools actually) cannot pick a unique identifier from the datastore.

This document, though vague, explains what GeoTools consider a fid:

Solution: if you are using postgis define a Primary Key (though I have not tried, you could get the same result with a unique index) on the table and recreate the layer.

On shapefiles this should not be necessary because GeoServer will use the position of the feature in the shapefile.

share|improve this answer
I see, that makes sense. I am pointing my layer to a postgis view. That's probably why geoserver doesn't pick up the primary key? I'm going to run some tests on Monday. (+1) – CaptDragon Apr 7 '12 at 18:15
Do you know if I'm able to use a FILTER to get that one row by the randomly generated ID? Or will i have the same problem as with featureID parameter? – CaptDragon Apr 7 '12 at 18:26
Not for sure, but in principle it should not work. You could work around by adding an ID or FID column to the view and then filter on that. – unicoletti Apr 7 '12 at 21:12
I see, Many Thanks! – CaptDragon Apr 8 '12 at 1:02

Your Answer


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.