andreynovikov / trekarta

Simple, responsive map for your trek. You decide how to journey today, not the application!
https://trekarta.info
GNU General Public License v3.0
174 stars 25 forks source link

House Names #144

Open hungerburg opened 3 years ago

hungerburg commented 3 years ago

In my town, some houses have names, mostly small chapels or touristic attractions, old "palaces", eg. Would be nice to have those shown, even when the house has an addr:number. On the countryside, names for houses are also common. Possible change below:

--- a/app/src/main/assets/styles/inc_poi.xml
+++ b/app/src/main/assets/styles/inc_poi.xml
@@ -548,10 +551,8 @@
                     <text use="house-number" />
                 </m>
             </m>
-            <m k="addr:housenumber" v="~">
-                <m k="kind" v="~">
-                    <text use="house-name" />
-                </m>
+            <m k="kind" v="~">
+                <text use="poi" />
             </m>
         </m>
         <!-- lonely house numbers -->
hungerburg commented 3 years ago

Hmm, some hosues have both an addr:house-name and a name… collapse them?

andreynovikov commented 3 years ago

House names are shown for all buildings that are not POIs (amenities in terms of Trekarta). If it is an amenity, then its name is shown only if that kind of amenities is enabled in map settings. For instance to see chapel name you have to enable religion amenities. This is on purpose.

hungerburg commented 3 years ago

That purpose should be unaffected, thats what the selector for kind not set matches? The extra test for "no housenumber", is it really warrented? Patch recreated

Nah, that gave me two names ! Of course the test is needed! Still, when checked, then I get NO name shown, how that?

After some more probing, turns out: It is the value of dy that decides, whether a house with a number will show its name. Change from 14 to 16, and names will show.

--- a/app/src/main/assets/styles/inc_poi.xml
+++ b/app/src/main/assets/styles/inc_poi.xml
@@ -542,7 +542,7 @@
         <m cat="buildings" k="building|building:part" zoom-min="17">
             <m k="addr:housenumber">
                 <m k="kind" v="~">
-                    <text dy="-14" use="house-name" />
+                    <text dy="-16" use="house-name" />
                 </m>
                 <m k="feature">
                     <text dy="-16" use="house-number" />

PS: House numbers on POIs maybe are not so interesting? Those are not real, they do not show most of the time, and where they show, they mostly duplicate stuff, from what I observe.

@@ -533,16 +533,13 @@
                         <text use="poi" />
                     </m>
                 </m>
-                <m zoom-min="17">
-                    <text dy="-16" use="house-number" />
-                </m>
             </m>
         </m>
         <!-- house numbers -->

One more update: some shops show as housenames, when the comprise all of the building, the "feature" selector cannot be used on them, to hide their name.