by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 06 13:54
    rowanwins closed #1934
  • Aug 06 13:54
    rowanwins commented #1934
  • Aug 06 12:55
    rmpt commented #1935
  • Aug 06 12:55
    rmpt closed #1935
  • Aug 06 11:21
    mvenaas commented #1935
  • Aug 06 11:10
    platon-rov commented #1935
  • Aug 06 10:59
    mvenaas commented #1935
  • Aug 06 10:59
    mvenaas commented #1935
  • Aug 06 10:59
    mvenaas commented #1935
  • Aug 06 10:28
    rmpt opened #1935
  • Aug 03 01:02
    stevage opened #1934
  • Jul 29 17:36
    mfedderly commented #1833
  • Jul 29 17:32
    evanstern commented #1833
  • Jul 29 14:18
    jimyang-9 opened #1933
  • Jul 29 13:15
    cdbusby commented #1218
  • Jul 24 20:42
    lamesjim opened #1932
  • Jul 22 20:36
    stevenchanin opened #1931
  • Jul 22 18:43
    willvincent commented #1720
  • Jul 22 18:42
    willvincent commented #1720
  • Jul 22 12:40
    JulesBlm commented #1151
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.
Mireille Raad
@migheille_twitter
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.
Dan Ford
@danford1
OK, thanks! I just realized that I have to iterate over each polygon in the feature class and run a separate intersect. Does anyone have an example of this they can share with me?
Pochivalin Alexey
@pochivalin-alexey
@danford1 What example are you interested in?
Dan Ford
@danford1
How to run an intersect between Poly1 and a feature class with many polygons.
Ilya Radchenko
@knownasilya
Is there a way to do an intersect and also handle donut holes?
Has anyone done something like this?
Pochivalin Alexey
@pochivalin-alexey
@knownasilya By geojson spec polygon without hole like this:
{ "type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
]
}
and with hole:
{ "type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
]
}
Attention: first array is bigest area
Check this two condition and do intersect.
Ilya Radchenko
@knownasilya
Thanks @pochivalin-alexey
Ben Boughton
@benboughton1
Hi can anyone help as to why this dissolve example is not dissolving? http://jsfiddle.net/dejz01v4/1/
Ben Boughton
@benboughton1
I put the question on StackExchange if anyone would like to answer there - thanks!