Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 15:08
    kevinsimper commented #2207
  • 09:54
    JamesLMilner labeled #2214
  • 09:53
    JamesLMilner closed #2207
  • 09:53
    JamesLMilner commented #2207
  • 09:51
    JamesLMilner commented #2214
  • 09:50
    JamesLMilner edited #2214
  • 05:38
    duoduodady reopened #2214
  • 05:02
    duoduodady closed #2214
  • 05:02
    duoduodady opened #2214
  • 03:37
    stevage opened #2213
  • 03:37

    stevage on stevage-patch-2

    Update centroid doc Fixes #2212 (compare)

  • 03:36
    stevage opened #2212
  • Oct 18 12:59
    pork1977 commented #1994
  • Oct 09 08:24
    alexandruana commented #2211
  • Oct 09 08:23
    alexandruana closed #2211
  • Oct 09 07:24
    alexandruana opened #2211
  • Oct 07 17:53
    twelch closed #2210
  • Oct 07 17:53
    twelch commented #2210
  • Oct 07 17:39
    mtlott opened #2210
  • Oct 07 08:47
    jayarjo commented #2209
Pochivalin Alexey
Hi, you may iterate your data, check boolean-point-in-polygon and returns polygon manualy. There is points-within-polygon, it returns points. May be start it and iterate your polygons or point...
@benboughton1 Very strange, in source code dissolve using union . . .
I'm soooo confused by versioning - Is v7 the latest? this still seems to be an issue: Turfjs/turf#1800
Ario K
Hello, I'm using the turf buffer function to create a 40 mile bbox from a midpoint, when I calculate the bbox diagonal I get ~44 but when I do the math it should be atleast this: Math.pow(2 * Math.pow(40, 2), 1 / 2 ) = 56.56
Ario K
: Unable to complete output ring starting at [-87.39118681312462, 37.98270758923267]. Last matching segment found ends at [-87.39118681312462, 37.982707589232696].
Anyone experience this?
Nikola Pavlovic
yo, would someone be so kind to explain to me what http://turfjs.org/docs/#buffer actually is?
from the docs, it seems to be something that's obvious and widely known
Morgan Herlocker
This definition is listed in a few places, and I think it is a good (reasonably precise) description:
"A buffer is an area defined by the bounding region determined by a set of points at a specified maximum distance from all nodes along segments of an object."
In practice, its a polygonal boundary drawn around a geometry of any type, with all edges at least N distance from the unbuffered geometry
PostGIS has a similar feature that has more documentation here: http://www.postgis.org/docs/ST_Buffer.html
Nikola Pavlovic
@morganherlocker a very sincere thanks
Anyone looking to help an open source project ? For the last few years, I have been empowering people to map litter. https://github.com/OpenLitterMap/openlittermap-web is now open source
Nic Hill
Hey guys, trying to use the simplify function from turf.js in a react app but it returns an error when compiling---Unknown GeoJSON type
I am working on a wildfire tracking app and trying to get rid of ugly sliced, self intersecting polygons. Check it out here: firewild.netlify.app
Nic Hill
Trying to modify Firemap.js in a way that doesn't end up like that
I have a basic doubt as am using the turf library for the first time. I have downloaded turf.min.js and included through <script> tag but the web-console shows the error "turf is not defined".
Also, getting a error message for line number 1 at turf.min.js Uncaught Syntax Error

Hi, I've noticed that when I generate a square grid, whether it's with degrees or radians, the cell dimensions don't match up:

> turf.squareGrid([28.225,27.925,29.275,29], .025 * Math.PI / 180, {units: 'radians'})
> turf.squareGrid([28.225,27.925,29.275,29], .025 * Math.PI / 180, {units: 'radians'}).features[0].geometry.coordinates
    [ 28.226548620665543, 27.9375 ],
    [ 28.226548620665543, 27.9625 ],
    [ 28.25484328981876, 27.9625 ],
    [ 28.25484328981876, 27.9375 ],
    [ 28.226548620665543, 27.9375 ]

As you can see, the latitudes are separated by the correct distance (.025) while the longitudes don't. The longitudes are not on the same grid as the provided bounding box. Is there an explanation for this? I've done a bunch of googling but haven't found any reasoning. Checking the source now...


Well, that's not really the issue. But this is:

> turf.distance([28.225, 27.925], [29.275, 27.925], {units: 'degrees'})
> 29.275-28.225

Is there an explanation for this? I guess I'll just gut rectangularGrid for my needs...

Mariusz Wójcik
Hi everyone! ;)
I have a small - and probably silly - question. Is any way to get list of random point for a polygon? I tried to use this functions set: bbox => randomPoint => pointsWithinPolygon. randomPoint count is set to 50, but usually I get very low number of points within polygon (at most 5).
  const polygonBbox = bbox(poly);
  const truncatedPoints = truncate(
    randomPoint(pointsLimit, { bbox: polygonBbox }),
  return pointsWithinPolygon(truncatedPoints, poly).features.map(getPointCoords);