Bug #1718
closedspatial search does not work
0%
Description
Spatial search is not working in metacat. This is probably because of casting
problems, where the nodedata column is being cast to a number to do the <
comparison. Looking at the metadata, it appears that the LAT/LONG values are
sometimes empty, and sometimes have leading spaces. These will not cast
correctly to numeric values.
The simplest fix is to simply eliminate all non-numeric values before doing the
comparisons.
A more complex (and possibly better) approach is to have separate nodevalue
tables for each data type we need to treat differently (e.g., String, Numeric,
Date).
To see some of the offending values in the data, try a SQL command like this:
select nodeid, nodedata from xml_nodes
where nodetype like 'TEXT'
and nodedata like ' %'
and parentnodeid in
(select nodeid from xml_nodes
where nodetype like 'ELEMENT'
and nodename IN ('eastBoundingCoordinate', 'westBoundingCoordinate',
'northBoundingCoordinate', 'southBoundingCoordinate'))
We really need for query performance to be improved for these more complex
searches, so we need to make some design decisions about the overall performace
issues.
Related issues
Updated by Saurabh Garg about 20 years ago
From bug 1703:
the spatial bounding box search dialog in morpho does not return any results
even when it should.
Also: The labels on the lat/long text boxes do not match up with the labels on
the xslt stylesheets for the web site. on the web site, the values are labeled
with directions (e.g. 'west') but then use negative values. the labels in
morpho just have a directional indicator but do not use negative values.
Updated by Saurabh Garg about 20 years ago
- Bug 1703 has been marked as a duplicate of this bug. ***
Updated by Saurabh Garg almost 20 years ago
Fixed spatial search by adding nodedatanumerical column in the xml_nodes table.
Updated by Saurabh Garg almost 20 years ago
Closing the bug. Working fine so far.
Updated by Matt Jones almost 20 years ago
Sid, can you explain why you think this works now? There have been several
demonstrations of it not working and/or being extremely slow. Maybe you didn't
replicate the data conditions that caused the error?
Updated by Saurabh Garg almost 20 years ago
Matt, I tried running it again and it runs fine for me.
Did you test against my metacat install? My machine is no longer running the
latest code because I was step by step testing the code that I have changed and
doing cvs checkins. So you can expect it to be slow.
If you didnt receive any results for a geographic query and you used Morpho to
run a geographic query, you might want to check if the query had
<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>
in it. Almost all documents on my machine are eml-2.0.1