[OpenLayers-Users] How efficient is OpenLayers. Filter. Spatial?

Andreas Hocevar ahocevar at opengeo.org
Thu Aug 11 05:15:19 EDT 2011


Spatial filtering in GeoServer is as efficient as in PostGIS, because it adds the spatial constraint as where clause to the query it sends to the backend. Look at this example: http://openlayers.org/dev/examples/wfs-states.html

Draw a polygon, and you'll instantly see a filtered view of the original data set, with only the fetures that intersect the polygon you've drawn.

Andreas.

On Aug 11, 2011, at 08:21 , Dave Potts wrote:

> 
> I have a data set of about 50-70 data points held in a Postgis database,
> its served to my Openlayers application via a WFS service implemented by a
> geoserver3 war file, running under tomcat.
> 
> I don't want to display all of these data points, only those defined by a
> boundary of a geometry object.
> 
> I can implement this filter by using Postgis to change the source data,
> declare a view on the table and use that as a data source in Geoserver, or
> implement a  OpenLayers.Filter.Spatial in my Openlayers application.
> 
> Q. Which is the most efficient ?
> 
> I suspect that using the database which is designed to process data would
> be best option, rather using the Openlayers filter which would require
> downloading all the vector data to the users browser and removing the
> extra data points in the context of the users browser.
> 
> I am just wondering if there is any reason why I should choose the
> Openlayers filter option, as the only the BBOX, DWithin and Intersects
> filters are currently implemented (see
> http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Filter/Spatial-js.html)
> 
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list