Method: RGeo::Geographic::Factory#project

Defined in:
lib/rgeo/geographic/factory.rb

#project(geometry) ⇒ Object

Projects the given geometry into the projected coordinate space, and returns the projected geometry. Returns nil if this factory does not support a projection. Raises Error::InvalidGeometry if the given geometry is not of this factory.



227
228
229
230
231
# File 'lib/rgeo/geographic/factory.rb', line 227

def project(geometry)
  return unless @projector && geometry
  raise Error::InvalidGeometry, "Wrong geometry type" unless geometry.factory == self
  @projector.project(geometry)
end