Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The tool, turf/difference, returns values that are not expected when calculating a MultiPolygon. #2847

Open
SuperHuZhiPeng opened this issue Feb 26, 2025 · 0 comments

Comments

@SuperHuZhiPeng
Copy link

const multiPolygonGeoJSON = {
"id": "9",
"type": "Feature",
"properties": {
"新建字段": "",
"smpid": 9
},
"geometry": {
"coordinates": [
[
[
[
49.94211569413164,
29.497541277856367
],
[
28.839551278389223,
26.957278826405524
],
[
48.02842756439971,
17.73505748354385
],
[
59.348351446407186,
17.55062860328698
],
[
49.94211569413164,
29.497541277856367
]
]
],
[
[
[
49.94211569413164,
29.497541277856367
],
[
59.348351446407186,
17.55062860328698
],
[
95.16631931047093,
16.96706746143657
],
[
95.16631931047093,
34.94149321090467
],
[
49.94211569413164,
29.497541277856367
]
],
[
[
73.32892322956478,
27.118799174695646
],
[
86.67896551247556,
26.957195952981486
],
[
76.0673934414454,
21.509241571951947
],
[
73.32892322956478,
27.118799174695646
]
]
],
[
[
[
100.02900779538633,
13.500447286364128
],
[
102.76747800726697,
7.89088968362029
],
[
113.37905007829713,
13.338844064649983
],
[
100.02900779538633,
13.500447286364128
]
]
]
],
"type": "MultiPolygon"
}
}
const feature = this.newFeature(multiPolygonGeoJSON )
this.addFeature(feature )

After adding this MultiPolygon feature to the map, I drew a feature and used the difference tool between this feature and the MultiPolygon feature. The expected result should be a feature of type MultiPolygon, but instead, the returned feature is of type Polygon, and it has one less line compared to the MultiPolygon feature.

Image
Image
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant