I have installed openstreetmap postgis database using .osm file for Scotland using osm2pgsql. I have also imported a set of polygons of parliamentary constituencies in Scotland called 'area10' I want to find out how much cycle path distance is within each constituency. If I run this query:
The query runs indefinitely or at least for 45mins or so until my computer overheats but that is another issue... If I run this query (without 'OR' operator):
This returns within about 30 seconds: `name | roads_km
... Question: So why does using the OR operator in the WHERE clause greatly increase the time of the query? I really need to use the OR operator as there are lots of different highway= tags which I would like to include:
etc I have also tried a similar query using the h-store tag values with the same issue. Any help very much appreciated. Thank you. asked 03 Jan '15, 10:44 Hawkeye aseerel4c26 ♦ |
You have your parentheses wrong. Try
Also, you might want to do something like
to actually get the length in metres instead of Google Mercator units which are not exactly metres. answered 03 Jan '15, 10:58 Frederik Ramm ♦ 2
Thank you! It's working:
(03 Jan '15, 11:47)
Hawkeye
|