Question: We are writing a application in which a part of the job is to fetch a relatively large (>10000 features) and often updated dataset from a WFS server, store a local copy, and do geospatial analyses on it. We are stuck on the downloading part, as we hit the default 1000 features limit on the server side, which we do not control.

We see that QGIS for example can access this dataset completely, from which we can in principle manually save it in a suitable format for our application, but this is not the desirable way to go, as we want a completely automatic procedure. 

We are using OGR (ogr2ogr) and can get local copies of up to 1000 features. We wonder if there is an easy way to get the entire dataset using this approach. Hints to other approaches are also welcome.

Answer: 
The easiest way to do this, is to use GDAL's ogr2ogr utility.

Firstly, you need to create an XML file with the URL to the WFS endpoint.

```
<OGRWFSDataSource>
  <URL>http://demo.opengeo.org/geoserver/ows?service=wfs&amp;typeName=osm:roads</URL>
  <PagingAllowed>ON</PagingAllowed>
</OGRWFSDataSource>  

```

If you want to add any other parameter, like a filter, you can add it to the url as well. Just remember to make sure that the URL is XML escaped

Then you can just run ogr2ogr, with a command like this:

`ogr2ogr -f "SQLite" roads.db road.xml`

If you want to write to a shapefile, you can use a command like: 

`ogr2ogr roads road.xml`

You can get more details about the optional parameters here: [WFS driver](http://www.gdal.org/drv_wfs.html)
You could try the OGR WFS option "-dsco OGR\_WFS\_PAGING\_ALLOWED=ON" as described in the docs <http://www.gdal.org/drv_wfs.html>