module OGR::Geometry::EWKBIOExtensions

Extends OGR::Geometry with methods that allow creating a Geometry from EKWB or outputting a Geometry as EWKB (EWKB is the WKB format that PostGIS uses).

Public Class Methods

included(base) click to toggle source
# File lib/ogr/extensions/geometry/ewkb_io_extensions.rb, line 29
def self.included(base)
  base.extend(ClassMethods)
end

Public Instance Methods

to_ewkb() click to toggle source

@return [String] Binary string representative of EWKB.

# File lib/ogr/extensions/geometry/ewkb_io_extensions.rb, line 34
def to_ewkb
  wkb_record = WKBRecord.read(to_wkb)
  srid = spatial_reference ? spatial_reference.authority_code.to_i : 0

  EWKBRecord.from_wkb_record(wkb_record, srid).to_binary_s
end