Module: OGR::Geometry::EWKBIOExtensions
- Included in:
- OGR::Geometry
- Defined in:
- lib/ogr/extensions/geometry/ewkb_io_extensions.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
29 30 31 |
# File 'lib/ogr/extensions/geometry/ewkb_io_extensions.rb', line 29 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#to_ewkb ⇒ String
Returns Binary string representative of EWKB.
34 35 36 37 38 39 |
# 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..to_i : 0 EWKBRecord.from_wkb_record(wkb_record, srid).to_binary_s end |