Class GeoRuby::SimpleFeatures::EWKBParser
In: lib/geo_ruby/simple_features/ewkb_parser.rb
Parent: Object

Parses EWKB strings and notifies of events (such as the beginning of the definition of geometry, the value of the SRID…) the factory passed as argument to the constructor.

Example

 factory = GeometryFactory::new
 ewkb_parser = EWKBParser::new(factory)
 ewkb_parser.parse(<EWKB String>)
 geometry = @factory.geometry

You can also use directly the static method Geometry.from_ewkb

Methods

new   parse  

Public Class methods

[Source]

    # File lib/geo_ruby/simple_features/ewkb_parser.rb, line 28
28:       def initialize(factory)
29:         @factory = factory
30:         @parse_options ={
31:           1 => method(:parse_point),
32:           2 => method(:parse_line_string),
33:           3 => method(:parse_polygon),
34:           4 => method(:parse_multi_point),
35:           5 => method(:parse_multi_line_string),
36:           6 => method(:parse_multi_polygon),
37:           7 => method(:parse_geometry_collection)
38:         }
39:       end

Public Instance methods

Parses the ewkb string passed as argument and notifies the factory of events

[Source]

    # File lib/geo_ruby/simple_features/ewkb_parser.rb, line 42
42:       def parse(ewkb)
43:         @factory.reset
44:         @unpack_structure=UnpackStructure::new(ewkb)
45:         @with_z = false
46:         @with_m = false
47:         parse_geometry
48:         @unpack_structure.done
49:         @srid=nil
50:       end

[Validate]