OGRLINEREF(1)

πŸ“¦
version 3.4.3 Β· 2 versions
, in epel 9

πŸ’– NAME πŸ’–

ogrlineref (aka OGRLINEREF(1)) is your GDAL bestie for creating a linear reference and doing some calculations with it. Like, it makes the whole linear-referencing thing actually make sense, fr fr. πŸ’…

✨ SYNOPSIS ✨

   ogrlineref [--help-general] [-progress] [-quiet]
          [-f format_name] [[-dsco NAME=VALUE] ...] [[-lco NAME=VALUE]...]
          [-create]
          [-l src_line_datasource_name] [-ln layer_name] [-lf field_name]
          [-p src_repers_datasource_name] [-pn layer_name] [-pm pos_field_name] [-pf field_name]
          [-r src_parts_datasource_name] [-rn layer_name]
          [-o dst_datasource_name] [-on layer_name]  [-of field_name] [-s step]
          [-get_pos] [-x long] [-y lat]
          [-get_coord] [-m position]
          [-get_subline] [-mb position] [-me position]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so the ogrlineref program can be used for:

  • creating a linear reference file from input data
  • returning the "linear referenced" distance for the projection of the input coordinates (point) on the path
  • returning the coordinates (point) on the path according to the "linear referenced" distance
  • returning the portion of the path according to the "linear referenced" begin and end distances

So ogrlineref creates a linear reference β€” literally a file full of segments of a special length (e.g. 1 km in reference units) β€” and then gets coordinates, linear referenced distances, or sublines (subpaths) from that file. The utility does not require the M or Z values in geometry. The results can be stored in any OGR supported format, and some information is also written to stdout. ✨

The flags, one by one, no skips, no cap: πŸŽ€

  • --help-general β€” Show the usage.
  • -progress β€” Show progress.
  • -quiet β€” Suppress all messages except errors and results.
  • -f <format_name> β€” Select an output format name. The default is to create a shapefile.
  • -dsco <NAME=VALUE> β€” Dataset creation option (format specific)
  • -lco <NAME=VALUE> β€” Layer creation option (format specific).
  • -create β€” Create the linear reference file (linestring of parts).
  • -l <src_line_datasource_name> β€” The path to input linestring datasource (e.g. the road)
  • -ln <layer_name> β€” The layer name in datasource
  • -lf <field_name> β€” The field name of unique values to separate the input lines (e.g. the set of roads).
  • -p <src_repers_datasource_name> β€” The path to linear references points (e.g. the road mile-stones)
  • -pn <layer_name> β€” The layer name in datasource
  • -pm <pos_field_name> β€” The field name of distances along path (e.g. mile-stones values)
  • -pf <field_name> β€” The field name of unique values to map input reference points to lines.
  • -r <src_parts_datasource_name> β€” The path to linear reference file.
  • -rn <layer_name> β€” The layer name in datasource
  • -o <dst_datasource_name> β€” The path to output linear reference file (linestring datasource)
  • -on <layer_name> β€” The layer name in datasource
  • -of <field_name> β€” The field name for storing the unique values of input lines
  • -s <step> β€” The part size in linear units
  • -get_pos β€” Return linear referenced position for input X, Y
  • -x <long> β€” Input X coordinate
  • -y <lat> β€” Input Y coordinate
  • -get_coord β€” Return point on path for input linear distance
  • -m <position> β€” The input linear distance
  • -get_subline β€” Return the portion of the input path from and to input linear positions.
  • -mb <position> β€” The input begin linear distance
  • -me <position> β€” The input end linear distance

🌈 EXAMPLE 🌈

This example would create a shapefile (parts.shp) containing the data needed for linear referencing (1 km parts):

ogrlineref -create -l roads.shp -p references.shp -pm dist -o parts.shp -s 1000 -progress

πŸ‘‘ AUTHOR πŸ‘‘

Dmitry Baryshnikov <polimax@mail.ru> β€” iconic, periodt. πŸ’–

1998-2026 β€” that's the copyright era, bestie.

xoxo from the GDAL universe πŸ’… β€” this page is dated Jan 08, 2026. 🫢

πŸ“¦ where this page comes from