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

Parses HexEWKB strings. In reality, it just transforms the HexEWKB string into the equivalent EWKB string and lets the EWKBParser do the actual parsing.

Methods

decode_hex   new   parse  

Public Class methods

[Source]

     # File lib/geo_ruby/simple_features/ewkb_parser.rb, line 150
150:       def initialize(factory)
151:         super(factory)
152:       end

Public Instance methods

transforms a HexEWKB string into an EWKB string

[Source]

     # File lib/geo_ruby/simple_features/ewkb_parser.rb, line 158
158:       def decode_hex(hexewkb)
159:         result=""
160:         num_bytes = (hexewkb.size + 1) / 2
161:         0.upto(num_bytes-1) do |i|
162:           result << hexewkb[i*2,2].hex
163:         end
164:         result
165:       end

parses an HexEWKB string

[Source]

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

[Validate]