aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stif/reflex_synchronization.rb
diff options
context:
space:
mode:
authorXinhui2017-01-25 11:41:14 +0100
committerXinhui2017-01-25 11:41:14 +0100
commit4fdc30f46f8a296dcd15b827a99f8c7a09338d50 (patch)
tree857b0bee0c575370def8fd56cfa6e1ad0e2cbd7c /lib/stif/reflex_synchronization.rb
parent17e8676b5456a51697168659a10693ddec7633ce (diff)
downloadchouette-core-4fdc30f46f8a296dcd15b827a99f8c7a09338d50.tar.bz2
Store long lat for StopArea & AccessPoint
Diffstat (limited to 'lib/stif/reflex_synchronization.rb')
-rw-r--r--lib/stif/reflex_synchronization.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/stif/reflex_synchronization.rb b/lib/stif/reflex_synchronization.rb
index b7001bf68..9c5ff7cd4 100644
--- a/lib/stif/reflex_synchronization.rb
+++ b/lib/stif/reflex_synchronization.rb
@@ -131,6 +131,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
@@ -146,6 +150,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]