Class: CocinaDisplay::Geospatial::DecimalCoordinateNormalizer

Inherits:
CoordinateNormalizer show all
Includes:
DecimalParser
Defined in:
lib/cocina_display/geospatial.rb

Overview

Note:

Degrees are limited to 3 digits so that packed DMS isn't read as decimal.

Normalizes decimal degree values, either signed or paired with a hemisphere.

Examples:

-121.24658

W126.04

Constant Summary collapse

PATTERN =
/\A[NESW+-]?\d{1,3}(?:\.\d+)?[NESW]?\z/

Class Method Summary collapse

Methods included from DecimalParser

included

Methods inherited from CoordinateNormalizer

hemisphere_first

Methods inherited from CoordinatesParser

supports?

Class Method Details

.normalize_coord(value) ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


458
459
460
# File 'lib/cocina_display/geospatial.rb', line 458

def self.normalize_coord(value)
  super(hemisphere_first(value))
end