OGRLINEREF(1)
π 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. π
π COPYRIGHT π
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
- epel 9: gdal3.4 3.4.3-5.el9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms