class GeoRuby::SimpleFeatures::HexEWKBParser

Public Class Methods

new(factory) click to toggle source
Calls superclass method GeoRuby::SimpleFeatures::EWKBParser.new
# File lib/geo_ruby/simple_features/ewkb_parser.rb, line 150
def initialize(factory)
  super(factory)
end

Public Instance Methods

decode_hex(hexewkb) click to toggle source

transforms a HexEWKB string into an EWKB string

# File lib/geo_ruby/simple_features/ewkb_parser.rb, line 158
def decode_hex(hexewkb)
  result=""
  num_bytes = (hexewkb.size + 1) / 2
  0.upto(num_bytes-1) do |i|
    result << hexewkb[i*2,2].hex
  end
  result
end
parse(hexewkb) click to toggle source

parses an HexEWKB string

# File lib/geo_ruby/simple_features/ewkb_parser.rb, line 154
def parse(hexewkb)
  super(decode_hex(hexewkb))
end