OGRLINEREF(1)
π OGRLINEREF(1) π
okay bestie, gather round, because this is the GDAL tool that does linear referencing and honestly? it eats. it's the ogrlineref utility, and by the end of this page you're gonna be obsessed. no cap.
β¨ NAME β¨
ogrlineref β create a linear reference and do some calculations with it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
ogrlineref [--help] [--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 π¦
so like⦠what does ogrlineref actually do? here's the tea, the program can be used to:
- create a linear reference file from input data β¨
- return the "linear referenced" distance for the projection of the input coordinates (point) on the path π
- return the coordinates (point) on the path according to the "linear referenced" distance πΊοΈ
- return the portion of the path according to the "linear referenced" begin and end distances βοΈ
the ogrlineref utility creates a linear reference β a file containing segments of a certain length (e.g. 1 km in reference units, like, imagine that π
). the user can get coordinates, linear referenced distances or sublines (subpaths) from this file. the utility does not require the M or Z components in the geometry. the results can be stored in any OGR supported format. also some information is written to the stdout. slay.
π the options, one by one, no skips π
--helpβ shows this help message and exits. bye bestie π--help-generalβ gives a brief usage message for the generic GDAL commandline options and exits. the normie GDAL stuff.-progressβ show progress. we love a progress bar, it's giving main character energy π₯-q,--quietβ suppress progress messages and other non-error output. silent but deadly fr fr π-f <format_name>β select an output format name. the default is to create a shapefile. classic, iconic, timeless.-dsco <NAME>=<VALUE>β dataset creation option (format specific). one of these per thing, use as many as you need.-lco <NAME>=<VALUE>β layer creation option (format specific).-createβ create the linear reference file (linestring of parts). the whole point, honestly π-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). very important for keeping your roads apart, no merging drama π-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. matchy matchy π-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. measure twice, cut once, periodt β¨-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. a little slice of path, as a treat π-mb <position>β the input begin linear distance.-me <position>β the input end linear distance.
π RETURN STATUS CODE π
the program returns status code 0 in case of success, and non-zero in case of error. and no, bestie, don't panic β non-blocking errors emitted as warnings are considered as a successful execution. π«Ά
π EXAMPLES π
Example 1
this example would create a shapefile (parts.shp) containing a data needed for linear referencing (1 km parts). look at her go:
ogrlineref -create -l roads.shp -p references.shp -pm dist -o parts.shp -s 1000 -progress
π AUTHOR π
Dmitry Baryshnikov <polimax@mail.ru>
π COPYRIGHT π
1998-2026
and that's the whole page, bestie β written by Dmitry Baryshnikov and brought to you from the GDAL OGRLINEREF(1) era, dated Aug 18, 2026. go reference some lines, you absolute icon. ily, bye π
β¨ππ¦πΈ
π¦ where this page comes from
- alpine 3.24: gdal-doc 3.13.3-r0 Β· MIT
- arch rolling: gdal 3.13.3-6 Β· MIT
- ubuntu stonking: gdal-bin 3.13.3+dfsg-1ubuntu4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms