Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:25
    ThomasG77 edited #2229
  • 16:24
    ThomasG77 edited #2229
  • 16:23
    ThomasG77 edited #2229
  • 16:21
    ThomasG77 opened #2229
  • 13:13
    kochis edited #2228
  • 13:13
    kochis opened #2228
  • Nov 25 09:15
    GeekyMonkey commented #1743
  • Nov 25 09:14
    GeekyMonkey commented #1743
  • Nov 25 03:25
    dpmcmlxxvi opened #2227
  • Nov 24 11:42
    sakshibhasin edited #2226
  • Nov 24 10:33
    sakshibhasin edited #2226
  • Nov 24 10:30
    sakshibhasin edited #2226
  • Nov 24 10:28
    sakshibhasin opened #2226
  • Nov 23 10:07
    JamesLMilner commented #2200
  • Nov 23 02:28
    LiuuY commented #2003
  • Nov 23 02:25
    LiuuY commented #2003
  • Nov 23 02:25
    LiuuY commented #2003
  • Nov 23 02:24
    LiuuY commented #2003
  • Nov 19 21:18
    JamesLMilner commented #2225
  • Nov 19 21:18
    JamesLMilner commented #2200
Alex
@awulkan

@fugwenna I think I tried that without success.
I need to check if points and linestrings are within a polygon.

I ended up using this: http://turfjs.org/docs#booleanPointInPolygon
And a hack to make each end of a linestring become a point.
The draback is that I need to check thousands of points, one at a time, with a loop.

Mila Frerichs
@milafrerichs
hi, again thanks for the awesome turf.js lib. I love it. use it as much as I can. I have a question though regarding 6.0. especially this one Turfjs/turf#1307
I have trouble using the new square-grid 6.x version since it depends on a few other 6.x version. especially helper, invariant, distance and boolean-intersect. It seems that my web pack config does picked up boolean-intersect and distance correctly but tries to load the mjs file for helper and invariant.
can this be related to both of them having the mjs file in the files of the package.json (https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/package.json#L10) or is this something completely different.
any help is very much appreciated and if I can help get some stuff done please let me know.
nathan brigmon
@NateATXCode
Turf.area question:
How does it reconcile differences with various projections? For example, if I draw a circle at the equator and draw that same circle in Antarctica... the area will be different because of the projection of the web map, no?
nathan brigmon
@NateATXCode
what is the suggestion for converting them to a standard area?
nathan brigmon
@NateATXCode
FYI- found this library: https://www.npmjs.com/package/geodesy
Bexanderthebex
@Bexanderthebex
hi guys, is there anybody online?
I'm planning to use turf but can't decide which side should I use it, front-end or back-end
nathan brigmon
@NateATXCode
i keep it to the back-end
Deleema Fernando
@delleemarf_twitter

Hey all, Im looking for answer for this question https://stackoverflow.com/questions/49645333/turfjs-linesplit-not-working-properly-when-splitter-is-near-vertex-point
I really need a help at the moment.

Thanks in advanced

Ohad
@osadan
anyone now's when turf plans to release 6.0
Andy Prasetya
@YggdrasilX_twitter

Hi all. I need to count how many occurences (point) in a set of polygons by remarking the each occurences property in polygon.
The polygon is:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": 0,
            "properties": {
                "id": 1,
        "occurences": 0
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            109.914952,
                            -7.19584
                        ],
                        [... about 50.000 nodes ...] 
                    ]
                ]
            }
        },
                [... less than 100 polygons ...]
        ]
}

and the points:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": 0,
            "properties": {
                "id": 1
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    109.912194,
                    -7.711743
                ]
            }
        },
                [... about 20.000 points ...]
        ]
}

In Turf.js, I believe I can do it with pointsWithinPolygon or booleanPointInPolygon. My questions are: which is faster/efficient? How to do it?
Much obliged for your attention.

Arsen Stahanov
@ArStah
Hey guys
Can someone tell me is it possible to do with turf something like turf.along but opposite, i mean, i have a line, and 2 points on it, i need to get the distance between these points?
almandarin
@almandarin

Hi there, thanks for the great work, though I don't get the squareGrid:
var squarebin = squareGrid([0,0,2,2], 1, {units: 'degrees'});
Gives me {"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[0.49941580254182905,0.49941580254182905],[0.49941580254182905,1.500584197458171],[1.500584197458171,1.500584197458171],[1.500584197458171,0.49941580254182905],[0.49941580254182905,0.49941580254182905]]]}}]}

Why it does not give me four Features starting from 0,0? Am I missing something?

Kevin Yanuk
@fugwenna
has anyone here attempted to find a destination point with a back bearing using: https://www.movable-type.co.uk/scripts/latlong.html
Rusty Green
@rustygreen
tuf-example.png
Can anyone suggest a turf function (or series of operations) to accomplish the image above?
Alex
@apgeo
one (generic) option is to test for each point in the linestring if it is contained in one of the polygons, then to construct the ouput multilinestring from the positive ones (points)
Rusty Green
@rustygreen
Currently I'm using lineIntersect and then splitting the line based on the intersecting points - but it seems like a lot of extra overhead - figured this was a common scenario
16AGR-Durham
@16AGR-Durham
I don't know how to look at forum history, so will ask a question that I am sure has been asked many times (a) does turf.bearing(point1, point2); return true or magnetic and if true (b) is there a function to convert true to magnetic based on declination in the long/lat input?
I think it returns true
Kevin Yanuk
@fugwenna
@16AGR-Durham i believe the bearing code was derived from this: https://www.movable-type.co.uk/scripts/latlong.html
Matthias Tylkowski
@tylkomat
All the maps on the turf page are broken. Seems someone messed up the css.
Per Liedman
@perliedman
@tylkomat they look ok here. do you have a URL that is not working for you?
Matthias Tylkowski
@tylkomat
@perliedman That's funny, now they are fine. Maybe mapbox messed up their own css
Matthias Tylkowski
@tylkomat
What can I use to reverse the result of difference? union?
xlcrr
@xlcrr
John de Stigter
@rjdestigter
Is booleanPointInPolygon supposed to return true even if a given point resides within a hole of a given feature?
John de Stigter
@rjdestigter
(never mind, looks like I ran into some bad spatial data with incorrect rotation)
Matthias Tylkowski
@tylkomat
Hello everyone. Does anyone know how I can create a bounding box that is rotated by a custom amount of degrees?
Gabriel Cuenca
@Gcuencam
Hello ! Is there any way to calculate the route between two points without going through a certain area using turf and mapbox?
Morgan Herlocker
@morganherlocker
Hey @Gcuencam! I would recommend requesting a route for your waypoints from the Mapbox Directions API, using the geojson flag, for simplicity (default is polyline encoding). https://www.mapbox.com/api-documentation/#retrieve-directions
then run the result against turf.length, which measures the distance of a linestring
Morgan Herlocker
@morganherlocker
@tylkomat bit late to your question, but you can combine turf.bboxPolygon and turf.transformRotate to achieve this
Matthias Tylkowski
@tylkomat
@morganherlocker No worries and thank you. In the meantime I came to the same solution.
Ghost
@ghost~5ad5fcf2d73408ce4f95fd15
hey! just a small question - can turfjs be used to work with files in the 200M rows scale ?
i've done some work where I take location data, create hexbins and calculate how many points are in a bin
I worry I might run into buffer errors
so i was just wondering, should I use turfjs for this scale of data or look for something else ?
ohenepee
@ohenepee
Hello... is there anyway to get the cardinal corners of a bbox, like northeast, northwest, southeast, southwest?
David Haynes
@dahaynes
Hello, Has anyone tried to use Turfjs with MongoDB? I'm looking for a bit of assistance in performing centroid queries on a collection of boundaries
Pochivalin Alexey
@pochivalin-alexey
Hello, can you help me? How update feature coordinates using turf.coordReduce? What is the difference turf.coordReduce and turf.coordEach?
Pochivalin Alexey
@pochivalin-alexey
@ohenepee may be extract vertexes from bbox and use turf.bearing . . .
RISHAV ROY
@rishavroy1264bitmesra
How to project a point over linestring using turf ?
Morgan Herlocker
@morganherlocker
turf.along will give you a point N distance along a linestring
Dan Ford
@danford1
Hey all, I have a vector tile polygon source hosted in Mapbox Studio and an isochrone geojson generated using the isochrone api. I'm trying to use turf intersect to find a count of polygons within the isochrone, but getting Unknown GeoJSON type: undefined because one of the data inputs is vector tiles. I found a question on this back in 2016, but looking for a current answer/resource that will help me learn a) whether I need to convert the vt to geojson and b) best method for doing this client side. Maybe the best answer is to just use a geojson source to begin with?
Pochivalin Alexey
@pochivalin-alexey
@danford1 Attention, turf intesect using only two polygon. Simple way to convert vt geometry to geojson format use turf.polygon method.