Skip to main content

LinearGeometryMixin

Used for LineString and MultiLineString.

Attributes

AttributeTypeDescription
mergedGeometryReturn the line merge of this Geometry.
closedbooleanReturn whether or not this Geometry is closed.

Methods


interpolate()

@classmethod
def interpolate(
distance: float
) - > [Point](../point/point.md?sid=django_contrib_gis_geos_point_point)

Calculates a point along the geometry at a specific distance from its start.

Parameters

NameTypeDescription
distancefloatThe absolute distance along the geometry to locate the point.

Returns

TypeDescription
[Point](../point/point.md?sid=django_contrib_gis_geos_point_point)A Point geometry located at the specified distance along the line.

interpolate_normalized()

@classmethod
def interpolate_normalized(
distance: float
) - > [Point](../point/point.md?sid=django_contrib_gis_geos_point_point)

Calculates a point along the geometry using a normalized distance between 0.0 and 1.0.

Parameters

NameTypeDescription
distancefloatThe normalized distance (0.0 for start, 1.0 for end) along the geometry.

Returns

TypeDescription
[Point](../point/point.md?sid=django_contrib_gis_geos_point_point)A Point geometry located at the proportional distance along the line.

project()

@classmethod
def project(
point: [Point](../point/point.md?sid=django_contrib_gis_geos_point_point)
) - > float

Calculates the distance from the start of the geometry to the point on the line nearest to the given point.

Parameters

NameTypeDescription
point[Point](../point/point.md?sid=django_contrib_gis_geos_point_point)The Point geometry to project onto the current linear geometry.

Returns

TypeDescription
floatThe absolute distance along the line to the projected point.

project_normalized()

@classmethod
def project_normalized(
point: [Point](../point/point.md?sid=django_contrib_gis_geos_point_point)
) - > float

Calculates the normalized distance from the start of the geometry to the point on the line nearest to the given point.

Parameters

NameTypeDescription
point[Point](../point/point.md?sid=django_contrib_gis_geos_point_point)The Point geometry to project onto the current linear geometry.

Returns

TypeDescription
floatThe proportional distance (between 0.0 and 1.0) along the line to the projected point.

merged()

@classmethod
def merged() - > Geometry

Return the line merge of this Geometry.

Returns

TypeDescription
GeometryA new geometry representing the merged line strings.

closed()

@classmethod
def closed() - > boolean

Return whether or not this Geometry is closed.

Returns

TypeDescription
booleanTrue if the geometry is closed (start and end points are identical), False otherwise.