forked from MapComplete/MapComplete
Fix isInside for multipolygons which are marked as polygon
This commit is contained in:
parent
651d987386
commit
45bf08744f
1 changed files with 19 additions and 15 deletions
|
@ -151,10 +151,10 @@ export class GeoOperations {
|
|||
const x: number = pointCoordinate[0];
|
||||
const y: number = pointCoordinate[1];
|
||||
|
||||
for (let i = 0; i < feature.geometry.coordinates.length; i++) {
|
||||
let poly = feature.geometry.coordinates[i];
|
||||
|
||||
let poly = feature.geometry.coordinates[0];
|
||||
|
||||
var inside = false;
|
||||
let inside = false;
|
||||
for (let i = 0, j = poly.length - 1; i < poly.length; j = i++) {
|
||||
const coori = poly[i];
|
||||
const coorj = poly[j];
|
||||
|
@ -170,8 +170,12 @@ export class GeoOperations {
|
|||
inside = !inside;
|
||||
}
|
||||
}
|
||||
if (inside) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return inside;
|
||||
return false;
|
||||
};
|
||||
|
||||
static lengthInMeters(feature: any) {
|
||||
|
|
Loading…
Reference in a new issue