diff options
| author | Xinhui | 2017-01-25 11:41:14 +0100 |
|---|---|---|
| committer | Xinhui | 2017-01-25 11:41:14 +0100 |
| commit | 4fdc30f46f8a296dcd15b827a99f8c7a09338d50 (patch) | |
| tree | 857b0bee0c575370def8fd56cfa6e1ad0e2cbd7c | |
| parent | 17e8676b5456a51697168659a10693ddec7633ce (diff) | |
| download | chouette-core-4fdc30f46f8a296dcd15b827a99f8c7a09338d50.tar.bz2 | |
Store long lat for StopArea & AccessPoint
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rw-r--r-- | lib/stif/reflex_synchronization.rb | 9 |
2 files changed, 10 insertions, 1 deletions
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] |
