Comments (4)
Hi @leiflinse-trivector. Thanks for raising this. Could you please read #2148 and let us know how that compares to your request? It sounds like we have two requests for different behaviour from a negative offset.
from turf.
I think either clamping or a documented "from end" behavior is fine. But as it is now, it doesn't neither forbid negative input nor define what happens.
My reasoning is that when you input a distance that is longer then the total length of the line string, then it currently returns the last point, so in analogy of that was that if you "undershoot" the start by giving a negative value, it would clamp to the start.
But I also can see that the count from end behavior can be useful in some cases.
from turf.
My take on it would be, if the user passes an along value longer than the length of the line, it's probably accidental, and returning the farthest point on the line seems reasonable. If the user passes a negative value it's probably intentional and they are signalling they're specifically expecting different behaviour.
My gut feel is we would fix this according to #2148, so the behaviour is defined and no error is thrown. Is that a behaviour you'd be happy to align dart_turf with?
from turf.
I am not the maintainer of dart_turf, but if turf.js does go with #2148, I am in favor for dart_turf to use the same behavior to make transition between the two libraries easy for developers. Depending on the time frame, if it makes sense for my project, I may help on updating dart_turf.
from turf.
Related Issues (20)
- Typings doesn't work when `moduleResolution` is `bundler` HOT 4
- lineOverlap tolerance is not handled in every case
- turf.centerOfMass for multiple polygons in Feature Collection HOT 2
- booleanIntersects false positive for self-intersecting lines HOT 2
- [Bug report]: ts declaration broken HOT 2
- Could not find a declaration file for module '@turf/turf'. HOT 3
- booleanContains doesn't get good result when detect an unusual polygon HOT 1
- Typescript typing error when import "@turf/turf" HOT 2
- Can coordinate system parameters be added to some conversion methods?
- Drawing a curved line from Point A to Point B HOT 1
- Could not find a declaration file for module '@turf/mask' HOT 3
- There was a loss of accuracy when using the turf.intersect function
- BooleanWithin does not work correctly with (Island polygon / Doughnut).
- Property 'booleanPointInPolygon' does not exist on type 'TurfStatic' HOT 1
- isobands generating countered some wrong results HOT 3
- Broken TS types HOT 4
- turf.intersect(geometry 1, geometry 2) gets stuck for endless time HOT 7
- splitLineWithPoints doesn't split correctly HOT 2
- Randomly generated polygons do not comply with the right-hand rule. HOT 1
- turf.convex does not wrap the polygons as expected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turf.