Skip to content
Permalink
Browse files

[geocoder] Fix inverted lat lon in nominatim's viewport

  • Loading branch information
nirvn committed Dec 17, 2020
1 parent c56d2d8 commit e488a57afce141401f3a93907c2267140d424eb9
Showing with 5 additions and 5 deletions.
  1. +4 −4 src/core/geocoding/qgsnominatimgeocoder.cpp
  2. +1 −1 tests/src/python/test_qgsnominatimgeocoder.py
@@ -217,10 +217,10 @@ QgsGeocoderResult QgsNominatimGeocoder::jsonToResult( const QVariantMap &json )
{
QVariantList boundingBox = json.value( QStringLiteral( "boundingbox" ) ).toList();
if ( boundingBox.size() == 4 )
res.setViewport( QgsRectangle( boundingBox.at( 0 ).toDouble(),
boundingBox.at( 2 ).toDouble(),
boundingBox.at( 1 ).toDouble(),
boundingBox.at( 3 ).toDouble() ) );
res.setViewport( QgsRectangle( boundingBox.at( 2 ).toDouble(),
boundingBox.at( 0 ).toDouble(),
boundingBox.at( 3 ).toDouble(),
boundingBox.at( 1 ).toDouble() ) );
}

res.setAdditionalAttributes( attributes );
@@ -130,7 +130,7 @@ def test_json_to_result(self):
'place_id': '157298780', 'postcode': 'G1C 4X5',
'road': 'Rue Anick', 'osm_type': 'way',
'type': 'school', 'class': 'amenity'})
self.assertEqual(res.viewport(), QgsRectangle(46.887, -71.199, 46.889, -71.201))
self.assertEqual(res.viewport(), QgsRectangle(-71.201, 46.887, -71.199, 46.889))
self.assertEqual(res.group(), 'Quebec')


0 comments on commit e488a57

Please sign in to comment.
You can’t perform that action at this time.