1

I'm trying to use an OGC web feature service in some software I am involved in developing. The service is described at the bottom of this page: https://hazards.fema.gov/femaportal/wps/portal/NFHLWMS

The problem I am having is that sometimes this service works and I am able to download data and other times I get an error when trying to download data.

Here is an example:

When I type the following web address into a browser, the web service returns a GML file with some valid data that can be read into any application that supports reading GML files (this example is on the above web page; I have made a slight variation to get it to work):

https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=public_NFHL:Flood_Hazard_Zones&BBOX=-121.5,41,-121.375,41.125,urn:ogc:def:crs:EPSG:6.9:4269&MAXFEATURES=1000

However, when I use the following web address, I get an http 400 error:

https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=public_NFHL:Flood_Hazard_Zones&BBOX=-78.5525055812731,35.7676915216378,-78.5339446948894,35.7768315700909,urn:ogc:def:crs:EPSG:6.9:4269&MAXFEATURES=1000

Everything is the same in both addresses, but the second one has different "BBOX" or bounding box coordinates. Both should have valid flood hazard zone data. Do you know why the second request returns the HTTP error code? Is there a way to work around this problem?

3
  • My browser just hangs on the second URL. Could you try a smaller bounding box? It's pretty small now, but perhaps just as a test.
    – user1462
    Sep 4, 2018 at 21:02
  • I've tried smaller areas such as this with the same result: hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/… I know that different areas such as the one described above work fine. This particular area has problems though. It used to work (2 months ago). I think it could be because FEMA has somehow limited the amount of data that can be downloaded and this area has a large polygon.
    – Burrow
    Sep 5, 2018 at 3:05
  • This still doesn't work with the FEMA WFS server as described above, but the URLs above were incorrect (the first one was working before though) and I updated them. The Lat/Lon coordinates for the BBOX parameter were in the wrong order.
    – Burrow
    Sep 19, 2018 at 20:18

2 Answers 2

1

It seems that this service struggles with large(ish) requests. If you change your second request to maxFeatures=10 it returns correctly so there is no issue with the bounds or the request, it is just too big.

It may be worth contacting FEMA (though there is no contact information in the capabilities document) and suggesting they switch to a better server such as GeoServer or MapServer that could handle this data better.

2
  • thank you for this response. Lowering the maxFeatures works for me also. From my testing, it looks like the 26th feature requested gives me the http 400 error and times out. I think the likelihood of getting FEMA to convert from their ESRI server to GeoServer or MapServer is very low, but I'll contact them.
    – Burrow
    Sep 6, 2018 at 3:45
  • Alternatively you could ask for the data and serve it your self
    – Ian Turton
    Sep 6, 2018 at 7:26
1

You can determine the number of results by using resultType=hits& like:

https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=public_NFHL:Flood_Hazard_Zones&BBOX=-78.5525055812731,35.7676915216378,-78.5339446948894,35.7768315700909,urn:ogc:def:crs:EPSG:6.9:4269&resultType=hits&

Gives us 27

Then you can page through the results set using the count=& and startindex=& to get all the results.

So for the first 5 (five gives me results haven't tried a larger number)

https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=public_NFHL:Flood_Hazard_Zones&BBOX=-78.5525055812731,35.7676915216378,-78.5339446948894,35.7768315700909,urn:ogc:def:crs:EPSG:6.9:4269&STARTINDEX=1&count=5&

then next 5 ...

https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=public_NFHL:Flood_Hazard_Zones&BBOX=-78.5525055812731,35.7676915216378,-78.5339446948894,35.7768315700909,urn:ogc:def:crs:EPSG:6.9:4269&STARTINDEX=6&count=5&

then ...

1
  • This helped me figure out which feature gave me the http 400 error. It was feature #26. All the other ones seem to work. I wonder if there's a way to query which features won't work and to request everything besides the invalid features.
    – Burrow
    Sep 6, 2018 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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