Skip to content

Instantly share code, notes, and snippets.

View rveciana's full-sized avatar
🐢

Roger Veciana i Rovira rveciana

🐢
View GitHub Profile
@rveciana
rveciana / .block
Last active November 8, 2018 07:17 — forked from mbostock/.block
Armadillo projection with New Zealand
license: gpl-3.0
@rveciana
rveciana / README.md
Last active April 2, 2023 20:23 — forked from danswick/index.html
Using Turf to measure how far a line travels through a polygon in modern turf.js

Example to ilustrate this question at gis.stackoverflow.

The solution is using a combination of lineIntersect and lineSlice. The first one gives the points where the line and the polygon intersect. The second takes the part of the polyline btween the two points.

If the result is more complex (i.e. the resulting intersection is a polyline), the algorithm should be repeated for each part in the polygon.

@rveciana
rveciana / .block
Last active November 9, 2016 20:49 — forked from mbostock/.block
Canvas & svg-path-properties Point-Along-Path Interpolation
license: gpl-3.0
@rveciana
rveciana / .block
Last active May 9, 2016 06:33 — forked from martgnz/.block
Playing with spam.js
license: mit
border: none
height: 1000