-
Notifications
You must be signed in to change notification settings - Fork 942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New module proposal: Transform #747
Comments
Love it!! Big +1 👍 for me |
I believe all these modules should support all geometries. |
Should |
Well, if no rotation point was given, a |
Good question, not too sure which one would be best for this, maybe having a |
Same for |
I think by default it should use Maybe @morganherlocker or @mourner can weigh in on the |
Love this proposal. One very minor suggestion is that we put all of these in a "Translation" category, and make the names
User supplied pivot point is a great idea. If we provide a default, it should be the fastest, most neutral one. In my opinion, this is |
@morganherlocker do you mean like a single module?
Even though the concept is quite similar, often I guess even the same output, I believe |
Turf has high level categories that each module falls into. ie: http://turfjs.org/docs/#transformation Each of these proposed modules would be individual modules belonging to a single category.
Agree. Putting these in the existing Transformation category makes sense.
👍 |
A few thoughts:
|
@dpmcmlxxvi the implementation in 3D would not be an issue at all I think. I wonder however if that third dimension would be actually "appropriate" to From the specs I'd say we're talking about 0 to 2D space:
and also:
Apply different scale in different dimensions is definitely a useful option 👍 In my understanding of the module setup I'd say a single module per function would be consistent with the library format. I vote for |
@stebogit The dimensionality of the geometries is not the same as the dimensionality of the space in which they are embedded. A 0-dimensional point can represent a 1D, 2D, or 3D coordinate. Same goes for a line and polygon. Also, agreed that height is optional in the spec. Though, since this is a new module and the implementation would be starting from scratch I think it would be helpful to keep the full spec in mind, even if not all the bells and whistles are implemented in the first draft. |
Very true! I was thinking about the actual representation of the geometries on a (2D) map. Again, I'm all in for 3 coordinates support! 🌐 🌎 |
My 👍 votes for the following:
|
@DenisCarriere @dpmcmlxxvi I'm working on the I believe both are "natural" ways of picturing a scaling, like one would do with any drawing software when enlarging/shrinking an object (i.e. like I did to create these images). |
👍 Love the diagrams! We should try to post these somewhere |
Woot 🎉 #759 |
Inspired by PR #729 and the necessity to use a rotated
gridPoint
asturf-isobands
input, I'd like to implement the following basic transformation functions, if of interest inTurf
:@turf/transform-translate
distance
kilometers (orunits
) on a specificdirection
angle@turf/transform-scale
factor
.@turf/transform-rotate
angle
degrees around a fixedpoint
(default to its center/center of mass/centroid)Geometry Support
Geometry|Feature<Point>
=>Feature<Point>
Geometry|Feature<LineString>
=>Feature<LineString>
Geometry|Feature<Polygon>
=>Feature<Polygon>
Geometry|Feature<MultiPoint>
=>Feature<MultiPoint>
Geometry|Feature<MultiLineString>
=>Feature<MultiLineString>
Geometry|Feature<MultiPolygon>
=>Feature<MultiPolygon>
The text was updated successfully, but these errors were encountered: