I have an OpenLayers 3 application. When using a box to select features from GeoServer WFS layer (request=GetFeature) I get inaccurate results see image below. The layer is served from a PostGIS DB. However I have the same data in a shapefile served via the same GeoServer and when I change to that layer I get only one feature selected in the same example like the picture below.
Any help here would be good as I am not sure where the problem is it seems to me that the problem is in PostGIS but not sure. Any idea even how to troubleshoot this further would help.
BTW. This happens randomly in many locations this is not the only problem spot. And it seems to happen more on as I zoom in closer.
The query passed to PostGIS looks like this:
WHERE "the_geom" && ST_GeomFromText('POLYGON (
Picture below shows that the query is not doing an intersection (which is what I expect) but rather an intersect with features' extents. The green BBOX selected those three yellow lines above it.
How do I change/fix this?
How do I get GeoServer to use ST_Intersects function?