I have a Spatialite Database and I've imported OSM Data into this database. With the following query I get all motorways:
SELECT * FROM lines
WHERE other_tags GLOB '*A [0-9]*'
AND highway='motorway'
I use GLOB '*A [0-9]*'
here, because in Germany every Autobahn begins with A, followed by a number (like A 73).
There is a column called other_tags
with information about the motorway part:
"bdouble"=>"yes","hazmat"=>"designated","lanes"=>"2","maxspeed"=>"none","oneway"=>"yes","ref"=>"A 73","width"=>"7"
If you look closer there is the part "ref"=>"A 73"
.
I want to extract the A 73
as the name for the motorway.
How can I do this in sqlite?