Module: OGR::GeometryExtensions::EWKBIO
- Included in:
- OGR::Geometry
- Defined in:
- lib/ogr/geometry_extensions/ewkb_io.rb
Overview
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).
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#to_ewkb ⇒ String
Binary string representative of EWKB.
Class Method Details
.included(base) ⇒ Object
28 29 30 |
# File 'lib/ogr/geometry_extensions/ewkb_io.rb', line 28 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#to_ewkb ⇒ String
Returns Binary string representative of EWKB.
33 34 35 36 37 38 |
# File 'lib/ogr/geometry_extensions/ewkb_io.rb', line 33 def to_ewkb wkb_record = WKBRecord.read(to_wkb) srid = spatial_reference ? spatial_reference..to_i : 0 EWKBRecord.from_wkb_record(wkb_record, srid).to_binary_s end |