Last active
September 29, 2021 08:24
-
-
Save jczaplew/a3b5e7f5ed292a4f0f62 to your computer and use it in GitHub Desktop.
Sample Along Line with PostGIS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ST_AsText(ST_LocateAlong(ST_AddMeasure(my_line, 0, ST_Length(my_line)::int), generate_series(0, ST_Length(my_line)::int))) FROM ( | |
SELECT ST_GeomFromText('LINESTRING(-121 47, -80 26)') AS my_line | |
) q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ST_AsText(ST_LocateAlong(my_line, generate_series(0, 7))) FROM (SELECT ST_AddMeasure( | |
ST_GeomFromText('LINESTRING(0 0, 0 7)'), 0, 7 | |
) AS my_line | |
) q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment