Project

geo_foo

0.0
No commit activity in last 3 years
No release in over 3 years
Geo makes it easy to interact with Postgis without hacking too deep into AR. It is in a very early stage and should be considered experimental at most
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

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 © 2010 hukl, agnat. See LICENSE for details.