Skip to main content
Question

Count features with API


jelle
Contributor
Forum|alt.badge.img+16
  • Contributor

Hi,

before actually reading the features from an API, I need to count the number of features that will enter. Based on the number, I need to split the search envelope into smaller pieces.

When using the HTTPCaller, I use following URL:

https://geo.onroerenderfgoed.be/geoserver/vioe_geoportaal/wfs?request=GetFeature&version;=1.1.0&resultType;=hits&typeName;=beschermde_archeologische_zones

However, I don't see a way to use a clipping envelope here.

When using the FeatureReader, WFS flavour, it is easy to use the clipping envelope, but I do not see how to enter the parameter resultType=hits.

A possible workaround is to set a Max number of features in the FeatureReader. When that number is achieved, go through a loop until it is lower. However, that means that you actually have to download all the objects and it takes more time.

My preferred solution would be a way to use a search envelope in the HTTPCaller. Any suggestions on how to achieve this?

5 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • November 8, 2016

Hoi @jelle, I see only 30 features in the beschermde_archeologische_zones feature type and that the service countdefault is set to 20000 features so you can easly request all the features and then spatially relate them to your areas.


jelle
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • November 8, 2016
itay wrote:

Hoi @jelle, I see only 30 features in the beschermde_archeologische_zones feature type and that the service countdefault is set to 20000 features so you can easly request all the features and then spatially relate them to your areas.

some layers contain more than 10K objects and then it starts taking time. This was just one of the layers to be read.

 

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • November 8, 2016
jelle wrote:
some layers contain more than 10K objects and then it starts taking time. This was just one of the layers to be read.

 

 

Then I would use the 2.0.0 version with responce paging to request the features but I doubt if that will sped up things, its usually the onderlaying server/database that is the bottleneck.

 

 

 


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • November 8, 2016

jelle
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • November 8, 2016

That works. Thanks Mark!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings