Skip to content

Commit

Permalink
Merge pull request #3185 from Geoportail-Luxembourg/fix_reverse
Browse files Browse the repository at this point in the history
Get limits from communes and not from country
  • Loading branch information
rmichaelis authored Aug 19, 2024
2 parents 7267689 + 1a5912f commit 75959ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geoportal/geoportailv3_geoportal/views/geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from geojson import loads as geojson_loads
from geoalchemy2 import func
from geoalchemy2.elements import WKTElement, WKBElement
from geoportailv3_geoportal.geocode import CountryLimAdm, Address, WKPOI, \
from geoportailv3_geoportal.geocode import CommunesLimAdm, Address, WKPOI, \
Neighbourhood, Parcel, CommunesLimAdm
from c2cgeoportal_commons.models import DBSessions
from shapely.wkt import loads
Expand Down Expand Up @@ -62,11 +62,11 @@ def reverse(self):
if os.environ.get('FAKE_REVERSE_GEOCODING') == '1':
return json.loads('{"count": 1, "results": [{"id_caclr_street": "461", "distance": 33.7389366951768, "street": "Rue Jean-Pierre Brasseur", "postal_code": "1258", "id_caclr_bat": "21478", "geom": {"type": "Point", "coordinates": [76302.2077999998, 75334.6180995487]}, "locality": "Luxembourg", "number": "16"}]}') # noqa

cnt = self.db_ecadastre.query(CountryLimAdm.id). \
cnt = self.db_ecadastre.query(CommunesLimAdm.id). \
filter(func.ST_within(WKTElement('POINT(%(x)s %(y)s)' % {
"x": easting,
"y": northing
}, srid=2169), CountryLimAdm.geom)
}, srid=2169), CommunesLimAdm.geom)
).all()
results = []
# Check if point is inside luxembourg or not
Expand Down

0 comments on commit 75959ae

Please sign in to comment.