I've got another question regarding performance.
I've posted this on the OpenLayers users mailing list as well, but I'm not
certain if it is a setting in OL or in GeoServer.
I use GeoServer and PostGIS and OpenLayers to show the data.
For one page I'm using a WFS layer and I filter on address.
The user first need to select an address. This is done with an AJAX call
and the adresID and the location (X, Y) are returned.
I zoom to that location and change my filter.
This is my initial set-up of my layer, an addressID of -1 doesn't exists so
it starts with just the baselayer:
var myLayer = new OpenLayers.Layer.Vector("tmp", {
displayInLayerSwitcher: true, strategies: [new
OpenLayers.Strategy.BBOX()], filter: new
OpenLayers.Filter.Comparison({ type:
OpenLayers.Filter.Comparison.EQUAL_TO, property: "_adresid",
value: "-1"}), styleMap: new OpenLayers.StyleMap(),
protocol: new OpenLayers.Protocol.WFS({ url: ".../wfs",
featureType: "myName", srsName: "EPSG:3857", geometryName:
"geomgoogle" })});
And this is the method I call after the user selects an address:
function changeFilter(newValue, x, y){ myLayer.destroyFeatures();
filter = new OpenLayers.Filter.Logical({ type:
OpenLayers.Filter.Logical.AND, filters: [ new
OpenLayers.Filter.Comparison({ type:
OpenLayers.Filter.Comparison.EQUAL_TO, property: "_adresid",
value: newValue }), new
OpenLayers.Filter.Spatial({ type:
OpenLayers.Filter.Spatial.BBOX, value: new
OpenLayers.Bounds(x-50, y-50, x+50, y+50), projection:
"EPSG:3857" }) ] }); myLayer.filter = filter;
myLayer.refresh({force: true});
showAttributes();
}
This is working great, but is does take a very long time: about 7-10
seconds.
The result are just a few features: 3-10
Of course I have an index in the database on _adresid and a spatial index.
What else can I do to speed up this filter?
Thanks,
Paul
--
Organizing the International Open Source GIS conference 2012 in The
Netherlands:
http://www.mapwindow.org/conference/2012/
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users