Conversation
- Add geometry column to sites, initialized with data (lat, lon, masl) [masl == elevation] - All sites are set to have srid/espg=4326 (WGS-84) - Need to switch database.yml to use postgis instead of postgresql
There was a problem hiding this comment.
do we want to keep mysql around, now we are using postgis features such as geometry.
|
@dlebauer @phenolphtalein @gsrohde this was asked by david for the next sprint. |
|
@phenolphtalein can you please review this pull request? and then reassign to @gsrohde once all of the migrations work and tests pass? |
|
@dlebauer @robkooper I had to install the 'spatial_adapter' gem to make it work, otherwise rails doesn't seem to be able to get xyz coordinates from the point. Do you get the same problem? |
|
You should have been able to do a bundle install since the requirements are in the GemFile. |
|
It wasn't in the Gemfile, there is only postgis-adapter. |
|
mmm, ok. I didn't install it explicitly maybe different versions of ruby. One thing that I did (I just realized) was the following commands to convert the database to have the postgis extensions: rake db:gis:setup |
|
Yes, I did that but still needed the gem to for the functions to work properly. |
- add index to geometry - use centroid if not a point - remove activerecord-postgresql-adapte, is replaced by activerecord-postgis-adapter
|
updated pull request to add code to return centroid for lat/lon/elev if geometry is not a point. |
|
Rob: Mike closed the corresponding Redmine issue without this being pulled. If you still want me to pull this, then either (1) re-open the Redmine issue, assign it to me, and set the category to "Pull Requested", or (2) Re-assign this pull requested to me, preferably with a comment like "this pull request has been checked by ... and is ready to go". (Preferably, do both of these! We have option (1) partly because the undergraduates don't have the permissions needed to assign Github issues.) |
|
@phenolphtalein is pull request ok? Can somebody else and try if they have same problem with missing gem? |
|
@robkooper @gsrohde I thinks it's ok. Everything worked fine after adding the gem. |
|
From Scott's reply above:
On Friday, July 18, 2014, Rob Kooper notifications@github.com wrote:
|
|
Assigned to scott. don't want to assign it to scott in redmine since he has not done anything on and should not get the credit in redmine for it. |
|
If anyone is using Redmine to assign credit for work done, such use should On Friday, July 18, 2014, Rob Kooper notifications@github.com wrote:
|
There was a problem hiding this comment.
What is this mysterious number 4326? Even though this is just a migration, I think this should be a named constant, both here and in the Site model, and it probably should have a comment explaining it if the name of the constant doesn't say it all.
There was a problem hiding this comment.
I agree about the mystery numbers, even when googlable, they shouldn't need to be googled by everyone reading the code ... the following info should be in the comments
Spatial Reference System Identifier (SRID) http://en.wikipedia.org/wiki/SRID
SRID 4326 is WGS 82 http://spatialreference.org/ref/epsg/wgs-84/
There was a problem hiding this comment.
I assume this replaces and extends activerecord-postgresql-adapter, correct?
|
I was able to run the migration after running |
|
Yes you do need to add the postgis extension. I loaded the ebi-forecast database for a fresh start. Only problem was the create extension, once that was executed the migration worked and no problems encuntered, The sites are listed normally. |
[masl == elevation]