geoprimsField-grade geospatial math

Parallel transects across a polygon

Survey lines at a set spacing and bearing across a polygon, clipped to it, with a random start from a seed, each line's length and the total, and a zigzag route joining them if asked.

Experimental: not yet fully verified. How results are checked

7

7 transects, 2,390.972 m in all.

Transects
TransectLengthStart latitudeStart longitudeEnd latitudeEnd longitude
1341.561 m40.0029622 deg-105.0000000 deg40.0029622 deg-104.9960000 deg
2341.563 m40.0025119 deg-105.0000000 deg40.0025119 deg-104.9960000 deg
3341.565 m40.0020616 deg-105.0000000 deg40.0020616 deg-104.9960000 deg
4341.567 m40.0016113 deg-105.0000000 deg40.0016113 deg-104.9960000 deg
5341.570 m40.0011610 deg-105.0000000 deg40.0011610 deg-104.9960000 deg
6341.572 m40.0007107 deg-105.0000000 deg40.0007107 deg-104.9960000 deg
7341.574 m40.0002604 deg-105.0000000 deg40.0002604 deg-104.9960000 deg
Lines
LineLatitudeLongitude
140.0029622 deg-105.0000000 deg
140.0029622 deg-104.9960000 deg
240.0025119 deg-105.0000000 deg
240.0025119 deg-104.9960000 deg
340.0020616 deg-105.0000000 deg
340.0020616 deg-104.9960000 deg
440.0016113 deg-105.0000000 deg
440.0016113 deg-104.9960000 deg
540.0011610 deg-105.0000000 deg
540.0011610 deg-104.9960000 deg
640.0007107 deg-105.0000000 deg
640.0007107 deg-104.9960000 deg
740.0002604 deg-105.0000000 deg
740.0002604 deg-104.9960000 deg
Total length
Start offset
Seed
Plane
Provenance
Computed by
geometry.sampling.transects 1.0.0, core 0.1.0
Model
On the UTM plane: lines at the grid bearing (true bearing less the meridian convergence at the polygon's center), spaced by the ground spacing times the zone's point scale there, the first at a random fraction of the spacing (one draw) from the polygon's edge on the left of the lines' direction; each line clipped to the polygon by its crossings with every ring; lengths are geodesic; a zigzag joins each part's end to the next part's start, reversing every other line (Buckland et al. 2015)
Accuracy
Lines are the spacing apart on the ground at the polygon's center, to within the change in UTM scale across it; lengths are geodesic to a millimeter
Notes
1 shown with the answer
Cites
Buckland, S. T., Rexstad, E. A., Marques, T. A., and Oedekoven, C. S., Springer, Distance Sampling: Methods and Applications; Blackman, D., and Vigna, S., ACM Transactions on Mathematical Software, Scrambled linear pseudorandom number generators

Something look off?

Your values

Showing an example. Change anything.
KML, KMZ, GPX, GeoJSON, CSV, WKT, or WKB — or drop it on the box. Read on this device.
More options 2
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: On the UTM plane: lines at the grid bearing (true bearing less the meridian convergence at the polygon's center), spaced by the ground spacing times the zone's point scale there, the first at a random fraction of the spacing (one draw) from the polygon's edge on the left of the lines' direction; each line clipped to the polygon by its crossings with every ring; lengths are geodesic; a zigzag joins each part's end to the next part's start, reversing every other line (Buckland et al. 2015)

Show your work

  1. Lines

    parallel at the grid bearing, the spacing apart, from a random start

    50 m apart at 90° true, start 4.193 m in = 7 parts on 7 lines

  2. Transects

    lines that cross the polygon

    2,390.972 m in all = 7

The same steps an agent gets from the MCP server with explain: true.

Accuracy: Lines are the spacing apart on the ground at the polygon's center, to within the change in UTM scale across it; lengths are geodesic to a millimeter

When to use this: Use this to plan line transects for a wildlife count, a vegetation survey, or a walk-over search: lines at an even spacing across the site with a random start, so the design is a probability sample. Choose the zigzag to get one continuous route.

Limitations: Lines are straight on the UTM plane, which over a few kilometers differs from a geodesic by far less than a field crew can walk. A line the polygon cuts in two (around a hole or a bay) becomes two parts. At most 10,000 transects.

Worked example: East-west lines 50 m apart across a field, seed 42. Source: A 340 m × 333 m field.

You enter

Bearing
90 deg
Polygon
40, -105 40, -104.996 40.003, -104.996 40.003, -105
Seed
42
Spacing
50 m

You get

Transects
7
Total length
2,390.972 m
Start offset
4.193 m
Seed
42
Plane
UTM zone 13N (WGS 84)

Review: Not yet independently reviewed by a GIS professional.

Last verified: 2026-10-20, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.0.0, core 0.1.0. See this tool in the verification report.

Checked against: 21 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Experimental means this tool has not yet met the stable bar: at least 20 golden vectors, differential tests, and an independent worked example.