You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my sample code below, the function combines a list of adjacent polygons into one. Every polygon shows its cadastral information such as cadastral community number, as well as plot number. When combining these polygons into a single convex, I want to combine the numbers into list, that is populated in the convex additional properties. The function seems to ignore the given properties though. Please observe the source code of the convex function.
I would like to open a pull request to fix this problem. I just need approval or confirmation from someone that they were able to reproduce the problem.
The version of Turf you are using, and any other relevant versions.
6.5.0
GeoJSON data as a gist file or geojson.io (filename extension must be .geojson).
Issue is rather simple, and doesn't need test data. Should be reproducible with any GeoJSON.
Snippet of source code or for complex examples use jsfiddle.
typeAdditionalProperties={cadastralCommunity: string[];plots: string[];};typeTurfFeature=turf.Feature<turf.Polygon|turf.MultiPolygon,AdditionalProperties>;functioncombinePolygons(polygons: TurfFeature[]){constcombinedPolygons=polygons.reduce<TurfFeature>((previousPolygon,currentPolygon)=>{if(previousPolygon==null){returncurrentPolygon;}constreducedPlotNumbers=[...previousPolygon.properties.plots, ...currentPolygon.properties.plots];constreducedCadastralCommunities=[
...previousPolygon.properties.cadastralCommunity,
...currentPolygon.properties.cadastralCommunity,];returnturf.union<AdditionalProperties>(previousPolygon,currentPolygon,{properties: {plots: reducedPlotNumbers,cadastralCommunity: reducedCadastralCommunities,},});},null);if(combinedPolygons.geometry.type==='Polygon'){returncombinedPolygons;}const{ properties }=combinedPolygons;constcombinedConvex=turf.convex<AdditionalProperties>(combinedPolygons.geometry,{// there's a bug in the convex function where the properties are not populated https://github.com/Turfjs/turf/blob/master/packages/turf-convex/index.tsproperties: combinedPolygons.properties});if(combinedConvex){// this should not be necessarycombinedConvex.properties=properties;}returncombinedConvex;}
Verify this issue hasn't already been reported, or resolved in the latest alpha pre-release.
I couldn't find an issue matching this reported issue.
The text was updated successfully, but these errors were encountered:
Background
In my sample code below, the function combines a list of adjacent polygons into one. Every polygon shows its cadastral information such as cadastral community number, as well as plot number. When combining these polygons into a single convex, I want to combine the numbers into list, that is populated in the convex additional properties. The function seems to ignore the given properties though. Please observe the source code of the convex function.
I would like to open a pull request to fix this problem. I just need approval or confirmation from someone that they were able to reproduce the problem.
6.5.0
.geojson
).Issue is rather simple, and doesn't need test data. Should be reproducible with any GeoJSON.
I couldn't find an issue matching this reported issue.
The text was updated successfully, but these errors were encountered: