Project

dm-postgis

0.01
No commit activity in last 3 years
No release in over 3 years
Adds DMGeometry type to DataMapper that uses GeoRuby for (de)serializing Geometry types into Postgis.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.6.0

Runtime

~> 1.2.0
= 1.3.4
>= 0
 Project Readme

dm-postgis

Very simple type for datamapper allowing storing GeoRuby Geometries types in Postgis. This uses GeoRuby to do all the hard work. here's an example

class Foo
  include DataMapper::Resource
  
  property :id, Serial
  property :name, Integer
  property :geom, PostGISGeometry
end

# create a GeoRuby LineString
line = GeoRuby::SimpleFeatures::LineString.new(4236)
#add some points
[[12.12,13.14], [12.13,14.15], [12.15,16.17]].each{|x,y| line.points << GeoRuby::SimpleFeatures::Point.from_x_y(x,y)}
# stick it in the db!
f = Foo.create(:name => "random geometry", :geom => line)

Copyright

Copyright (c) 2010 Roman Kamyk jr, 2012 svs. See LICENSE for details.