question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

turf.tin's result polygons do not fulfill convexhull of points

See original GitHub issue

Please provide the following when reporting an issue:

  • [*] GeoJSON data as a gist file or geojson.io (filename extension must be .geojson).
  • [*] Snippet of source code or for complex examples use jsfiddle.

I believe, the result polygons of turf.tin must fulfill convexhull of given points. (If my understanding is mistake, please point out.)

But, in some case turf.tin’s result polygons do not fulfill convexhull of given points.

Example data is: https://gist.github.com/kochizufan/63feb2d8843c7cbd9ca9bd48b00c7d38 and output of var output = turf.tin(input, 'target'); is: https://gist.github.com/kochizufan/8f92d389b2a39c68ba0288aa74518e7c This result do not fulfill convexhull of input’s.

Is this bug?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stebogitcommented, Sep 18, 2017

@kochizufan it seems you’re using points in Mercator projection, which make your data invalid for the library: screen shot 2017-09-17 at 9 30 33 pm

In fact Turf expects coordinates in WGS84 projection. You can use the new @turf/projection.toWgs84 method for the conversion (and then, if you need, the complementary @turf/projection.toMercator):

var out = turf.tin(turf.toWgs84(__yourinput__), 'target');

This the result: https://gist.github.com/anonymous/dab8fed1cfb4cac2a204a42e65deef4d

BTW @DenisCarriere it seems @turf/projection has not been added to the latest release.

0reactions
rowanwinscommented, Apr 3, 2018

Closing due to inactivity and as this isn’t really an issue with turf.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced geospatial analysis - Turf.js
Takes a set of points and returns a concave hull Polygon or MultiPolygon. Internally, this uses turf-tin to generate geometries. Arguments. Argument, Type ......
Read more >
Chapter 12 Client-side Geoprocessing | Introduction to Web ...
In the case of turf.tin , the input should be a point layer, and the output is a polygonal layer with the resulting...
Read more >
feature request: finding maximum convex hull #1524 - GitHub
I want find maximum convex hull of a polygon without breaking into ... may not always produce points exactly from the original polygons...
Read more >
Error in Min. Bounding Geometry results - GIS Stack Exchange
Bound Polygon to create a convex hull on points that were consistently creating crazy circles. Convex Hull created seemingly reasonable results.
Read more >
25.1.18. Vector geometry - QGIS Documentation
This algorithm does not dissolve overlapping geometries - they will ... or greater than the number of points will result in a convex...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found