Skip to main content
added 158 characters in body
Source Link
Taras
  • 33.9k
  • 4
  • 73
  • 148

If using QGIS, you can use expressions with Geoemtry Generator"Geometry Generator" or Geometry by expression"Geometry by expression" - see here for details.

The function extend()extend() extends the start and end of a linelinestring geometry by a specified amount.

If you already have a line, just use extend ([line_geometry], 0, [distance]) to extend it at the second point. If working on a point layer, use this expression:

extend (
    make_line (
        geometry(get_feature_by_id(@layer, 1)),
        geometry(get_feature_by_id(@layer, 2))
    ),
    0,1
)

As your layer seems to be in WGS84, units are in degrees, so no meaningful distance values are possible. First reproject the layer to a geographic CRS apt for measurements in your area of interest - e.g. the local UTM zone.

If using QGIS, you can use expressions with Geoemtry Generator or Geometry by expression - see here for details.

The function extend() extends a line.

If you already have a line, just use extend ([line_geometry],0,[distance]) to extend it at the second point. If working on a point layer, use this expression:

extend (
    make_line (
        geometry(get_feature_by_id(@layer, 1)),
        geometry(get_feature_by_id(@layer, 2))
    ),
    0,1
)

As your layer seems to be in WGS84, units are in degrees, so no meaningful distance values are possible. First reproject the layer to a geographic CRS apt for measurements in your area of interest - e.g. the local UTM zone.

If using QGIS, you can use expressions with "Geometry Generator" or "Geometry by expression" - see here for details.

The function extend() extends the start and end of a linestring geometry by a specified amount.

If you already have a line, just use extend([line_geometry], 0, [distance]) to extend it at the second point. If working on a point layer, use this expression:

extend (
    make_line (
        geometry(get_feature_by_id(@layer, 1)),
        geometry(get_feature_by_id(@layer, 2))
    ),
    0,1
)

As your layer seems to be in WGS84, units are in degrees, so no meaningful distance values are possible. First reproject the layer to a geographic CRS apt for measurements in your area of interest - e.g. the local UTM zone.

Source Link
Babel
  • 74.9k
  • 15
  • 87
  • 227

If using QGIS, you can use expressions with Geoemtry Generator or Geometry by expression - see here for details.

The function extend() extends a line.

If you already have a line, just use extend ([line_geometry],0,[distance]) to extend it at the second point. If working on a point layer, use this expression:

extend (
    make_line (
        geometry(get_feature_by_id(@layer, 1)),
        geometry(get_feature_by_id(@layer, 2))
    ),
    0,1
)

As your layer seems to be in WGS84, units are in degrees, so no meaningful distance values are possible. First reproject the layer to a geographic CRS apt for measurements in your area of interest - e.g. the local UTM zone.