Fix geo area point coordinates display

This commit is contained in:
Paul Chavard 2020-09-23 11:34:10 +02:00
parent 44d7750e7d
commit 61c315b276
2 changed files with 2 additions and 2 deletions

View file

@ -91,7 +91,7 @@ class GeoArea < ApplicationRecord
def location
if point?
Geo::Coord.new(*rgeo_geometry.coordinates).to_s
Geo::Coord.new(*rgeo_geometry.coordinates.reverse).to_s
end
end

View file

@ -14,7 +14,7 @@ RSpec.describe GeoArea, type: :model do
describe '#location' do
let(:geo_area) { build(:geo_area, :point) }
it { expect(geo_area.location).to eq("2°25'42\"N 46°32'19\"E") }
it { expect(geo_area.location).to eq("46°32'19\"N 2°25'42\"E") }
end
describe '#rgeo_geometry' do