So let me try to understand this: you have a set of points (X/Y vertices) and a bunch of Z values (of which some values are missing), right? The question then is: are the Z profile values already in the same order as the route points? In that case you can add a Counter for both feature types and just join on the count attribute using the FeatureMerger.
So then you will end up with some vertices that don't have a Z value of which you would like to interpolate a proper height. Filter out these these vertices (using a Tester) and then use a
PointConnector (be sure to use a Sorter on the count attribute first) on the vertices that
do have Z values to create a 3D polyline. Now use a
PointOnLineOverlayer and connect the vertices
without Z values to the Point port and the 3D polyline to the Line port. The features leaving the Point output port will be 3D now and should have an interpolated Z value.
If you don't want the vertices to be 3D, just use a CoordinateExtractor to get the Z value, followed by a 2DForcer and you're done.
So let me try to understand this: you have a set of points (X/Y vertices) and a bunch of Z values (of which some values are missing), right? The question then is: are the Z profile values already in the same order as the route points? In that case you can add a Counter for both feature types and just join on the count attribute using the FeatureMerger.
So then you will end up with some vertices that don't have a Z value of which you would like to interpolate a proper height. Filter out these these vertices (using a Tester) and then use a
PointConnector (be sure to use a Sorter on the count attribute first) on the vertices that
do have Z values to create a 3D polyline. Now use a
PointOnLineOverlayer and connect the vertices
without Z values to the Point port and the 3D polyline to the Line port. The features leaving the Point output port will be 3D now and should have an interpolated Z value.
If you don't want the vertices to be 3D, just use a CoordinateExtractor to get the Z value, followed by a 2DForcer and you're done.
@sander_s Not exactly.....
On my profile i have only Z values for every 40meters.....
So i have divided my route in 40meters segments.....give the Z values and the points of these segment and ID with the counter and merge them...that worked fine.....result i have every 40 meters points on the route with a Z_value....
Now i want to add the vertices, because i cant do that before because then i lose the exactly order for the join with the profile because vertices are in between.
So i want to add the vertices now.....but how that i dont lose the right order on the route (means e.g.
vertice 1 vertice 2 40mpoint 1 vertice3 40mpoint2 etc....)
and when i have this order i have point with Z values (40m points) and without (vertices) and the i will interpolate (if its possible)
Greetz
Franco
So let me try to understand this: you have a set of points (X/Y vertices) and a bunch of Z values (of which some values are missing), right? The question then is: are the Z profile values already in the same order as the route points? In that case you can add a Counter for both feature types and just join on the count attribute using the FeatureMerger.
So then you will end up with some vertices that don't have a Z value of which you would like to interpolate a proper height. Filter out these these vertices (using a Tester) and then use a
PointConnector (be sure to use a Sorter on the count attribute first) on the vertices that
do have Z values to create a 3D polyline. Now use a
PointOnLineOverlayer and connect the vertices
without Z values to the Point port and the 3D polyline to the Line port. The features leaving the Point output port will be 3D now and should have an interpolated Z value.
If you don't want the vertices to be 3D, just use a CoordinateExtractor to get the Z value, followed by a 2DForcer and you're done.
@sander_s so with Measure on an attribute i could sort the whole points on thi sattribute right?
and the i can interpolate?
Greetz
Franco
@sander_s but the interpolation can not work in this way because a vertice can be outside the line which is connected between 2 40m points (e.g. when route turns 90 degrees between them)
Greetz
Franco
I have all points together now in the right order sorted by point measure....
some point shave Z values (were merged with profile) and some point inbetween has no z values.......
(screenshot).... from the right...point1 and point 4 has Z values point 2 and point 3 not!
how can i give now these points also a z_value (interpolated?)
Greetz
Franco
@sander_s but the interpolation can not work in this way because a vertice can be outside the line which is connected between 2 40m points (e.g. when route turns 90 degrees between them)
Greetz
Franco
Okay, it's still a bit vague to me, but I believe you have two sets of vertices then: one with Z values (that are exactly on the route) and one set of vertices that are closeby, but not on the route.
Maybe you could use a
NeighborFinder (or
NeighborPairFinder) to find the closest vertex (or closest 2 vertices) for each Z point? The nice thing about the NeighborPairFinder is that it calculates a distance and angle to the closest 2 points, so that will give you some control over which point should be chosen for the join (in those cases where the route turns 90 degrees).
Does this help you?
Okay, it's still a bit vague to me, but I believe you have two sets of vertices then: one with Z values (that are exactly on the route) and one set of vertices that are closeby, but not on the route.
Maybe you could use a
NeighborFinder (or
NeighborPairFinder) to find the closest vertex (or closest 2 vertices) for each Z point? The nice thing about the NeighborPairFinder is that it calculates a distance and angle to the closest 2 points, so that will give you some control over which point should be chosen for the join (in those cases where the route turns 90 degrees).
Does this help you?
@sander_s.......i have added a screenshot.....all vertices are on the route already......
red line is route on screenshot.....some vertices like the one on the right and on the left side have Z values....the two inbetween not.
Ho can i now give them Z values also?
Thx for help and greetz
Franco
I have all points together now in the right order sorted by point measure....
some point shave Z values (were merged with profile) and some point inbetween has no z values.......
(screenshot).... from the right...point1 and point 4 has Z values point 2 and point 3 not!
how can i give now these points also a z_value (interpolated?)
Greetz
Franco
Now that they are in the right order, you need to make sure that the red line is 1 polyline (use the LineJoiner if it's not). Then follow my instructions above, starting from "Now use a PointOnLineOverlayer...", but first use the vertices with a Z value as input. Now the polyline should come out as a couple of 3D lines. Finally, repeat this again but now with the vertices without Z values as input points and the 3D lines as input lines. After this, the vertices should have interpolated Z values.
@sander_s.......i have added a screenshot.....all vertices are on the route already......
red line is route on screenshot.....some vertices like the one on the right and on the left side have Z values....the two inbetween not.
Ho can i now give them Z values also?
Thx for help and greetz
Franco
Yes, I saw that and I replied to it.
Do you know you can actually edit a message you previously posted..? Just a tip
@sander_s first PoinOnlineOverlayer gives me NOT a couple of 3D Lines...only one line, maybe two with no attributes at all....
It works not very well
@sander_s first PoinOnlineOverlayer gives me NOT a couple of 3D Lines...only one line, maybe two with no attributes at all....
It works not very well
You might need to play with the point tolerance. Setting it to 0 means that the point needs to be exactly on the line. A value of 1 means within 1 meter (or whatever unit you are working with) from the line, etc.
Also note that we are not interested in attributes for the lines. We just need the Z values from it (that are stored as part of the geometry, not in the attributes).
Otherwise, just post the data here...
Btw.. which FME version are you using?
@sander_s FME 2016..points are exactly on the line
i need as an output an excel sheet.....my result at the moment is this (screenshot)
as you see some points (Run in first column) has Z Values some not...order from the points is already right...screenshot 2 is my workbench at the moment pipe reader is the route......other reader is the layer from the text in profile
is there an easier way?
output is good for me except these missing Z Values between
Greetz
FRanco
Have you tried the MeasureOrZValueInterpolator
@Mark2AtSafe no i haven't because i've read it only works with lines...how does it works?
Greetz
Franco
i need as an output an excel sheet.....my result at the moment is this (screenshot)
as you see some points (Run in first column) has Z Values some not...order from the points is already right...screenshot 2 is my workbench at the moment pipe reader is the route......other reader is the layer from the text in profile
is there an easier way?
output is good for me except these missing Z Values between
Greetz
FRanco
If it's a one-time-only thing, you could interpolate the values in Excel, which is probably the quickest solution in that case, even if you have 10 sheets...
Otherwise, it's going to be a bit more tricky. I would collect all Z values in order and then use a PythonCaller to interpolate the missing values in the list. Then you could explode the list again and join those Z values back to the original points by index.
The problem is that FME cannot easily look ahead or back in the pipeline, so either way you'd have to collect a list of all Z values (in order) and do the math yourself.
@Mark2AtSafe no i haven't because i've read it only works with lines...how does it works?
Greetz
Franco
See here. Click on "Usage".
@Mark2AtSafe no i haven't because i've read it only works with lines...how does it works?
Greetz
Franco
Sorry, from your comment and screenshot earlier I thought you had created lines out of these. Once you do that, yes, this transformer would probably do what you want. It interpolates between known Z values to create ones for vertices that don't have it.
In the help it says:
This transformer is helpful in cases where only some of the vertices of a feature are populated. The rest will have their values interpolated.
...which is what I thought you were trying to achieve. So if you can create lines it should work for you.
Hi Guys
i have now created a 3D Polyline with the points which has no Z_values and the points which has Z_values.......but thats not the right way because then i get 0 Z_values (with Poinonlineoverlayer or MeasureZinterpolator)
i can't create the polyline only with the points WITH Z_values because then the other point with NO Z Values are not on the route anymore
Can't find a way to finish that
Greetz
Franco
@franco69
Hi,
I suggest to use the points with z as input for a surfacemodeller.
Use the route_lines buffered as the breaklines input.
From the routes take the zero Z objects and use these on the drapefeatures input.
The draped_features output will give you the interpolated Z-values you are looking for. (as they are the same x,y as input..just with added z value)
see pic. (i was actualy doing this right now for heights of road centerlines per 20m intervals..)