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.


80
81
82
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 80

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.


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

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.


98
99
100
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 98

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.


106
107
108
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 106

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.


116
117
118
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 116

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.


125
126
127
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 125

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.


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

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.


140
141
142
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 140

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.


148
149
150
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 148

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.


158
159
160
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 158

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.


166
167
168
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 166

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.


175
176
177
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 175

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.


182
183
184
# File 'lib/rgeo/coord_sys/cs/factories.rb', line 182

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