Class: RGeo::CoordSys::CS::CoordinateSystemFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/rgeo/coord_sys/cs/factories.rb

Overview

A class implementing the CS_CoordinateSystemFactory interface. It provides methods for building up complex objects from simpler objects or values.

Note that the methods of CS_CoordinateSystemFactory do not provide facilities for setting the authority. If you need to set authority values, use the create methods for the object classes themselves.

Instance Method Summary collapse

Instance Method Details

#create_compound_coordinate_system(name_, head_, tail_) ⇒ Object

Create a CompoundCoordinateSystem from a name, and two constituent coordinate systems.



43
44
45
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 43

def create_compound_coordinate_system(name_, head_, tail_)
  CompoundCoordinateSystem.create(name_, head_, tail_)
end

#create_ellipsoid(name_, semi_major_axis_, semi_minor_axis_, linear_unit_) ⇒ Object

Create an Ellipsoid from a name, semi-major axis, and semi-minor axis. You can also provide a LinearUnit, but this is optional and may be set to nil.



51
52
53
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 51

def create_ellipsoid(name_, semi_major_axis_, semi_minor_axis_, linear_unit_)
  Ellipsoid.create_ellipsoid(name_, semi_major_axis_, semi_minor_axis_, linear_unit_)
end

#create_flattened_sphere(name_, semi_major_axis_, inverse_flattening_, linear_unit_) ⇒ Object

Create an Ellipsoid from a name, semi-major axis, and an inverse flattening factor. You can also provide a LinearUnit, but this is optional and may be set to nil.



59
60
61
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 59

def create_flattened_sphere(name_, semi_major_axis_, inverse_flattening_, linear_unit_)
  Ellipsoid.create_flattened_sphere(name_, semi_major_axis_, inverse_flattening_, linear_unit_)
end

#create_from_wkt(str_) ⇒ Object

Create any object given the OGC WKT format. Raises Error::ParseError if a syntax error is encounterred.



66
67
68
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 66

def create_from_wkt(str_)
  WKTParser.new(str_).parse
end

#create_geographic_coordinate_system(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_) ⇒ Object

Create a GeographicCoordinateSystem, given a name, an AngularUnit, a HorizontalDatum, a PrimeMeridian, and two AxisInfo objects. The AxisInfo objects are optional and may be set to nil.



75
76
77
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 75

def create_geographic_coordinate_system(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_)
  GeographicCoordinateSystem.create(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_)
end

#create_horizontal_datum(name_, horizontal_datum_type_, ellipsoid_, to_wgs84_) ⇒ Object

Create a HorizontalDatum given a name, a horizontal datum type code, an Ellipsoid, and a WGS84ConversionInfo. The WGS84ConversionInfo is optional and may be set to nil.



83
84
85
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 83

def create_horizontal_datum(name_, horizontal_datum_type_, ellipsoid_, to_wgs84_)
  HorizontalDatum.create(name_, horizontal_datum_type_, ellipsoid_, to_wgs84_)
end

#create_local_coordinate_system(name_, datum_, unit_, axes_) ⇒ Object

Create a LocalCoordinateSystem given a name, a LocalDatum, a Unit, and an array of at least one AxisInfo.



90
91
92
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 90

def create_local_coordinate_system(name_, datum_, unit_, axes_)
  LocalCoordinateSystem.create(name_, datum_, unit_, axes_)
end

#create_local_datum(_name_, local_datum_type_) ⇒ Object

Create a LocalDatum given a name and a local datum type code.



96
97
98
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 96

def create_local_datum(_name_, local_datum_type_)
  LocalDatum.create(name, local_datum_type_)
end

#create_prime_meridian(_name_, angular_unit_, longitude_) ⇒ Object

Create a PrimeMeridian given a name, an AngularUnit, and a longitude offset.



103
104
105
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 103

def create_prime_meridian(_name_, angular_unit_, longitude_)
  PrimeMeridian.create(name, angular_unit_, longitude_)
end

#create_projected_coordinate_system(name_, gcs_, projection_, linear_unit_, axis0_, axis1_) ⇒ Object

Create a ProjectedCoordinateSystem given a name, a GeographicCoordinateSystem, and Projection, a LinearUnit, and two AxisInfo objects. The AxisInfo objects are optional and may be set to nil.



112
113
114
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 112

def create_projected_coordinate_system(name_, gcs_, projection_, linear_unit_, axis0_, axis1_)
  ProjectedCoordinateSystem.create(name_, gcs_, projection_, linear_unit_, axis0_, axis1_)
end

#create_projection(name_, wkt_projection_class_, parameters_) ⇒ Object

Create a Projection given a name, a projection class, and an array of ProjectionParameter.



119
120
121
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 119

def create_projection(name_, wkt_projection_class_, parameters_)
  Projection.create(name_, wkt_projection_class_, parameters_)
end

#create_vertical_coordinate_system(name_, vertical_datum_, vertical_unit_, axis_) ⇒ Object

Create a VerticalCoordinateSystem given a name, a VerticalDatum, a VerticalUnit, and an AxisInfo. The AxisInfo is optional and may be nil.



127
128
129
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 127

def create_vertical_coordinate_system(name_, vertical_datum_, vertical_unit_, axis_)
  VerticalCoordinateSystem.create(name_, vertical_datum_, vertical_unit_, axis_)
end

#create_vertical_datum(name_, vertical_datum_type_) ⇒ Object

Create a VerticalDatum given a name ane a datum type code.



133
134
135
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 133

def create_vertical_datum(name_, vertical_datum_type_)
  VerticalDatum.create(name_, vertical_datum_type_)
end