unepwcmc/mypolygon
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
== Installing Postgis on the database Before migrating the database one needs to install postgis in it, do so by executing these commands on the database server: sudo -u postgres psql -d mypolygon_production -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql sudo -u postgres psql -d mypolygon_production -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql The Postgis 1.5.2 files are included in db/spatial and used to create the db, you will need to modify these if you wish to update postgis == If you get errors when db:migrating connect to the database and grant privileges to the user that is going to use the database (after installing the postgis. This might be because we are installing the postgis with user postgres and then accessing the database with a different user): GRANT ALL PRIVILEGES ON TABLE geometry_columns to [user]; GRANT ALL PRIVILEGES ON TABLE spatial_ref_sys to [user]; And then you might need to add: SELECT ST_SetSRID(ST_Point(-71.1043443253471, 42.3150676015829),4326); And then you'll be able to migrate. =) You may need to add the Mollweide SRID to your DB: INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 954009, 'esri', 54009, '+proj=moll +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ', 'PROJCS["World_Mollweide",GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mollweide"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",0],UNIT["Meter",1],AUTHORITY["EPSG","54009"]]'); == Bootstrapping To analyse a geometry's area, the database needs SRID 954009. To ensure it exists, run 'RAILS_ENV=production rake bootstrap:srid'