Class: GeoRuby::GeojsonParser

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_ruby/geojson.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#geometryObject (readonly)

Returns the value of attribute geometry.



65
66
67
# File 'lib/geo_ruby/geojson.rb', line 65

def geometry
  @geometry
end

Instance Method Details

#parse(geojson, srid = DEFAULT_SRID) ⇒ Object



67
68
69
70
71
# File 'lib/geo_ruby/geojson.rb', line 67

def parse(geojson, srid=DEFAULT_SRID)
  @geometry = nil
  geohash = JSON.parse(geojson)
  parse_geohash(geohash, srid)
end