[dhi-servers] box area across date line

Philip Crotwell crotwell at seis.sc.edu
Thu Feb 1 12:48:03 PST 2007


Hi

We discovered that there is a problem with box area and crossing the  
date line. Basically, a query with lon range of 170 to -170  
(equivalently 170 to 190), which should get events from either side  
of the 180 lon line only returns events between 170 and 180 and not  
those on the other side of 180.

This seems to also be a problem with seimiquery, except that 170 to  
-170 in seismiquery returns no events at all, while 170 to 190 only  
returns events from 170 to 180.

I suspect that the SQL being used is just
lon >= min_lon AND lon <= max_lon

A better logic to accomodate boxes that cross the date line is
(min_lon <= max_lon AND min_lon <= lon AND lon <= max_lon) OR
(min_lon > max_lon AND (min_lon <= lon OR lon <= max_lon))

This way, if you specify (-170 to 170) and you have an event at lon  
-175 or 175, both match. The big difference is the OR in the second  
query.

Would it be possible to update the logic in both the event finder and  
the location code in the networkAccess and networkExplorer to do  
this? Might also want to do the same to seismiquery.

I have opened a jira issue to track this:
http://www.iris.edu/jira/browse/DHI-25

thanks,
Philip


More information about the dhi-servers mailing list