line offset is misaligned
See original GitHub issueI used https://cdn.jsdelivr.net/npm/@turf/turf@5/turf.min.js
var line = {'type': 'LineString', 'coordinates': [
[
19.925,
50.0555
],
[
19.924,
50.055
]
]}
var a = turf.lineOffset(line, 50/1000, {units: 'kilometers'})
var b = turf.lineOffset(line, -50/1000, {units: 'kilometers'})
console.warn({'type': 'MultiLineString', 'coordinates': [line.coordinates, a.geometry.coordinates, b.geometry.coordinates]})
produces
while I would expect what is here marked with a blue lines to be produced as offsets
Not sure whether it is a bug or I misunderstood documentation http://turfjs.org/docs/#lineOffset
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Types of Common Misalignment: How to Recognise & Fix Them
This is a compound misalignment that occurs when one shaft is both offset and angled differently than the other shaft along a horizontal...
Read more >misaligned offset notes | MuseScore
When adjusting a second voice to beam between two staves, the alignment of the first and second voices superimposes them instead of offsetting...
Read more >help with misaligned offset : r/cricut - Reddit
Another thing to try, and I know it sounds strange, but when you go to make the project, in the preview, rotate it...
Read more >Shaft Alignment Concepts: Offset & Angularity - YouTube
Shaft alignment of rotating equipment is an essential part of machinery maintenance. This machine shaft alignment video presents the ...
Read more >4 Ways to Diagnose and Correct Shaft Misalignment
Misalignment occurs when two rotating shafts are not parallel to one another, whether it be an offset or an angular gap at the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s my code to get correct parallel line with more than 2 points :
I had the same issue, I even tried the code above, i.e. the getLineOffset function and when compared to the
lineOffset
function, there is actually very little difference, see the attached screenshots. Note, this is using a mercator projection.I then graphed the output of the above function getLineOffset in desmos and I get the following:
So the problem I’m having in my case is that I’m displacing the units in geographic coordinates and that shift doesn’t work in Mercator. So I will need to shift in mercator space. Unless I’ve missed something.