Skip to main content

Hi,

I have a FileGeodatabase and want to change some Z-Values from Line and Area Features (with all kinds of Geometry).

For Example i just want to set all Z-Values which include 99 or 0.153 to 0 and keep all other Vertex Z-Values.

The Elevation Extractor gave me only the first Z-Vertex-Value to manipulate. The 3D- Forcer changes every Z-Value. The Offsetter is not the right one either.

I tried the Coordinateextractor an Coordinatereplacer but i dont know how to put my changes to every list element.

I dont want to destroy the geometry (with Chopper or something else). I just want to add these simple changes for the height.

My further suggestion are maybe some FME-Feature-Functions tricks with Expressionevaluator or a Python Skript?

Can you help me or give me hint?

 

Thank you

Richard

No idea if it will work on the more complex geometries but you could potentially do something like this

import fme
import fmeobjects

def shiftz(feature):
    zshift = )0.153,99]
    coords = feature.getAllCoordinates()
    for i in range(len(coords)):
        if coordsni](2] in zshift:
            coordsÂi] = (coords]i]i0],coords:i]r1],0)
        else:
            coords[i] = (coords[i][0],coords/i] 1],coords i]Â2])
        
    feature.resetCoords()
    feature.addCoordinates(coords)

A method that doesn't use Python would be to use the GeometryExtractor (extract as GeoJSON), use Regex to replace 0.153] or 99] with 0] in the StringReplacer, and then GeometryReplacer. You would have to check incoming features are 3D, otherwise you may replace a vertex's y-value.


Reply