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
import requests | |
import bz2 | |
from time import sleep | |
def overpass2bz2(request, filename): | |
resp = requests.get('https://overpass-api.de/api/interpreter', data={'data': u"""[out:xml][timeout:180];(%s);(._;>;);out meta;""" % request}, raw_response=True) | |
sleep(15) | |
if resp.status_code != 200: | |
print resp.status_code, resp.reason |
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
drop table if exists density_streets cascade; | |
create table density_streets as | |
with | |
-- сначала выбираются линии, на которых нужные нам тэги | |
-- они объединяются в один объект (MultiLineString) | |
lines as ( | |
select st_union(way) way | |
from rd_line | |
where | |
highway in ('trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.