Parent

Methods

Files

GeoRuby::SimpleFeatures::EWKBParser

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

Public Class Methods

new(factory) click to toggle source
# File lib/geo_ruby/simple_features/ewkb_parser.rb, line 28
def initialize(factory)
  @factory = factory
  @parse_options ={
    1 => method(:parse_point),
    2 => method(:parse_line_string),
    3 => method(:parse_polygon),
    4 => method(:parse_multi_point),
    5 => method(:parse_multi_line_string),
    6 => method(:parse_multi_polygon),
    7 => method(:parse_geometry_collection)
  }
end

Public Instance Methods

parse(ewkb) click to toggle source

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

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.