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.



76
77
78
# File 'lib/geo_ruby/geojson.rb', line 76

def geometry
  @geometry
end

Instance Method Details

#parse(geojson, srid = DEFAULT_SRID) ⇒ Object



78
79
80
81
82
# File 'lib/geo_ruby/geojson.rb', line 78

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