Commit 1d1feab6 authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Update cycleway theme, fix shp exports, fix dump geom column

parent 973b3c0c
......@@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- Updated theme for shop/craft/office (add various kind of shop-like amenities, restrict offices list)
### Fixed
- Dump for theme are always using most complete geometry
- Cycleway theme is using correctly national schema (corrected categorization)
- Some warnings from ogr2ogr were not ignored correctly
## 0.2.4 - 2020-12-17
......
......@@ -318,7 +318,13 @@ function createDataFile(theme, boundary, request, options) {
// Send failure message if any
if(result.stderr.length > 0) {
// Check if it's not a warning
if(result.stderr.split('\n').filter(l => l.trim().length > 0 && !l.trim().startsWith('Warning')).length > 0) {
if(
result.stderr.split('\n').filter(l => (
l.trim().length > 0
&& !l.trim().startsWith('Warning')
&& !l.trim().startsWith('This warning')
)).length > 0
) {
throw new Error("Can't extract data from DB: "+result.stderr);
}
}
......@@ -358,14 +364,14 @@ exports.createDumpTheme = (theme, options) => {
.then(() => {
// Creates files
const promises = [
createDataFile(theme, null, `SELECT *, geom_full AS geom FROM ${tablename}`, {
createDataFile(theme, null, `SELECT geom_full AS geom, * FROM ${tablename}`, {
format: "geojson",
aspoint: false,
metadata: true,
url: `${options.baseUrl}/${theme.id}_geojson.zip`,
destinationFolder: options.destinationFolder
}),
createDataFile(theme, null, `SELECT *, geom_center AS geom FROM ${tablename}`, {
createDataFile(theme, null, `SELECT geom_center AS geom, * FROM ${tablename}`, {
format: "csv",
aspoint: true,
metadata: true,
......
......@@ -25,7 +25,7 @@
<a class="nav-link" href="/doc">API</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/dump">Exports bruts</a>
<a class="nav-link" href="/dump">Exports nationaux</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://framagit.org/PanierAvide/GeoDataMine">Code source</a>
......
--METADATA={ "name:fr": "Aménagements cyclables (schéma Étalab Aménagements cyclables 0.2.0)", "name:en": "Cycleway", "theme:fr": "Transports", "keywords:fr": [ "piste cyclable", "bande cyclable", "aménagement cyclable" ], "description:fr": "Aménagement cyclables issues d'OpenStreetMap (cycleway=* ou cycleway:right=* ou cycleway:left=* ou cycleway:both=* ou highway=cycleway)" }
--METADATA={ "name:fr": "Aménagements cyclables (schéma Étalab Aménagements cyclables 0.2.1)", "name:en": "Cycleway", "theme:fr": "Transports", "keywords:fr": [ "piste cyclable", "bande cyclable", "aménagement cyclable" ], "description:fr": "Aménagement cyclables issues d'OpenStreetMap (cycleway=* ou cycleway:right=* ou cycleway:left=* ou cycleway:both=* ou highway=cycleway)" }
--GEOMETRY=line
SELECT
......@@ -8,56 +8,132 @@ SELECT
<ADM8REF> AS code_com,
<OSMID> AS id_osm,
array_to_string(array_remove(ARRAY[t.rel_tags->'route_icn_ref', t.rel_tags->'route_ncn_ref', t.rel_tags->'route_rcn_ref', t.rel_tags->'route_lcn_ref'], NULL), ':') AS num_iti,
CASE
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.cycleway = 'lane' AND t.tags->'lanes' = '1' AND t.tags->'oneway' = 'no' THEN 'CHAUSSEE A VOIE CENTRALE BANALISEE'
WHEN t.highway = 'path' AND (t.tags->'motor_vehicle' IS NULL OR t.tags->'motor_vehicle' = 'no') AND t.bicycle IN ('yes', 'designated') THEN 'VOIE VERTE'
WHEN (t.highway = 'cycleway' AND t.tags->'foot' = 'designated' AND t.tags->'segregated' = 'yes') OR (t.highway IS NOT NULL AND t.highway != 'cycleway' AND (t.cycleway = 'track' OR t."cycleway:right" = 'track' OR t."cycleway:both" = 'track') AND t.tags->'segregated' = 'yes') OR (t.highway = 'cycleway' AND t.tags->'oneway' = 'yes' AND t.tags->'foot' = 'designated' AND t.tags->'segregated' = 'yes') OR t.tags->'sidewalk:bicycle' = 'yes' OR (t.highway = 'footway' AND t.tags->'footway' = 'sidewalk' AND t.bicycle IN ('yes', 'designated') AND t.tags->'oneway' = 'yes') THEN 'AMENAGEMENT MIXTES PIETON VELO HORS VOIE VERTE'
WHEN t.tags->'cyclestreet' = 'yes' THEN 'VELO RUE'
WHEN t.tags->'ramp:bicycle' = 'yes' THEN 'RAMPE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND (t.cycleway = 'track' OR t."cycleway:right" = 'track' OR t."cycleway:both" = 'track') AND t.tags->'oneway' = 'yes' AND t.tags->'oneway:bicycle' = 'no' THEN 'DOUBLE SENS CYCLABLE PISTE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND (t.cycleway = 'lane' OR t."cycleway:right" = 'lane' OR t."cycleway:both" = 'lane') AND t.tags->'oneway' = 'yes' AND t.tags->'oneway:bicycle' = 'no' THEN 'DOUBLE SENS CYCLABLE BANDE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND (t.tags->'oneway:bicycle' = 'no' OR t.cycleway = 'opposite' OR t."cycleway:right" = 'opposite') AND t.tags->'oneway' = 'yes' THEN 'DOUBLE SENS CYCLABLE'
WHEN t.cycleway = 'track' OR t."cycleway:right" = 'track' OR t.highway = 'cycleway' THEN 'PISTE CYCLABLE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.cycleway = 'lane' AND t.tags->'lanes' = '1' AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') THEN 'CHAUSSEE A VOIE CENTRALE BANALISEE'
WHEN ((t.highway = 'path' AND (t.tags->'motor_vehicle' IS NULL OR t.tags->'motor_vehicle' = 'no' OR t.tags->'motorcar' IS NULL OR t.tags->'motorcar' = 'no')) OR t.highway='footway') AND t.bicycle IN ('yes', 'designated') THEN 'VOIE VERTE'
WHEN t.cycleway = 'share_busway' OR t."cycleway:right" = 'share_busway' OR t."cycleway:both" = 'share_busway' OR (t.highway='service' AND t.tags->'access' = 'no' AND (t.tags->'psv' IN ('yes', 'designated') OR t.tags->'bus' IN ('yes', 'designated')) AND t.bicycle IN ('yes', 'designated')) THEN 'COULOIR BUS+VELO'
WHEN COALESCE(t.tags->'cycleway:right:segregated', t.tags->'cycleway:both:segregated', t.tags->'cycleway:segregated', t.tags->'sidewalk:right:segregated', t.tags->'sidewalk:segregated', t.tags->'segregated') = 'no' THEN 'AMENAGEMENT MIXTES PIETON VELO HORS VOIE VERTE'
WHEN t.highway = 'cycleway' OR t.cycleway = 'track' OR t."cycleway:right" = 'track' OR t."cycleway:both" = 'track' THEN 'PISTE CYCLABLE'
WHEN t.cycleway = 'lane' OR t."cycleway:right" = 'lane' OR t."cycleway:both" = 'lane' THEN 'BANDE CYCLABLE'
WHEN t.cycleway = 'share_busway' OR t."cycleway:right" = 'share_busway' OR t."cycleway:both" = 'share_busway' OR (t.highway='service' AND t.tags->'access' = 'no' AND t.tags->'psv' IN ('yes', 'designated') AND t.bicycle IN ('yes', 'designated')) THEN 'COULOIR BUS+VELO'
WHEN t.cycleway IS NOT NULL OR t."cycleway:right" IS NOT NULL OR t."cycleway:both" IS NOT NULL OR t.highway = 'cycleway' THEN 'AUTRE'
ELSE 'AUCUN'
END AS ame_d,
CASE
WHEN t.tags->'maxspeed' = '30' AND (t.tags->'zone:maxspeed' = 'FR:30' OR t.tags->'source:maxspeed' = 'FR:zone30') THEN 'ZONE 30'
WHEN t.highway IN ('footway', 'pedestrian') THEN 'AIRE PIETONNE'
WHEN t.highway = 'living_street' OR t.tags->'living_street' = 'yes' THEN 'ZONE DE RENCONTRE'
WHEN t.tags->'maxspeed' ~ '\d+' AND (t.tags->'maxspeed')::int <= 50 THEN 'EN AGGLOMERATION'
WHEN t.tags->'maxspeed' ~ '\d+' AND (t.tags->'maxspeed')::int > 50 THEN 'HORS AGGLOMERATION'
END AS regime_d,
CASE
WHEN (t.highway = 'cycleway' AND t.tags->'oneway' = 'no') OR (t."cycleway:right" IN ('lane', 'track') AND t.tags->'cycleway:right:oneway' = 'no') THEN 'BIDIRECTIONNEL'
ELSE 'UNIDIRECTIONNEL'
WHEN
(t.highway = 'cycleway' AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no'))
OR (t."cycleway:right" IN ('lane', 'track') AND t.tags->'cycleway:right:oneway' = 'no')
OR (t.highway = 'footway' AND t.tags->'bicycle' IN ('yes', 'designated') AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no'))
OR t.tags->'ramp:bicycle' = 'yes'
OR (((t.highway = 'path' AND (t.tags->'motor_vehicle' IS NULL OR t.tags->'motor_vehicle' = 'no' OR t.tags->'motorcar' IS NULL OR t.tags->'motorcar' = 'no')) OR t.highway='footway') AND t.bicycle IN ('yes', 'designated') AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no'))
THEN 'BIDIRECTIONNEL'
WHEN
t.tags->'cyclestreet' = 'yes'
OR t.tags->'ramp:bicycle' = 'yes'
OR (t.cycleway IS NOT NULL AND t.cycleway != 'no')
OR (t."cycleway:both" IS NOT NULL AND t."cycleway:both" != 'no')
OR (t."cycleway:right" IS NOT NULL AND t."cycleway:right" != 'no')
OR t.bicycle IN ('yes', 'designated')
OR t.highway = 'cycleway'
OR t.tags->'sidewalk:bicycle' = 'yes'
THEN 'UNIDIRECTIONNEL'
END AS sens_d,
COALESCE(t.tags->'cycleway:right:width', t.tags->'cycleway:right:est_width', t.tags->'cycleway:both:width', t.tags->'cycleway:both:est_width', t.tags->'cycleway:width', t.tags->'cycleway:est_width') AS largeur_d,
CASE
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.cycleway = 'lane' AND t.tags->'lanes' = '1' AND t.tags->'oneway' = 'no' THEN 'CHAUSSEE A VOIE CENTRALE BANALISEE'
WHEN t.highway = 'path' AND (t.tags->'motor_vehicle' IS NULL OR t.tags->'motor_vehicle' = 'no') AND t.bicycle = 'designated' THEN 'VOIE VERTE'
WHEN (t.highway IS NOT NULL AND t.highway != 'cycleway' AND (t.cycleway = 'track' OR t."cycleway:left" = 'track' OR t."cycleway:both" = 'track') AND t.tags->'segregated' = 'yes') OR t.tags->'sidewalk:bicycle' = 'yes' OR (t.highway = 'footway' AND t.tags->'footway' = 'sidewalk' AND t.bicycle IN ('yes', 'designated') AND t.tags->'oneway' = 'yes') THEN 'AMENAGEMENT MIXTES PIETON VELO HORS VOIE VERTE'
WHEN t.tags->'cyclestreet' = 'yes' AND (t.tags->'oneway' = 'no' OR t.tags->'oneway' IS NULL) THEN 'VELO RUE'
WHEN t.tags->'ramp:bicycle' = 'yes' THEN 'RAMPE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND (t.cycleway = 'track' OR t."cycleway:left" = 'track' OR t."cycleway:both" = 'track') AND t.tags->'oneway' = 'yes' AND t.tags->'oneway:bicycle' = 'no' THEN 'DOUBLE SENS CYCLABLE PISTE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND (t.cycleway = 'lane' OR t."cycleway:left" = 'lane' OR t."cycleway:both" = 'lane') AND t.tags->'oneway' = 'yes' AND t.tags->'oneway:bicycle' = 'no' THEN 'DOUBLE SENS CYCLABLE BANDE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND (t.tags->'oneway:bicycle' = 'no' OR t.cycleway = 'opposite' OR t."cycleway:left" = 'opposite') AND t.tags->'oneway' = 'yes' THEN 'DOUBLE SENS CYCLABLE'
WHEN t.cycleway = 'track' OR t."cycleway:left" = 'track' OR t.highway = 'cycleway' THEN 'PISTE CYCLABLE'
WHEN t.cycleway = 'lane' OR t."cycleway:left" = 'lane' OR t."cycleway:both" = 'lane' THEN 'BANDE CYCLABLE'
WHEN t."cycleway:left" = 'share_busway' OR ((t.tags->'oneway' = 'no' OR t.tags->'oneway' IS NULL) AND (t.cycleway = 'share_busway' OR t."cycleway:both" = 'share_busway')) OR ((t.tags->'oneway' = 'no' OR t.tags->'oneway' IS NULL) AND t.highway='service' AND t.tags->'access' = 'no' AND t.tags->'psv' IN ('yes', 'designated') AND t.bicycle IN ('yes', 'designated')) THEN 'COULOIR BUS+VELO'
WHEN
t.highway IN ('footway', 'cycleway')
OR t.tags->'sidewalk:bicycle' = 'yes'
OR t.tags->'ramp:bicycle' = 'yes'
OR (t.cycleway = 'track' OR t."cycleway:both" = 'track' OR t."cycleway:right" = 'track')
THEN 'TROTTOIR'
WHEN
t.tags->'cyclestreet' = 'yes'
OR (t.cycleway IS NOT NULL AND t.cycleway != 'no')
OR (t."cycleway:both" IS NOT NULL AND t."cycleway:both" != 'no')
OR (t."cycleway:right" IS NOT NULL AND t."cycleway:right" != 'no')
OR t.bicycle IN ('yes', 'designated')
THEN 'CHAUSSEE'
END AS local_d,
CASE
WHEN t.tags->'cyclestreet' = 'yes' AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') THEN 'VELO RUE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.cycleway = 'lane' AND t.tags->'lanes' = '1' AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') THEN 'CHAUSSEE A VOIE CENTRALE BANALISEE'
WHEN ((t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') AND (t.tags->'junction' IS NULL OR t.tags->'junction' != 'roundabout') AND t.cycleway = 'share_busway') OR t."cycleway:left" = 'share_busway' OR t."cycleway:both" = 'share_busway' OR (t.highway='service' AND t.tags->'access' = 'no' AND (t.tags->'psv' IN ('yes', 'designated') OR t.tags->'bus' IN ('yes', 'designated')) AND t.bicycle IN ('yes', 'designated')) AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') THEN 'COULOIR BUS+VELO'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'oneway' = 'yes' AND t."cycleway:left" = 'track' THEN 'DOUBLE SENS CYCLABLE PISTE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'oneway' = 'yes' AND (t."cycleway:left" = 'opposite_lane' OR t.cycleway = 'opposite_lane') THEN 'DOUBLE SENS CYCLABLE BANDE'
WHEN t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'oneway' = 'yes' AND t.tags->'oneway:bicycle' = 'no' THEN 'DOUBLE SENS CYCLABLE'
WHEN COALESCE(t.tags->'cycleway:left:segregated', t.tags->'cycleway:both:segregated', t.tags->'sidewalk:left:segregated') = 'no' OR (t.highway NOT IN ('footway', 'cycleway', 'path') AND COALESCE(t.tags->'cycleway:segregated', t.tags->'sidewalk:segregated', t.tags->'segregated') = 'no') THEN 'AMENAGEMENT MIXTES PIETON VELO HORS VOIE VERTE'
WHEN ((t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') AND (t.tags->'junction' IS NULL OR t.tags->'junction' != 'roundabout') AND t.cycleway = 'track') OR t."cycleway:left" = 'track' OR t."cycleway:both" = 'track' THEN 'PISTE CYCLABLE'
WHEN ((t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') AND (t.tags->'junction' IS NULL OR t.tags->'junction' != 'roundabout') AND t.cycleway = 'lane') OR t."cycleway:left" = 'lane' OR t."cycleway:both" = 'lane' THEN 'BANDE CYCLABLE'
WHEN ((t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') AND (t.tags->'junction' IS NULL OR t.tags->'junction' != 'roundabout') AND t.cycleway IS NOT NULL) OR t."cycleway:left" IS NOT NULL OR t."cycleway:both" IS NOT NULL THEN 'AUTRE'
ELSE 'AUCUN'
END AS ame_g,
CASE
WHEN t.tags->'maxspeed' = '30' AND (t.tags->'zone:maxspeed' = 'FR:30' OR t.tags->'source:maxspeed' = 'FR:zone30') THEN 'ZONE 30'
WHEN t.highway IN ('footway', 'pedestrian') THEN 'AIRE PIETONNE'
WHEN t.highway = 'living_street' OR t.tags->'living_street' = 'yes' THEN 'ZONE DE RENCONTRE'
WHEN t.tags->'maxspeed' ~ '\d+' AND (t.tags->'maxspeed')::int <= 50 THEN 'EN AGGLOMERATION'
WHEN t.tags->'maxspeed' ~ '\d+' AND (t.tags->'maxspeed')::int > 50 THEN 'HORS AGGLOMERATION'
END AS regime_g,
CASE
WHEN (t.highway = 'cycleway' AND t.tags->'oneway' = 'no') OR (t."cycleway:left" IN ('lane', 'track') AND t.tags->'cycleway:left:oneway' = 'no') THEN 'BIDIRECTIONNEL'
ELSE 'UNIDIRECTIONNEL'
WHEN
t.tags->'cycleway:left:oneway' = 'no'
THEN 'BIDIRECTIONNEL'
WHEN
(t.tags->'cyclestreet' = 'yes' AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no'))
OR (t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.cycleway = 'lane' AND t.tags->'lanes' = '1' AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no'))
OR (((t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') AND (t.tags->'junction' IS NULL OR t.tags->'junction' != 'roundabout') AND t.cycleway = 'share_busway') OR t."cycleway:left" = 'share_busway' OR t."cycleway:both" = 'share_busway' OR (t.highway='service' AND t.tags->'access' = 'no' AND (t.tags->'psv' IN ('yes', 'designated') OR t.tags->'bus' IN ('yes', 'designated')) AND t.bicycle IN ('yes', 'designated')) AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no'))
OR (t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'oneway' = 'yes' AND t."cycleway:left" = 'track')
OR (t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'oneway' = 'yes' AND (t."cycleway:left" = 'opposite_lane' OR t.cycleway = 'opposite_lane'))
OR t.tags->'oneway:bicycle' = 'no'
OR t.tags->'sidewalk:bicycle' = 'yes'
OR ((t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no') AND (t.tags->'junction' IS NULL OR t.tags->'junction' != 'roundabout') AND t.cycleway IS NOT NULL) OR t."cycleway:left" IS NOT NULL OR t."cycleway:both" IS NOT NULL
THEN 'UNIDIRECTIONNEL'
END AS sens_g,
COALESCE(t.tags->'cycleway:left:width', t.tags->'cycleway:left:est_width', t.tags->'cycleway:both:width', t.tags->'cycleway:both:est_width', t.tags->'cycleway:width', t.tags->'cycleway:est_width') AS largeur_g,
CASE
WHEN t.highway = 'footway' OR t.tags->'sidewalk:bicycle' = 'yes' OR (t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'segregated' = 'yes') THEN 'TROTTOIR'
ELSE 'CHAUSSEE'
END AS local_ame,
WHEN
(t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'oneway' = 'yes' AND t."cycleway:left" = 'track')
OR (COALESCE(t.tags->'cycleway:left:segregated', t.tags->'cycleway:both:segregated', t.tags->'sidewalk:left:segregated') = 'no' OR (t.highway NOT IN ('footway', 'cycleway', 'path') AND COALESCE(t.tags->'cycleway:segregated', t.tags->'sidewalk:segregated', t.tags->'segregated') = 'no'))
OR (t.cycleway = 'track' OR t."cycleway:left" = 'track' OR t."cycleway:both" = 'track')
THEN 'TROTTOIR'
WHEN
(t.tags->'cyclestreet' = 'yes' AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no'))
OR (t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.cycleway = 'lane' AND t.tags->'lanes' = '1' AND (t.tags->'oneway' IS NULL OR t.tags->'oneway' = 'no'))
OR (t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'oneway' = 'yes' AND (t."cycleway:left" = 'opposite_lane' OR t.cycleway = 'opposite_lane'))
OR (t.highway IS NOT NULL AND t.highway != 'cycleway' AND t.tags->'oneway' = 'yes' AND t.tags->'oneway:bicycle' = 'no')
OR (t.cycleway = 'lane' OR t."cycleway:left" = 'lane' OR t."cycleway:both" = 'lane')
OR (t.cycleway IS NOT NULL OR t."cycleway:left" IS NOT NULL OR t."cycleway:both" IS NOT NULL)
THEN 'CHAUSSEE'
END AS local_g,
CASE
WHEN t.highway='construction' OR t.tags->'construction' IS NOT NULL THEN 'EN TRAVAUX'
ELSE 'EN SERVICE'
......@@ -78,9 +154,21 @@ SELECT
WHEN t.tags->'start_date' IS NOT NULL THEN substring(t.tags->'start_date', 1, 4)
END AS d_service,
COALESCE(t.tags->'description', t.tags->'note', t.tags->'fixme') AS comm,
COALESCE(t.tags->'source', 'OpenStreetMap') AS source,
'OpenStreetMap' AS source,
'WGS84' AS project_c,
'' AS ref_geo,
COALESCE(t.tags->'source:geometry', t.tags->'source') AS ref_geo,
<GEOM>
FROM <TABLE>
WHERE ((t.cycleway IS NOT NULL AND t.cycleway != 'no') OR t.highway = 'cycleway' OR (t."cycleway:right" IS NOT NULL AND t."cycleway:right" != 'no') OR (t."cycleway:left" IS NOT NULL AND t."cycleway:left" != 'no') OR (t."cycleway:both" IS NOT NULL AND t."cycleway:both" != 'no') OR t.bicycle IN ('yes', 'designated')) AND <GEOMCOND>
WHERE
(
(t.cycleway IS NOT NULL AND t.cycleway != 'no')
OR t.highway = 'cycleway'
OR (t."cycleway:right" IS NOT NULL AND t."cycleway:right" != 'no')
OR (t."cycleway:left" IS NOT NULL AND t."cycleway:left" != 'no')
OR (t."cycleway:both" IS NOT NULL AND t."cycleway:both" != 'no')
OR (t.highway IN ('path', 'footway') AND t.bicycle IN ('yes', 'designated'))
OR (t.highway = 'service' AND t.bicycle IN ('yes', 'designated') AND t.tags->'access' = 'no' AND (t.tags->'psv' IN ('yes', 'designated') OR t.tags->'bus' IN ('yes', 'designated')))
OR (t.highway IN ('pedestrian', 'unclassified', 'residential', 'service', 'primary', 'secondary', 'tertiary') AND t.tags->'cyclestreet' = 'yes')
OR (t.highway = 'steps' AND t.tags->'ramp:bicycle' = 'yes')
)
AND <GEOMCOND>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment