Skip to content
Jason Humber edited this page Sep 22, 2026 · 3 revisions

Features

calculate_missing_z_values

Calculates missing Z values for lines or polygons based on linear interpolation in the XY plane. The matcher function is used to identify Z values that are missing, it must return a Boolean array.

from fudgeo import FeatureClass, GeoPackage
from numpy import isfinite
from spyops.threed import calculate_missing_z_values

def matcher(zs):
    """
    Z Values to be handled as missing
    """
    return ~isfinite(zs)

gpkg = GeoPackage('/some/path/ntdb_zm.gpkg')
source = gpkg['transmission_z_l']

target = FeatureClass(geopackage=gpkg, name='transmission_p')
fc = calculate_missing_z_values(source, matcher=matcher)

generate_points_along_3d_lines

Create points along lines (linear rings) at the specified intervals based on the specified placement option.

Placement option DISTANCE creates points at the specified distance interval, e.g. 100 metres will be placed at 200, 300, 400 meters, etc. as measured along the lines in 3D.

Placement option PERCENTAGE creates points at the specified percentage interval e.g. 15 percent will be placed at 15, 30, 45, 60, 75, and 90 percent of the 3D line length.

Placement option FIELD creates points differently based on the field data type and field value.

  • Numeric fields are treated as being distances defined in the same units as the source feature class spatial reference. For example, a value of 200 will be handled as 200 meters if the source feature class spatial reference is in meters.
  • Text fields are treated as linear units and can contain one or more values separated by semicolons. If there is only one value in the text field, then it will be handled as an interval, for example, the string value '50 feet' will be used to repeat points along the linear feature at 50 ft intervals (e.g. 50, 100, ... 200, 250 ft, etc.) If there are multiple values in the text field, then they will be treated as a list of specific distances, for example, the string value '50 feet;175 feet' will be used to place two points, one at 50 ft and the other at 175 ft.
  • Units for text values can be mixed across features and within the same field. For example, the string value '50 feet;175 meters' will be used to place two points, one at 50 ft and the other at 175 meters. If a unit value is missing, then it will be assumed to be in the same units as the source feature class spatial reference.
from fudgeo import FeatureClass, GeoPackage
from spyops.threed import generate_points_along_3d_lines

gpkg = GeoPackage('/some/path/ntdb_zm.gpkg')
source = gpkg['transmission_z_l']

target = FeatureClass(geopackage=gpkg, name='transmission_p')
fc = generate_points_along_3d_lines(source, target=target, placement='200 m', include_ends=True)

Clone this wiki locally