Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limits are not identical for all features #20

Open
melvyn-sopacua opened this issue May 22, 2017 · 0 comments
Open

Limits are not identical for all features #20

melvyn-sopacua opened this issue May 22, 2017 · 0 comments

Comments

@melvyn-sopacua
Copy link
Contributor

(This may be an issue with bag:woonplaats itself, as it's the only MultiPolygon)

There are a number of things concerning limits:

  1. ogr2ogr ignores them and strips them from the WFS url. I have not found a way to set a count and start index with arguments to ogr2ogr.
  2. feature count property and actual feature count differ
  3. The number of features provided for bag:woonplaats is 1000

Observe:

>>> with open('woonplaats.json.bak', 'rt') as f:
...     res = json.load(f)
...
>>> res.keys()
dict_keys(['features', 'type', 'crs', 'totalFeatures'])
>>> res.get('totalFeatures')
2501
>>> type(res.get('features'))
<class 'list'>
>>> len(res.get('features'))
1000
>>> feats = res.get('features')
>>> for feat in feats:
...     if feat['properties']['woonplaats'] == 'Amsterdam':
...         print(feat['properties']['identificatie'])
...
>>>

Not using ogr2ogr, we fetch in batches of 500:

#!/bin/sh
count=500
start=0
basedir=`dirname $0`
base_url='http://geodata.nationaalgeoregister.nl/bag/wfs?service=WFS&version=2.0.0&request=GetFeature&typename=bag:woonplaats&outputformat=json'
max=2600

while [ ${start} -lt ${max} ]
do
        url="${base_url}&startindex=${start}&count=${count}"
        curl --silent -o ${basedir}/${start}.json "${url}"
        start=$((${start} + ${count}))
done

Result:

% grep -rl Amsterdam test/*.json
test/1000.json
test/2000.json

So, in the geoserver software the disconnect between featureCount and actual features delivered needs to be fixed, but docs should warn about this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant