Bug #1718


spatial search does not work

Added by Matt Jones over 18 years ago. Updated about 18 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


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

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,

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

Related issues

Is duplicate of Metacat - Bug #1703: spatial search does not workResolvedSaurabh Garg09/28/2004

Actions #1

Updated by Saurabh Garg about 18 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.

Actions #2

Updated by Saurabh Garg about 18 years ago

  • Bug 1703 has been marked as a duplicate of this bug. ***
Actions #3

Updated by Saurabh Garg about 18 years ago

Fixed spatial search by adding nodedatanumerical column in the xml_nodes table.

Actions #4

Updated by Saurabh Garg about 18 years ago

Closing the bug. Working fine so far.

Actions #5

Updated by Matt Jones about 18 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?

Actions #6

Updated by Saurabh Garg about 18 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
in it. Almost all documents on my machine are eml-2.0.1

Actions #7

Updated by Redmine Admin almost 10 years ago

Original Bugzilla ID was 1718


Also available in: Atom PDF