Hi all,
Is it possible to prevent WFS data from being loaded at a certain zoom level or by putting a cap on the number of features or something similar? The problem is with WMS I can set all the zoom layering up so that at close zoom levels detailed mapping is used and at distant levels we use much simpler mapping but with WFS if the user requests the entire map area then Geoserver will query Oracle for the entire table and convert it all to XML before sending it to the client app which if we get that far will be overwhelmed by the amount of data. In our base tables the features can be counted in millions and I don’t want users inadvertently selecting the whole layer in one go as it will consume the server’s resources very quickly.
I’m thinking of setting the users up with WMS as the primary mapping layer and getting them to switch the WFS layers on only when they have zoomed in on the area they want but that doesn’t prevent accidents happening.
Any ideas?
Tom
Tom (JDi Solutions) ha scritto:
Hi all,
Is it possible to prevent WFS data from being loaded at a certain zoom level or by putting a cap on the number of features or something similar?
Yes, you can put a cap to the features with a hard limit configured
in the WFS service configuration panel. That will apply to whatever
request you make
The problem is with WMS I can set all the zoom layering up so that at close zoom levels detailed mapping is used and at distant levels we use much simpler mapping but with WFS if the user requests the entire map area then Geoserver will query Oracle for the entire table and convert it all to XML before sending it to the client app which if we get that far will be overwhelmed by the amount of data.
This should not be. GeoServer streams features out to the client
without loading everything into memory... afaik the jdbc driver will load 200 features at a time and these will be encoded and sent to
the client (the encoding part is still convinced that it's loading
one feature at a time, it's the jdbc driver that does the magic).
Cheers
Andrea
On 8/17/07, Andrea Aime <aaime@anonymised.com> wrote:
Tom (JDi Solutions) ha scritto:
Hi all,
Is it possible to prevent WFS data from being loaded at a certain zoom
level or by putting a cap on the number of features or something
similar?
Yes, you can put a cap to the features with a hard limit configured
in the WFS service configuration panel. That will apply to whatever
request you make
Do you mean the one in config->server?
Does that affect WMS too?
The problem is with WMS I can set all the zoom layering up so
that at close zoom levels detailed mapping is used and at distant levels
we use much simpler mapping but with WFS if the user requests the entire
map area then Geoserver will query Oracle for the entire table and
convert it all to XML before sending it to the client app which if we
get that far will be overwhelmed by the amount of data.
This should not be. GeoServer streams features out to the client
without loading everything into memory… afaik the jdbc driver will
load 200 features at a time and these will be encoded and sent to
the client (the encoding part is still convinced that it’s loading
one feature at a time, it’s the jdbc driver that does the magic).
Even if it does do them 200 at a time it will still do the whole table, the client will never tell it to stop if the user goes to look at something else?
Cheers
Andrea
Tom (JDi Solutions) ha scritto:
On 8/17/07, *Andrea Aime* <aaime@anonymised.com <mailto:aaime@anonymised.com>> wrote:
Tom (JDi Solutions) ha scritto:
> Hi all,
>
> Is it possible to prevent WFS data from being loaded at a certain
zoom
> level or by putting a cap on the number of features or something
> similar?
Yes, you can put a cap to the features with a hard limit configured
in the WFS service configuration panel. That will apply to whatever
request you make
Do you mean the one in config->server?
Does that affect WMS too?
Ah, you're right, it's config/server, but in fact it affects only
WFS. We should move it...
Even if it does do them 200 at a time it will still do the whole table, the client will never tell it to stop if the user goes to look at something else?
Yes, of course. I was just pointing out that GeoServer does not load
everything into memory 
With the above setting GeoServer will stop streaming when it reaches
the maximum feature count.
Cheers
Andrea
Excellent, thanks, that’s just what I need.
On 8/17/07, Andrea Aime <aaime@anonymised.com> wrote:
Tom (JDi Solutions) ha scritto:
On 8/17/07, Andrea Aime < aaime@anonymised.com
mailto:[aaime@anonymised.com](mailto:aaime@anonymised.com)> wrote:
Tom (JDi Solutions) ha scritto:
Hi all,
Is it possible to prevent WFS data from being loaded at a certain
zoom
level or by putting a cap on the number of features or something
similar?
Yes, you can put a cap to the features with a hard limit configured
in the WFS service configuration panel. That will apply to whatever
request you make
Do you mean the one in config->server?
Does that affect WMS too?
Ah, you’re right, it’s config/server, but in fact it affects only
WFS. We should move it…
Even if it does do them 200 at a time it will still do the whole table,
the client will never tell it to stop if the user goes to look at
something else?
Yes, of course. I was just pointing out that GeoServer does not load
everything into memory 
With the above setting GeoServer will stop streaming when it reaches
the maximum feature count.
Cheers
Andrea