Class: CocinaDisplay::Geospatial::CoordinateNormalizer
- Inherits:
-
CoordinatesParser
- Object
- CoordinatesParser
- CocinaDisplay::Geospatial::CoordinateNormalizer
- Defined in:
- lib/cocina_display/geospatial.rb
Overview
Base class for normalizers that standardize a single coordinate value, as found in Cocina structured values, so that Geo::Coord can parse it. Subclasses define a PATTERN and mix in a parser module for normalize_coord.
Direct Known Subclasses
Constant Summary
Constants inherited from CoordinatesParser
CocinaDisplay::Geospatial::CoordinatesParser::PATTERN
Class Method Summary collapse
-
.hemisphere_first(value) ⇒ String
Move a trailing hemisphere letter to the front, since that is where the parser normalizers expect it.
Methods inherited from CoordinatesParser
Class Method Details
.hemisphere_first(value) ⇒ String
Move a trailing hemisphere letter to the front, since that is where the parser normalizers expect it.
426 427 428 |
# File 'lib/cocina_display/geospatial.rb', line 426 def self.hemisphere_first(value) value.sub(/\A(.+?)([NESW])\z/, '\2\1') end |