From 4fdc30f46f8a296dcd15b827a99f8c7a09338d50 Mon Sep 17 00:00:00 2001 From: Xinhui Date: Wed, 25 Jan 2017 11:41:14 +0100 Subject: Store long lat for StopArea & AccessPoint --- Gemfile.lock | 2 +- lib/stif/reflex_synchronization.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1f05ba75b..98903e406 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,7 +23,7 @@ GIT GIT remote: git@github.com:AF83/stif-reflex-api.git - revision: 152d1b48ec0792bf086e731d099a1d8954369b85 + 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 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] -- cgit v1.2.3