Parent

Methods

Files

GeoRuby::SimpleFeatures::EWKTParser

Parses EWKT 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
ewkt_parser = EWKTParser::new(factory)
ewkt_parser.parse(<EWKT String>)
geometry = @factory.geometry

You can also use directly the static method Geometry.from_ewkt

Public Class Methods

new(factory) click to toggle source
# File lib/geo_ruby/simple_features/ewkt_parser.rb, line 30
def initialize(factory)
  @factory = factory
  @parse_options ={
    "POINT" => method(:parse_point),
    "LINESTRING" => method(:parse_line_string),
    "POLYGON" => method(:parse_polygon),
    "MULTIPOINT" => method(:parse_multi_point),
    "MULTILINESTRING" => method(:parse_multi_line_string),
    "MULTIPOLYGON" => method(:parse_multi_polygon),
    "GEOMETRYCOLLECTION" => method(:parse_geometry_collection)
  }
end

Public Instance Methods

parse(ewkt) click to toggle source

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

# File lib/geo_ruby/simple_features/ewkt_parser.rb, line 44
def parse(ewkt)
  @factory.reset
  @tokenizer_structure = TokenizerStructure.new(ewkt)
  @with_z=false
  @with_m=false
  @is_3dm = false
  parse_geometry(true)
  @srid=nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.