You are not logged in.
- Topics: Active | Unanswered
Announcement
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***
#1 2017-01-26 13:48:56
- wmyrda
- Member

- Registered: 2014-07-07
- Posts: 947
towers and masts - help nedded preparing patch for carto
I recently started looking at preparing simple additions to the map. Among those is one that turned out a bit more complicated to achieve and relates to inclusion in the map more towers and masts described here https://github.com/gravitystorm/openstr … ssues/2556
In the future maybe also https://github.com/gravitystorm/openstr … ssues/2024
I prepared a patch adding code to the openstreetmap-carto style, but it is not working as it fails with information about "tower_construction" column not existing https://justpaste.it/12tgq.
http://bigvo.hopto.org/osm-extra/carto- … s_v2.patch
diff -Naur wmyrda-style.old/amenity-points.mss local_style/amenity-points.mss
--- wmyrda-style.old/amenity-points.mss 2017-01-26 00:46:33.732819125 +0100
+++ local_style/amenity-points.mss 2017-01-26 00:33:02.379619328 +0100
@@ -322,11 +322,32 @@
marker-clip: false;
}
- [feature = 'man_made_mast'][zoom >= 17] {
- marker-file: url('symbols/communications.svg');
+ [feature = 'man_made_mast'][zoom >= 15] {
+ marker-file: url('symbols/testing/mast.svg');
marker-fill: @man-made-icon;
marker-placement: interior;
marker-clip: false;
+ [tower_type = 'communication'] {
+ marker-file: url('symbols/testing/mast_communications.svg');
+ }
+ }
+
+ [feature = 'man_made_tower'][zoom >= 15] {
+ marker-fill: @man-made-icon;
+ marker-placement: interior;
+ marker-clip: false;
+ [tower_construction = 'freestanding'] {
+ marker-file: url('symbols/testing/tower_cantilever.svg');
+ [tower_type = 'communication'] {
+ marker-file: url('symbols/testing/tower_cantilever_communication.svg');
+ }
+ }
+ [tower_construction = 'lattice'] {
+ marker-file: url('symbols/testing/tower_lattice.svg');
+ [tower_type = 'communication'] {
+ marker-file: url('symbols/testing/tower_lattice_communication.svg');
+ }
+ }
}
[feature = 'tourism_museum'][zoom >= 16] {
@@ -1355,6 +1376,7 @@
[feature = 'historic_wayside_cross'][zoom >= 17],
[feature = 'natural_cave_entrance'][zoom >= 15],
[feature = 'man_made_mast'][zoom >= 17],
+ [feature = 'man_made_tower'][zoom >= 17],
[feature = 'man_made_water_tower'][zoom >= 17] {
text-name: "[name]";
text-size: @standard-text-size;
@@ -1368,6 +1390,7 @@
text-dy: 6;
}
[feature = 'man_made_mast'] { text-dy: 10; }
+ [feature = 'man_made_tower'] { text-dy: 10; }
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
diff -Naur wmyrda-style.old/openstreetmap-carto.style local_style/openstreetmap-carto.style
--- wmyrda-style.old/openstreetmap-carto.style 2017-01-26 12:46:41.019107898 +0100
+++ local_style/openstreetmap-carto.style 2017-01-26 01:20:21.985688537 +0100
@@ -65,6 +65,7 @@
node,way surface text linear
node,way toll text linear
node,way tourism text polygon
+node,way tower:construction text linear
node,way tower:type text linear
way tracktype text linear
node,way tunnel text linear
diff -Naur wmyrda-style.old/project.mml local_style/project.mml
--- wmyrda-style.old/project.mml 2017-01-26 00:46:33.733180957 +0100
+++ local_style/project.mml 2017-01-26 12:17:11.252248994 +0100
@@ -1632,7 +1632,7 @@
'copyshop', 'sports', 'deli', 'tobacco', 'art', 'tea', 'coffee') THEN shop
WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table') THEN leisure ELSE NULL END,
- 'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
+ 'man_made_' || CASE WHEN man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('spring') THEN "natural" ELSE NULL END,
'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site') THEN historic ELSE NULL END,
'highway_'|| CASE WHEN highway IN ('bus_stop', 'elevator', 'traffic_signals') THEN highway ELSE NULL END,
@@ -1660,7 +1660,7 @@
'social_facility', 'charging_station')
OR shop IS NOT NULL -- skip checking a huge list and use a null check
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table')
- OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk')
+ OR man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk')
OR "natural" IN ('spring')
OR historic IN ('memorial', 'monument', 'archaeological_site')
OR highway IN ('bus_stop', 'elevator', 'traffic_signals')
@@ -1703,7 +1703,7 @@
WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park') THEN leisure ELSE NULL END,
- 'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
+ 'man_made_' || CASE WHEN man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance') THEN "natural" ELSE NULL END,
'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site') THEN historic ELSE NULL END,
'highway_'|| CASE WHEN highway IN ('bus_stop', 'elevator', 'traffic_signals', 'ford') THEN highway ELSE NULL END,
@@ -1742,7 +1742,7 @@
OR shop IS NOT NULL -- skip checking a huge list and use a null check
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park')
- OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk')
+ OR man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk')
OR "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance')
OR historic IN ('memorial', 'monument', 'archaeological_site', 'wayside_cross')
OR highway IN ('bus_stop', 'elevator', 'traffic_signals', 'ford')
@@ -1751,6 +1751,33 @@
) AS amenity_points
properties:
minzoom: 10
+ - id: towertypes
+ name: towertypes
+ geometry: point
+ <<: *extents
+ Datasource:
+ <<: *osm2pgsql
+ table: |-
+ (SELECT
+ way,
+ "tower:construction" AS tower_construction,
+ "tower:type" AS tower_type,
+ way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
+ FROM planet_osm_polygon
+ WHERE (("tower:construction" IS NOT NULL) OR ("tower:type" IS NOT NULL))
+ AND man_made IS NOT NULL
+ UNION ALL
+ SELECT
+ way,
+ "tower:construction" AS tower_construction,
+ "tower:type" AS tower_type,
+ NULL AS way_pixels
+ FROM planet_osm_point
+ WHERE ("tower:construction" IS NOT NULL) OR ("tower:type" IS NOT NULL)
+ ORDER BY way_pixels DESC NULLS LAST
+ ) AS towers
+ properties:
+ minzoom: 15
- id: power-towers
name: power-towers
geometry: point
@@ -2090,7 +2117,7 @@
'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland',
'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill',
'construction', 'military', 'plant_nursery', 'religious') THEN landuse ELSE NULL END,
- 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk') THEN man_made ELSE NULL END,
+ 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk') THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('wood', 'water', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath',
'grassland', 'scrub', 'beach', 'shoal', 'reef', 'glacier') THEN "natural" ELSE NULL END,
'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END,
@@ -2116,7 +2143,7 @@
OR shop IS NOT NULL
OR leisure IS NOT NULL
OR landuse IS NOT NULL
- OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk')
+ OR man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk')
OR "natural" IS NOT NULL
OR place IN ('island', 'islet')
OR military IN ('danger_area')
@@ -2217,7 +2244,7 @@
'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland',
'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill',
'construction', 'military', 'plant_nursery', 'religious') THEN landuse ELSE NULL END,
- 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'obelisk') THEN man_made ELSE NULL END,
+ 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'obelisk') THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'mud', 'wetland', 'marsh', 'bay', 'spring',
'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier', 'tree')
THEN "natural" ELSE NULL END,
@@ -2257,7 +2284,7 @@
OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential',
'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'greenhouse_horticulture',
'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military', 'plant_nursery', 'religious')
- OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'cross', 'obelisk')
+ OR man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'cross', 'obelisk')
OR "natural" IS NOT NULL
OR place IN ('island', 'islet')
OR military IN ('danger_area')
diff -Naur wmyrda-style.old/symbols/mast_communications.svg local_style/symbols/mast_communications.svg
--- wmyrda-style.old/symbols/mast_communications.svg 1970-01-01 01:00:00.000000000 +0100
+++ local_style/symbols/mast_communications.svg 2017-01-25 14:00:26.000000000 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ id="svg4138"
+ viewBox="0 0 14 14"
+ height="14"
+ width="14"
+ version="1.1">
+ <metadata
+ id="metadata4146">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4144" />
+ <rect
+ style="fill:none;stroke:none;visibility:hidden"
+ id="canvas"
+ y="0"
+ x="0"
+ height="14"
+ width="14" />
+ <path
+ id="mast-communication"
+ d="M 4 0.40625 C 2.23276 1.1855669 0.96875 2.9521023 0.96875 5 C 0.96875 7.047898 2.23276 8.814433 4 9.59375 L 4 8.4375 C 2.80447 7.746709 2 6.4881502 2 5 C 2 3.5118498 2.80447 2.2532914 4 1.5625 L 4 0.40625 z M 10 0.40625 L 10 1.5625 C 11.19553 2.2532914 12 3.5118498 12 5 C 12 6.4881502 11.19553 7.746709 10 8.4375 L 10 9.59375 C 11.76724 8.814433 13.03125 7.047898 13.03125 5 C 13.03125 2.9521023 11.76724 1.1855669 10 0.40625 z M 5 2.1875 C 3.842954 2.6043642 3 3.7033306 3 5 C 3 6.2966694 3.842954 7.395636 5 7.8125 L 5 6.71875 C 4.403081 6.3740292 4 5.7435697 4 5 C 4 4.2564303 4.403081 3.6259708 5 3.28125 L 5 2.1875 z M 9 2.1875 L 9 3.28125 C 9.596919 3.6259708 10 4.2564303 10 5 C 10 5.7435697 9.596919 6.3740292 9 6.71875 L 9 7.8125 C 10.157046 7.395636 11 6.2966694 11 5 C 11 3.7033306 10.157046 2.6043642 9 2.1875 z M 7 4 C 6.4022075 4 6 4.4692172 6 5 L 6 9 L 3.1132812 14 L 4.2675781 14 L 6 11 L 6 14 L 8 14 L 8 11 L 9.7324219 14 L 10.886719 14 L 8 9 L 8 5 C 8 4.5039063 7.5977925 4 7 4 z " />
+</svg>
diff -Naur wmyrda-style.old/symbols/mast.svg local_style/symbols/mast.svg
--- wmyrda-style.old/symbols/mast.svg 1970-01-01 01:00:00.000000000 +0100
+++ local_style/symbols/mast.svg 2017-01-25 13:59:52.000000000 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ id="svg4138">
+ <metadata
+ id="metadata4146">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4144" />
+ <rect
+ width="14"
+ height="14"
+ x="0"
+ y="0"
+ id="canvas"
+ style="fill:none;stroke:none;visibility:hidden" />
+ <path
+ d="M 7,1 C 6.4022075,1 6,1.4692172 6,2 L 6,9 3.1132812,14 4.2675781,14 6,11 6,14 8,14 8,11 9.7324219,14 10.886719,14 8,9 8,2 C 8,1.5039063 7.5977925,1 7,1 Z"
+ id="mast" />
+</svg>
diff -Naur wmyrda-style.old/symbols/tower_cantilever_communication.svg local_style/symbols/tower_cantilever_communication.svg
--- wmyrda-style.old/symbols/tower_cantilever_communication.svg 1970-01-01 01:00:00.000000000 +0100
+++ local_style/symbols/tower_cantilever_communication.svg 2017-01-25 13:59:32.000000000 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ id="svg4138"
+ viewBox="0 0 14 14"
+ height="14"
+ width="14"
+ version="1.1">
+ <metadata
+ id="metadata4146">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4144" />
+ <rect
+ style="fill:none;stroke:none;visibility:hidden"
+ id="canvas"
+ y="0"
+ x="0"
+ height="14"
+ width="14" />
+ <path
+ id="tower-freestanding-communication"
+ d="M 4 0.40625 C 2.23276 1.1855669 0.96875 2.9521023 0.96875 5 C 0.96875 7.047898 2.23276 8.814433 4 9.59375 L 4 8.4375 C 2.80447 7.746709 2 6.4881502 2 5 C 2 3.5118498 2.80447 2.2532914 4 1.5625 L 4 0.40625 z M 10 0.40625 L 10 1.5625 C 11.19553 2.2532914 12 3.5118498 12 5 C 12 6.4881502 11.19553 7.746709 10 8.4375 L 10 9.59375 C 11.76724 8.814433 13.03125 7.047898 13.03125 5 C 13.03125 2.9521023 11.76724 1.1855669 10 0.40625 z M 5 2.1875 C 3.842954 2.6043642 3 3.7033306 3 5 C 3 6.2966694 3.842954 7.395636 5 7.8125 L 5 6.71875 C 4.403081 6.3740292 4 5.7435697 4 5 C 4 4.2564303 4.403081 3.6259708 5 3.28125 L 5 2.1875 z M 9 2.1875 L 9 3.28125 C 9.596919 3.6259708 10 4.2564303 10 5 C 10 5.7435697 9.596919 6.3740292 9 6.71875 L 9 7.8125 C 10.157046 7.395636 11 6.2966694 11 5 C 11 3.7033306 10.157046 2.6043642 9 2.1875 z M 7 4 C 6.4022075 4 6 4.469217 6 5 L 6 11 L 5 11 L 5 12 L 3 12 L 3 14 L 11 14 L 11 12 L 9 12 L 9 11 L 8 11 L 8 5 C 8 4.503906 7.597793 4 7 4 z " />
+</svg>
diff -Naur wmyrda-style.old/symbols/tower_cantilever.svg local_style/symbols/tower_cantilever.svg
--- wmyrda-style.old/symbols/tower_cantilever.svg 1970-01-01 01:00:00.000000000 +0100
+++ local_style/symbols/tower_cantilever.svg 2017-01-25 13:58:20.000000000 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ id="svg4138">
+ <metadata
+ id="metadata4146">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4144" />
+ <rect
+ width="14"
+ height="14"
+ x="0"
+ y="0"
+ id="canvas"
+ style="fill:none;stroke:none;visibility:hidden" />
+ <path
+ d="m 6,2 0,9 -1,0 0,1 -2,0 0,2 8,0 0,-2 -2,0 0,-1 -1,0 0,-9 C 8,1.5039063 7.5977925,1 7,1 6.4022075,1 6,1.4692172 6,2 Z"
+ id="tower-freestanding" />
+</svg>
diff -Naur wmyrda-style.old/symbols/tower_lattice_communication.svg local_style/symbols/tower_lattice_communication.svg
--- wmyrda-style.old/symbols/tower_lattice_communication.svg 1970-01-01 01:00:00.000000000 +0100
+++ local_style/symbols/tower_lattice_communication.svg 2017-01-25 14:00:50.000000000 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ id="svg4138">
+ <metadata
+ id="metadata4146">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4144" />
+ <rect
+ width="14"
+ height="14"
+ x="0"
+ y="0"
+ id="canvas"
+ style="fill:none;stroke:none;visibility:hidden" />
+ <path
+ id="tower-lattice-communication"
+ d="M 4 0.40625 C 2.23276 1.1855669 0.96875 2.9521023 0.96875 5 C 0.96875 7.047898 2.23276 8.814433 4 9.59375 L 4 8.4375 C 2.80447 7.746709 2 6.4881502 2 5 C 2 3.5118498 2.80447 2.2532914 4 1.5625 L 4 0.40625 z M 10 0.40625 L 10 1.5625 C 11.19553 2.2532914 12 3.5118498 12 5 C 12 6.4881502 11.19553 7.746709 10 8.4375 L 10 9.59375 C 11.76724 8.814433 13.03125 7.047898 13.03125 5 C 13.03125 2.9521023 11.76724 1.1855669 10 0.40625 z M 5 2.1875 C 3.842954 2.6043642 3 3.7033306 3 5 C 3 6.2966694 3.842954 7.395636 5 7.8125 L 5 6.71875 C 4.403081 6.3740292 4 5.7435697 4 5 C 4 4.2564303 4.403081 3.6259708 5 3.28125 L 5 2.1875 z M 9 2.1875 L 9 3.28125 C 9.596919 3.6259708 10 4.2564303 10 5 C 10 5.7435697 9.596919 6.3740292 9 6.71875 L 9 7.8125 C 10.157046 7.395636 11 6.2966694 11 5 C 11 3.7033306 10.157046 2.6043642 9 2.1875 z M 7 3 L 5.2011719 10 L 2.5996094 14 L 4 14 L 4.6660156 13 L 9.3339844 13 L 10 14 L 11.400391 14 L 8.8007812 10 L 7 3 z M 7 7 L 7.75 10 L 6.25 10 L 7 7 z M 6 11 L 8 11 L 8.6660156 12 L 5.3339844 12 L 6 11 z " />
+</svg>
diff -Naur wmyrda-style.old/symbols/tower_lattice.svg local_style/symbols/tower_lattice.svg
--- wmyrda-style.old/symbols/tower_lattice.svg 1970-01-01 01:00:00.000000000 +0100
+++ local_style/symbols/tower_lattice.svg 2017-01-25 13:59:02.000000000 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ id="svg4138">
+ <metadata
+ id="metadata4146">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4144" />
+ <rect
+ width="14"
+ height="14"
+ x="0"
+ y="0"
+ id="canvas"
+ style="fill:none;stroke:none;visibility:hidden" />
+ <path
+ id="tower-lattice"
+ d="M 7 3 L 5.2011719 10 L 2.5996094 14 L 4 14 L 4.6660156 13 L 9.3339844 13 L 10 14 L 11.400391 14 L 8.8007812 10 L 7 3 z M 7 7 L 7.75 10 L 6.25 10 L 7 7 z M 6 11 L 8 11 L 8.6660156 12 L 5.3339844 12 L 6 11 z "/>
+</svg>I am thinking there must be problem with SQL statements, but maybe it is something else?
PS zoom15 instead z17 is just for testing purposes
Offline
#2 2017-01-26 15:26:31
- SK53
- Member
- Registered: 2009-01-11
- Posts: 705
Re: towers and masts - help nedded preparing patch for carto
No patches (better called pull requests) for carto-css which require additional columns will be accepted until hstore is implemented.
If this is a local implementation then you have the choice of a) ensuring hstore is enabled on your osm2pgsql uploads; and b) altering the sql to add the tower:construction column using something like tags->'tower:construction' as tower:construction. In suggest not using ":" in SQL column names as it means they must be enclosed in double-quotes.
HTH
Offline
#3 2017-01-26 17:41:55
- wmyrda
- Member

- Registered: 2014-07-07
- Posts: 947
Re: towers and masts - help nedded preparing patch for carto
No patches (better called pull requests) for carto-css which require additional columns will be accepted until hstore is implemented.
It is meant for carto, but hence carto needs to wait for it I will use it locally till then.
If this is a local implementation then you have the choice of a) ensuring hstore is enabled on your osm2pgsql uploads;
I have believe hstore is enabled locally as among others I used this guide https://ycnrg.org/osm-tile-server-ubuntu-16-04/ specifically doing it on creation yet the code I prepared would not run (see code pasted to justpaste.it above) saying that in fact it does need extra columns.
b) altering the sql to add the tower:construction column using something like tags->'tower:construction' as tower:construction. In suggest not using ":" in SQL column names as it means they must be enclosed in double-quotes.
I have hard time understanding what do you propose here. If you mean replace tower:construction with 'tower:construction' then where in openstreetmap-carto.style or in project.mml? If in project.mml then if You looked at the code prepared you will see I tried to resemble code for addr:housename in fairly the same manner. As I say it would not work, hence the question why?
Offline
#4 2017-01-27 13:02:09
- SK53
- Member
- Registered: 2009-01-11
- Posts: 705
Re: towers and masts - help nedded preparing patch for carto
In this line in your debug output:
SELECT ST_AsBinary("way") AS geom,"access","denomination","feature","generator:source","power_source","religion","tower_construction","tower_type","way_pixels"
You need to change "tower_construction" in the Carto:CSS SQL to tags->'tower:construction' as "tower_construction" & then the data will be pulled from the hstore column.
HTH
Offline
#5 2017-01-28 19:31:48
- wmyrda
- Member

- Registered: 2014-07-07
- Posts: 947
Re: towers and masts - help nedded preparing patch for carto
I have changed the code reflect your suggestion whichnow looks like this
- id: towertypes
name: towertypes
geometry: point
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
tags->'tower:construction' AS "tower_construction",
tags->'tower:type' AS "tower_type",
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
FROM planet_osm_polygon
WHERE (("tower_construction" IS NOT NULL) OR ("tower_type" IS NOT NULL))
AND man_made IS NOT NULL
UNION ALL
SELECT
way,
tags->'tower:construction' AS "tower_construction",
tags->'tower:type' AS "tower_type",
NULL AS way_pixels
FROM planet_osm_point
WHERE ("tower_construction" IS NOT NULL) OR ("tower_type" IS NOT NULL)
ORDER BY way_pixels DESC NULLS LAST
) AS towers
properties:
minzoom: 15and now I get following error - column "tower_construction" dos not exists
renderd[22712]: An error occurred while loading the map layer 'default': Postgis Plugin: BŁĄD: kolumna "tower_construction" nie istnieje
LINE 7: WHERE (("tower_construction" IS NOT NULL) OR ("tower_type"...
^
in executeQuery Full sql was: 'SELECT * FROM (SELECT
way,
tags->'tower:construction' AS "tower_construction",
tags->'tower:type' AS "tower_type",
way_area/NULLIF(0::real*0::real,0) AS way_pixels
FROM planet_osm_polygon
WHERE (("tower_construction" IS NOT NULL) OR ("tower_type" IS NOT NULL))
AND man_made IS NOT NULL
UNION ALL
SELECT
way,
tags->'tower:construction' AS "tower_construction",
tags->'tower:type' AS "tower_type",
NULL AS way_pixels
FROM planet_osm_point
WHERE ("tower_construction" IS NOT NULL) OR ("tower_type" IS NOT NULL)
ORDER BY way_pixels DESC NULLS LAST
) AS towers LIMIT 0'
encountered during parsing of layer 'towertypes' in Layer at line 27083 of '/opt/osm/local_style/osm10.xml'Does that mean code is still wrong or thee is problem with database actually not having hstore column so nothing can be pulled out of it?
Offline
#6 2017-01-28 20:23:33
- SomeoneElse
- Member
- Registered: 2010-10-13
- Posts: 1,601
Re: towers and masts - help nedded preparing patch for carto
I'd actually suggest doing all that processing in lua. As I understand it, that's the direction that the "standard map" team is travelling in (albeit slowly), although it's not immediately clear to me from the README what they're planning to support in lua, and when.
An example of a similar style the does this in lua is here: https://github.com/SomeoneElseOSM/Someo … .lua#L1981 , although that just breaks the various towers and masts out into 2 types for rendering - I presume you'd want more, but it wouldn't make the rendering more complex. The symbol rendering is at https://github.com/SomeoneElseOSM/opens … s.mss#L190 and the name rendering at https://github.com/SomeoneElseOSM/opens … .mss#L1450 ; and more types of masts here wouldn't mean more complicated code, just a longer list of symbols.
If you want a more complicated example the "amenity=pub" rendering in that style actually chooses between 12(!) similar icons depending on facilities (e.g. does it serve food). The lua code for that is at https://github.com/SomeoneElseOSM/Someo … e.lua#L553 , and there's no way you'd want that in your stylesheet. The stylesheet code is at https://github.com/SomeoneElseOSM/opens … s.mss#L295 and https://github.com/SomeoneElseOSM/opens … s.mss#L636 .
The .mml for my example style is at https://github.com/SomeoneElseOSM/opens … roject.mml - you'll notice that some selections there (e.g. man_made) have expanded so that the .mss files can see more data but that others (e.g. amenity) already see everything.
Also (and I guess you'll be well aware of this if you're editing the style already) the "standard" style uses a YAML file for layer control, as noted in https://github.com/gravitystorm/openstr … IBUTING.md . My example doesn't have that because it predates OSM Carto's move to using YAML.
Offline
#7 2017-01-29 13:09:34
- wmyrda
- Member

- Registered: 2014-07-07
- Posts: 947
Re: towers and masts - help nedded preparing patch for carto
@SomeoneElse I must say I always have been huge fun of teaming up close tags together like that one https://github.com/SomeoneElseOSM/Someo … .lua#L1332 instead just displaying the single one that is encouraged at the moment for simple reason that tagging mistakes will be impossible to eliminate and hence one is not able to defeat the problem must learn to work with it.
I love just about any idea about your style with just one exception. I do not think that idea would ever get to the general purpose map
Where tags collide, manually choose one of the pair to render (e.g. "amenity=pub" and "tourism=hotel" - I'm far more likely to be looking for a pub than a hotel, so show that symbol).
...
I'd actually suggest doing all that processing in lua. As I understand it, that's the direction that the "standard map" team is travelling in (albeit slowly), although it's not immediately clear to me from the README what they're planning to support in lua, and when.
Idea sound good, but from what I read it might take "quite some time" like few months or more which means working on present approach is not that bad idea for now and should be fairly easily translatable to the new lua style which but they way I find easier to understand. Having said that going back to my original question from my previous post where do you think my error is coming from? Is hstore read unproperly or is just hstore just empty and I just think it should be used.
Offline