Skip to content

Instantly share code, notes, and snippets.

@talaj
Created January 16, 2015 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talaj/2b0d866b750aec41edad to your computer and use it in GitHub Desktop.
Save talaj/2b0d866b750aec41edad to your computer and use it in GitHub Desktop.
Kontrola křižovatek
select count(*) from import.pm_junction_pt j
where (select 1 from import.pm_road_ln r
where routing is not null and
r.geometrie && j.geometrie and
(j.geometrie && ST_StartPoint(r.geometrie) or
j.geometrie && ST_EndPoint(r.geometrie)) limit 1) is not null;
select count(*) from import.pm_junction_pt j
where (select 1 from import.pm_road_ln r
where routing is not null and
r.geometrie && j.geometrie and
(j.geometrie && ST_StartPoint(r.geometrie) or
j.geometrie && ST_EndPoint(r.geometrie)) limit 1) is null
and (select 1 from import.pm_road_ln r
where not (ST_Buffer(j.geometrie, 5) && r.geometrie) limit 1) is null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment