Skip to content
Advertisement

Tag: turfjs

Difference between centroid and centerOfMass in turf

I need to find the geospatial coordinates of point which is the mean of the distances between all the Features in my GeoJSON dataset. In turf.js both centroid and centerOfMass are presented. The explanation for centerOfMass is that it “takes any Feature or a FeatureCollection and returns its center of mass using this formula: Centroid of Polygon.” But centroid and

Join two bounding boxes bboxes

I have two bounding boxes and want to create a big one that includes this 2 – join them. For example(2 results of the turf.bbox): Is there an easy way with turf etc.? thanks Answer Maybe this could be solved using a combination of bboxPolygon, combine and bbox. bboxPolygon converts a bounding box to a Polygon feature.

Advertisement