Module: CocinaDisplay::Geospatial::DecimalParser::Helpers

Defined in:
lib/cocina_display/geospatial.rb

Instance Method Summary collapse

Instance Method Details

#normalize_coord(coord_str) ⇒ String

Note:

The hemisphere can either lead or trail the degrees.

Convert hemispheres to plus/minus signs for parsing.

Parameters:

  • coord_str (String)

Returns:

  • (String)


360
361
362
# File 'lib/cocina_display/geospatial.rb', line 360

def normalize_coord(coord_str)
  hemisphere_first(coord_str).tr("EN", "+").tr("WS", "-")
end