Module: RGeo::CoordSys

Defined in:
lib/rgeo/coord_sys.rb,
lib/rgeo/coord_sys/cs/entities.rb,
lib/rgeo/coord_sys/cs/factories.rb,
lib/rgeo/coord_sys/cs/wkt_parser.rb,
lib/rgeo/coord_sys/srs_database/entry.rb,
lib/rgeo/coord_sys/srs_database/sr_org.rb,
lib/rgeo/coord_sys/srs_database/url_reader.rb

Overview

This module provides data structures and tools related to coordinate systems and coordinate transforms. It comprises the following parts:

RGeo::CoordSys::Proj4 is a wrapper around the proj4 library, which defines a commonly-used syntax for specifying geographic and projected coordinate systems, and performs coordinate transformations.

The RGeo::CoordSys::CS module contains an implementation of the CS (coordinate systems) package of the OGC Coordinate Transform spec. This includes classes for representing ellipsoids, datums, coordinate systems, and other related concepts, as well as a parser for the WKT format for specifying coordinate systems.

The RGeo::CoordSys::SRSDatabase module contains tools for accessing spatial reference databases, from which you can look up coordinate system specifications. You can access the spatial_ref_sys table provided with OGC-compliant spatial databases such as PostGIS, read the databases provided with the proj4 library, or access URLs such as those provided by spatialreference.org.

Defined Under Namespace

Modules: CS, SRSDatabase

Class Method Summary collapse

Class Method Details

.check!(key) ⇒ Object


44
45
46
# File 'lib/rgeo/coord_sys.rb', line 44

def self.check!(key)
  supported?(key) || raise(Error::UnsupportedOperation, "Coordinate system '#{key}' is not supported.")
end

.supported?(key) ⇒ Boolean

The only valid key is :proj4

Returns:

  • (Boolean)

Raises:


39
40
41
42
# File 'lib/rgeo/coord_sys.rb', line 39

def self.supported?(key)
  raise(Error::UnsupportedOperation, "Invalid key. The only valid key is :proj4.") unless key == :proj4
  defined?(RGeo::CoordSys::Proj4) && RGeo::CoordSys::Proj4.supported?
end