MakeLine - geopaparazzi/Spatialite-Tasks-with-Sql-Scripts GitHub Wiki

adding a POINT somewhere in a LINESTRING

--> 'List of Sql-Commands'


Original Documentation Spatialite-Functions SQL utility functions [non-standard] for geometric objects

  • MakeLine( pt1 PointGeometry , pt2 PointGeometry ) : LinestringGeometry

Goal:

  • create a new LINESTRING Geometry, connection between 2 LINESTRINGs that already exist

Showing the two LINESTRINGS to connect to

INSERT INTO berlin_ortsteil_segments
(
 soldner_segment,
 name,
 comment,
 belongs_to_01,
 belongs_to_02,
 valid_since,
 valid_until
)
VALUES
(
 MakeLine
 (
  -- select a POINT from the first LINESTRING to connect to
  (SELECT ST_StartPoint(soldner_segment) FROM berlin_ortsteil_segments WHERE id_segment = 182),
  -- select a POINT to the second LINESTRING to connect to
  (SELECT ST_StartPoint(soldner_segment) FROM berlin_ortsteil_segments WHERE id_segment = 193)
 ),
 'Tegel (Jungfernheide),Wittenau 1920',
 '',
 '1902042005,1911001202',
 '1902101003,1911000607',
 '1230-01-01',
 '1938-03-31'
);
  • After which we only need to adapt the LINESTRING, since the Start/EndPoint has already been set.

Show new LINESTRING after MakeLine


2014-04-05: Mark Johnson, Berlin Germany