Skip to content

Commit

Permalink
Merge pull request #40 from dataesr/fix/noGeometry
Browse files Browse the repository at this point in the history
don't return data in polygons if no geometry
  • Loading branch information
jerem1508 authored May 31, 2024
2 parents 6900ff5 + 320c3ef commit 2bfb561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/routes/tableaux/atlas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ router.route('/atlas/get-geo-polygons')
code = `^${code}`;
filter[field] = { "$regex": code, "$options": "i" };
const allCities = await db.collection('citiesPolygons').find(filter).toArray();
const polygons = allCities.map((city) => ({
const polygons = allCities.filter((city) => city.geom?.geometry).map((city) => ({
geometry: city.geom?.geometry,
nameFr: city.com_nom,
originalId: city.com_code,
Expand Down

0 comments on commit 2bfb561

Please sign in to comment.