Class: GeoRuby::GeojsonParser

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

Constant Summary

Constants included from SimpleFeatures

SimpleFeatures::DEFAULT_SRID, SimpleFeatures::GEORSS_NS, SimpleFeatures::GML_NS, SimpleFeatures::KML_NS, SimpleFeatures::M_MASK, SimpleFeatures::SRID_MASK, SimpleFeatures::W3CGEO_NS, SimpleFeatures::Z_MASK

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#geometryObject (readonly)

Returns the value of attribute geometry.



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

def geometry
  @geometry
end

Instance Method Details

#parse(geojson, srid = DEFAULT_SRID) ⇒ Object



80
81
82
83
84
# File 'lib/geo_ruby/geojson.rb', line 80

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