[Geoserver-users] Tiles for Large Number of Features - Need Advice

I am using GeoServer and the embedded GWC (along with gmaps service) to create tiles (both pre-seeded and dynamic) for a large number of features for a Google Maps tiled overlay.

I have about 175,000 point features over a small regional area, approximately 250,000 km^2 in area.

My data are in postgis/postgres and my layer is configured as a SQL view.

When zoomed in significantly, I need to display all of the point data at the zoom level … but when zoomed out (larger scales), I am fine only showing a representative subset of the data, not all point features.

I can and have setup an SLD that makes sure my features drawn don’t overlap. However, throwing 175,000 points at that SLD obviously takes GeoServer a very long time to sort through.

So, my question is, what is the best method for preventing GeoServer from having to deal with that many points at lower numbered zoom levels (say 0 through 12)?

Is there anything I can do in the SLD so that not so many points are returned … so that GeoServer just ignores a certain number of points at certain zoom levels and doesn’t even have to deal with them (as far as overlaps, label overlaps, etc.)?

I know I can filter by scale denominator in the SLD, but wouldn’t GeoServer still have to deal with all 175,000 points coming back from the database?

Ideally, I would like to be able to alter my SQL view based on the scale denominator, but some previous discussions I have read say there is no way to get the scale denominator into the SQL view (http://osgeo-org.1560.x6.nabble.com/SQL-View-Layer-Parameters-td5027513.html).

My request here is similar to that in http://gis.stackexchange.com/questions/42710/geoserver-show-random-subset-of-features
but as I am using zoom levels basically 2 through 18, the solution presented there (separate layers for each zoom level) is extremely inefficient.

Any and all advice appreciated.

Thanks,

Mike Grogan

On Mon, Oct 28, 2013 at 10:32 PM, Mike Grogan <d.michael.grogan@anonymised.com>wrote:

I am using GeoServer and the embedded GWC (along with gmaps service) to
create tiles (both pre-seeded and dynamic) for a large number of features
for a Google Maps tiled overlay.

I have about 175,000 point features over a small regional area,
approximately 250,000 km^2 in area.

My data are in postgis/postgres and my layer is configured as a SQL view.

When zoomed in significantly, I need to display all of the point data at
the zoom level ... but when zoomed out (larger scales), I am fine only
showing a representative subset of the data, not all point features.

I can and have setup an SLD that makes sure my features drawn don't
overlap. However, throwing 175,000 points at that SLD obviously takes
GeoServer a very long time to sort through.

So, my question is, what is the best method for preventing GeoServer from
having to deal with that many points at lower numbered zoom levels (say 0
through 12)?

Is there anything I can do in the SLD so that not so many points are
returned ... so that GeoServer just ignores a certain number of points at
certain zoom levels and doesn't even have to deal with them (as far as
overlaps, label overlaps, etc.)?

I know I can filter by scale denominator in the SLD, but wouldn't
GeoServer still have to deal with all 175,000 points coming back from the
database?

There is a rendering transformation called point stacker that you can use
to summarize the points, the developer did not document it in the official
manual, but you
can find an example here:
http://suite.opengeo.org/docs/cartography/rt/pointstacker.html

Ideally, I would like to be able to alter my SQL view based on the scale
denominator, but some previous discussions I have read say there is no way
to get the scale denominator into the SQL view (
http://osgeo-org.1560.x6.nabble.com/SQL-View-Layer-Parameters-td5027513.html
).

Not without modifying the code. Not the same thing as impossible, just
needs some work :-p

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

I’m assuming you’re referring to purely server side (GeoServer). But how about “cheating” and doing it as a mix of Server side and client side?

If you set up your SQL view to accept a parameter for scale threshold / resolution, and then send the current scale / resolution to it from the javascript OpenLayers client. That way the WMS request will include the current scale, and this can be used in the SQL View.

Conceptually that seems like it should work.

Cheers,
Jonathan

Ideally, I would like to be able to alter my SQL view based on the scale denominator, but some previous discussions I have read say there is no way to get the scale denominator into the SQL view (http://osgeo-org.1560.x6.nabble.com/SQL-View-Layer-Parameters-td5027513.html).

Not without modifying the code. Not the same thing as impossible, just needs some work :-p