Skip to main content
Question

Count features with API

  • November 8, 2016
  • 5 replies
  • 152 views

jelle
Contributor
Forum|alt.badge.img+23

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

itay
Supporter
Forum|alt.badge.img+19
  • 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+23
  • Author
  • Contributor
  • 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.

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+19
  • Supporter
  • November 8, 2016
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+59
  • Safer
  • November 8, 2016

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

That works. Thanks Mark!