LinearGeometryMixin
Used for LineString and MultiLineString.
Attributes
| Attribute | Type | Description |
|---|---|---|
| merged | Geometry | Return the line merge of this Geometry. |
| closed | boolean | Return 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
| Name | Type | Description |
|---|---|---|
| distance | float | The absolute distance along the geometry to locate the point. |
Returns
| Type | Description |
|---|---|
[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
| Name | Type | Description |
|---|---|---|
| distance | float | The normalized distance (0.0 for start, 1.0 for end) along the geometry. |
Returns
| Type | Description |
|---|---|
[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
| Name | Type | Description |
|---|---|---|
| point | [Point](../point/point.md?sid=django_contrib_gis_geos_point_point) | The Point geometry to project onto the current linear geometry. |
Returns
| Type | Description |
|---|---|
float | The 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
| Name | Type | Description |
|---|---|---|
| point | [Point](../point/point.md?sid=django_contrib_gis_geos_point_point) | The Point geometry to project onto the current linear geometry. |
Returns
| Type | Description |
|---|---|
float | The 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
| Type | Description |
|---|---|
Geometry | A new geometry representing the merged line strings. |
closed()
@classmethod
def closed() - > boolean
Return whether or not this Geometry is closed.
Returns
| Type | Description |
|---|---|
boolean | True if the geometry is closed (start and end points are identical), False otherwise. |