Acts As Line plugin

Plugin details

Use PostGIS for date ranges: treat start/end date columns as a single spatial object that can be efficiently queried and manipulated.

Websitehttp://github.com/broughcut/acts_as_line/tree/master Repositorygit://github.com/broughcut/acts_as_line.git Author brough Tags acts LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/broughcut/acts_as_line.git

Example
=======

table must already have a start_date and end_date column of type date or datetime.

script/generate datesgeom_migration table_name


runs the following on target table:

   execute("ALTER TABLE table_name ADD COLUMN geom geometry;")
   execute("CREATE INDEX idx_table_name_dates_geom ON table_name USING GIST (geom);")


object = Foo.find(:first)

results = Foo.touching(object) | results = Foo.intersects(object,true)
results = Foo.not_touching(object) | results = Foo.intersects(object,false)
results = Foo.touching(object,{:id => 123})
results = Foo.touching(object,{:id => '>123'})
results = Foo.touching(object,{:id => '<>123'}) etc
results = Foo.touching(object,{:id => 123, :title => 'bar'})

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 2 months ago