Skip to content

Instantly share code, notes, and snippets.

@gpprojekt-marcin
Last active March 13, 2020 14:30
Show Gist options
  • Save gpprojekt-marcin/2d4ad381feabb51206cc7acaf1d620e0 to your computer and use it in GitHub Desktop.
Save gpprojekt-marcin/2d4ad381feabb51206cc7acaf1d620e0 to your computer and use it in GitHub Desktop.
Linie rozgraniczające nieprzebiegające po granicach działek
SELECT row_number() OVER () rn, *
FROM (
SELECT (ST_Dump(ST_Difference(ST_Snap(luse, lparcels, tolerance), lparcels))).*
FROM (
SELECT
ST_Union(DISTINCT land_use_only.geom) AS luse,
ST_Union(DISTINCT land_parcels_only.geom) AS lparcels,
1e-5 AS tolerance
FROM (
SELECT
ST_Boundary(geom) AS geom FROM tereny
EXCEPT
SELECT ST_Boundary(geom) AS geom FROM "EGiB".gesdzi_2180
) land_use_only,
(
SELECT ST_Boundary(geom) AS geom FROM "EGiB".gesdzi_2180
EXCEPT
SELECT ST_Boundary(geom) AS geom FROM tereny
) land_parcels_only
) distinct_lines
) new_lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment