Last active
August 29, 2015 14:23
-
-
Save trolleway/67e3a8fe6b49f269ae0a to your computer and use it in GitHub Desktop.
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
--Запрос выдаёт пикетные отметки по одиночной линии из таблицы trolleybus, на которых находятся магазины (из таблицы prodykty). Работает с EPSG:32637 (для Москвы) | |
SELаECT | |
row_number() OVER (ORDER BY 1) AS i, produkty."@id", | |
produkty.geom, | |
round((ST_line_locate_point(trolleybus.geom,produkty.geom) * ST_Length(trolleybus.geom)/1000)::numeric ,1) AS pk, | |
COALESCE(produkty.name,produkty.operator,produkty."@id") AS name | |
FROM produkty, trolleybus | |
WHERE ST_Intersects(produkty.geom , ST_Buffer(trolleybus.geom,500)) | |
ORDER BY pk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment