Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails Interface to Postgis
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.document
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
geo_foo.gemspec
test_database.yml

README.rdoc

geo_foo

Run

rake build
rake install

Running the tests

To run the tests you need a postgresql server with postgis extensions installed.

  • create an empty database geo_foo_test from your postgis template

  • set your settings in test_database.yml.

Now run:

rake [test]

Creating the postgis template

To simplify working with postgis databases it is recommended to create a postgis aware template named template_postgis. As a privileged database user (postgres) create a new database template:

psql -U postgres -c "CREATE DATABASE template_postgis WITH template = template1"
psql -U postgres -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'"
psql -U postgres template_postgis -c "CREATE LANGUAGE plpgsql"

Now import the postgis functionality into the new template. The location of the SQL files varies from system to system. It often depends on the postgresql server version, too. Please note that older versions of postgis used lwpostgis.sql instead of postgis.sql.

Mac OS X with macports

psql -U postgres template_postgis -f /opt/local/share/postgresql84/contrib/postgis.sql
psql -U postgres template_postgis -f /opt/local/share/postgresql84/contrib/spatial_ref_sys.sql

Debian

psql -U postgres template_postgis -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
psql -U postgres template_postgis -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql

Finalize the template with the following commands

psql -U postgres template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC"
psql -U postgres template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC"
psql -U postgres template_postgis -c "VACUUM FREEZE"

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright © 2010 hukl, agnat. See LICENSE for details.

Something went wrong with that request. Please try again.