poissonconsulting / fwapgr

An R Client for BC Freshwater Atlas Web API
https://poissonconsulting.github.io/fwapgr
Other
8 stars 1 forks source link

Query more than 10000 rows? #65

Closed lukewarkentin closed 2 years ago

lukewarkentin commented 2 years ago

Hi there,

I was wondering if there was a way of querying more than 10000 rows at once? When I do:

fwa_query_collection('whse_basemapping.fwa_named_streams', limit=20000)

I get this error:

Error in err(): ! limit must be less than or equal to 10000, not 20000.

Is there a way to increase this limit? I want to use to make a large scale showing much of BC.

Thanks! Luke

smnorris commented 2 years ago

Max number of features in a response is set at 10k - you'll need to page through a collection, making several requests.

Note that features in fwa_named_streams are only slightly generalized. Another workaround if you want a map showing a big area would be to use 1:250k mapping or similar - check out https://github.com/bcgov/bcdata and https://github.com/bcgov/bcmaps

lukewarkentin commented 2 years ago

Thanks @smnorris for your fast response! Sounds like the 1:250k mapping could be a good bet.

Out of curiosity, how would I page through a collection using fwa_query_collection()? Would I use the offset argument?

smnorris commented 2 years ago

Yes, exactly. There are some examples here. https://github.com/poissonconsulting/fwapgr/issues/49 I am not sure if we have resolved a way to tell how many features are available though.

lukewarkentin commented 2 years ago

Okay thanks!