Opened 13 years ago

Closed 10 years ago

Last modified 10 years ago

#146 closed enhancement (fixed)

Adjust longitude behavior in Location

Reported by: Peter Powers Owned by: Peter Powers
Priority: major Milestone: OpenSHA 1.4
Component: sha Version:
Keywords: Cc: emartinez

Description

Currently, Location longitudes are required to be between ±180. This is generally ok as there is very little continent, and hence hazard of concern, crossing the int'l date line. However the Aleutians do cross it and the NSHMP Alaska grid extends to 200 (or -160). This needs to be addressed because geometric operations on regions are essential (e.g. contains()). Possible solutions:

  • Conversion of values in individual applications based on some user preference
  • Split regions that cross ±180 in two
  • Adopt a garbage in garbage out policy. Allow longitude values between -180 and 360 and assume user/programmer knows what they're doing.

The 3rd is the simplest to implement and would come with the caveats that a user use the correct distance calculation algorithms if they are going to mix and match.

Comments?

Change History (5)

comment:1 Changed 13 years ago by Peter Powers

See related: #25

comment:2 Changed 13 years ago by Peter Powers

Milestone: OpenSHA 1.2OpenSHA 1.3

I favor the third option [users should know what they're doing]. I believe such a modification will have little impact, but junit tests of the various Location algorithms should be implemented comparing results of Locations in the 180:360 range to similarly arrayed Locations in the -180:0 range.

comment:3 Changed 10 years ago by Kevin Milner

Milestone: OpenSHA 1.3OpenSHA 1.4

Still needs to be addressed, but not during UCERF3 dev. Punt to 1.4

comment:4 Changed 10 years ago by Peter Powers

Resolution: fixed
Status: newclosed

Increased maximum longitude to 360 so Locations may now be defined on interval -180 to +360; buyer beware; Locations Utils docs updated as well as unit tests to confirm calcs with negative lons produce same result as those in positive reference frame. Looking at the distance calculations and doing some rudimentary tests, I don't foresee any problems.

comment:5 Changed 10 years ago by Peter Powers

fixed in #10690

Note: See TracTickets for help on using tickets.