aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-01-25 11:41:14 +0100
committerThomas Haddad2017-01-26 12:04:10 +0100
commit1b9a3dcd27398c1cc48e7c06b7d15891765b7a0f (patch)
tree14e0d71235326f0f5dacd18809f0262dc1ce3113
parentb92965f1ad9270049530f7a89082ee63396b5678 (diff)
downloadchouette-core-1b9a3dcd27398c1cc48e7c06b7d15891765b7a0f.tar.bz2
Store long lat for StopArea & AccessPoint
-rw-r--r--Gemfile.lock2
-rw-r--r--lib/stif/reflex_synchronization.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 4e07a585a..f380f1490 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -23,7 +23,7 @@ GIT
GIT
remote: git@github.com:AF83/stif-reflex-api.git
- revision: 2c01010dce3a6cb39339995c373faf89ae00f3f3
+ revision: e3841486efc2218aa2fcbc4d53f85c06e41094a8
specs:
reflex (0.0.1)
nokogiri (~> 1.6)
diff --git a/lib/stif/reflex_synchronization.rb b/lib/stif/reflex_synchronization.rb
index b620051af..10d58c833 100644
--- a/lib/stif/reflex_synchronization.rb
+++ b/lib/stif/reflex_synchronization.rb
@@ -126,6 +126,10 @@ module Stif
:zip_code => 'PostalRegion',
:city_name => 'Town'
}.each do |k, v| access[k] = entry[v] end
+ if entry['gml:pos']
+ access['longitude'] = entry['gml:pos'][:lng]
+ access['latitude'] = entry['gml:pos'][:lat]
+ end
access.save if access.valid? && access.changed?
end
@@ -141,6 +145,11 @@ module Stif
:city_name => 'Town'
}.each do |k, v| stop[k] = entry[v] end
+ if entry['gml:pos']
+ stop['longitude'] = entry['gml:pos'][:lng]
+ stop['latitude'] = entry['gml:pos'][:lat]
+ end
+
if stop.changed?
stop.creation_time = entry[:created]
stop.import_xml = entry[:xml]