Bug #2552
closed
Spatial query class to use geotools against the spatial cache
Added by Matthew Perry about 18 years ago.
Updated about 18 years ago.
Description
Currently the spatial query is run with a standard metacat squery. Besides being inefficient, it is also inaccurate since it doesn't take into account some fundamental quirks in spatial relationships (the international dateline, multiple polygons representing the same feature, odd shaped polygons or holes).
The idea would be to write a class that, given a spatial query (bbox or point) would use geotools to query the actual spatial cache and return a list of matching docids.
Added a edu.ucsb.nceas.metacat.spatial.SpatialQuery class to handle this. Given a spatial query (4 bounding cooordinates), it will return a Vector of matching docids. This is accomplished by using geotools to filter the spatial cache (both the polygon and point layers). This process is extremely quick. HOWEVER....
The MetacatServlet (action=spatial) currently takes this list of docids, transforms it into an squery using DocumentIdQuery and passes it to the squery handler. This is painfully slow since it is generating as many queryterms as there are matching docids. The current technique for mapping an squery to a sql query means there will be that many subselects as well.
This performance issue is beyond the scope of this bug, however, so we'll call this one closed.
Original Bugzilla ID was 2552
Also available in: Atom
PDF