Author Topic: Minimap citylabels  (Read 1808 times)

0 Members and 1 Guest are viewing this topic.

Offline Tjoeker

Minimap citylabels
« on: June 29, 2016, 09:19:13 AM »
I believe everybody knows this map view:



Kinda hard to read the city names in the clusters..
It's still possible in this example. But if you zoom out one more step, it's impossible to read them.

wouldn't this be more convenient?:



Just like on google earth or google maps, if 2 labels collide, just show one.
I suggest showing the city with the most citizens.

Offline wlindley

Re: Minimap citylabels
« Reply #1 on: June 29, 2016, 10:31:46 PM »
In your example, the simple solution of showing only the "first" (topmost, leftmost) of overlapping names would show Philadelphia, Bethesda, and Arlington but not Washington DC. Trying to be very fancy about choosing which ones to display could get quite complex.

Offline DrSuperGood

Re: Minimap citylabels
« Reply #2 on: June 30, 2016, 12:19:18 AM »
The label for the biggest (most important) city should take precedence and be shown over the smaller cities.

Offline wlindley

Re: Minimap citylabels
« Reply #3 on: June 30, 2016, 02:10:17 AM »
So the algorithm would be this?
  • Make a list of all the cities visible in the minimap
  • Sort them in order of decreasing city-size (population)
  • Display the (first) city, adding its four text x,y corners (rectangle) to a rectangle-list
  • For subsequent cities, check each of (x1,y1),(x1,y2),(x2,y1),(x2,y2) to see whether any of those points are contained within the bounding boxes of anything in the rectangle-list; and skip if so, otherwise see Step 3 (display; add to list; repeat)


Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4068
  • Total likes: 98
  • Helpful: 146
  • Languages: EN, DE, AT
Re: Minimap citylabels
« Reply #4 on: June 30, 2016, 06:41:33 AM »
Yes, something like this. Such an algorithm could also be used for display of the game world in zoom out for city and station names / labels.
Parsley, sage, rosemary, and maggikraut.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8561
  • Total likes: 253
  • Helpful: 226
  • Languages: De,EN,JP
Re: Minimap citylabels
« Reply #5 on: July 02, 2016, 07:19:14 PM »
You may switch to isometric display to read the names (in your case) ...

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14762
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Minimap citylabels
« Reply #6 on: July 02, 2016, 08:45:23 PM »
An alternative suggestion made years ago by Neroden is actually to merge cities that become absorbed into one another as here.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4451
  • Total likes: 141
  • Helpful: 105
  • Languages: EN, NO
Re: Minimap citylabels
« Reply #7 on: July 03, 2016, 07:46:31 AM »
An alternative suggestion made years ago by Neroden is actually to merge cities that become absorbed into one another as here.

1. This map looks like it has been made with these cities as they are on purpose, to reflect the real world. As such, the map designer could have merged them from the start if it was deemed acceptable.
2. The presentation problem does not appear only when cities grow into each other. It is only affected by distance between town halls and the display scale of the map. The latter can't be used for merging cities.

Offline DrSuperGood

Re: Minimap citylabels
« Reply #8 on: July 04, 2016, 04:59:08 AM »
City merger would work however it would require redefining what a "city" is. A city would have to be a collection of named rectangles (districts), of which one is chosen as its "centre" to define the city name. Cities expand by resizing and making new districts over time. Districts cannot overlap and would have a minimum and maximum size. If districts from one city come into contact with districts of another city then the cities can merge, where by all districts of one city are moved to the other city and the empty city removed. When zoomed close all district names are visible however when zoomed far away only the centre district name will show.

This will fix the overlapping city name issue as cities should not end up existing in close proximity from each other. It will also fix the overlapping city issue where by cities stop expanding their bounds due to low building density caused by city buildings belonging to another city being inside their city area. It also adds potential for industry placement improvements such as city based consumers creating a district around them and being limited to only 1 per district (no 3 construction wholesalers right next to each other). It could even improve city growth logic as large cities would expand in full sized districts at a time (easy to set up transport for as area is well defined) rather than gradually by incrementing boundary size (hard to setup transport for as it may expand in the wrong direction or beyond the created transport infrastructure.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4451
  • Total likes: 141
  • Helpful: 105
  • Languages: EN, NO
Re: Minimap citylabels
« Reply #9 on: July 04, 2016, 09:50:43 AM »
This will fix the overlapping city name issue as cities should not end up existing in close proximity from each other.

But it will reduce the ability to make realistic maps. And the threshold for merging cities would have to depend on the scale of the map.

Offline DrSuperGood

Re: Minimap citylabels
« Reply #10 on: July 04, 2016, 03:56:45 PM »
Quote
But it will reduce the ability to make realistic maps. And the threshold for merging cities would have to depend on the scale of the map.
If anything it would make maps more realistic. Cities often are divided into zones/districts for administration/governing. For example the city of Glasgow has many council districts inside it, many with Glasgow somewhere in their name.

Hence why these local district names would be shown when zoomed close where overlapping name tags is not an issue. When zoomed far away or looking at the minimap then only 1 name tag will be shown.

In the case of two cities which should remain separate growing into each other (eg for a scenario) then a flag could be used to prevent city merger. It is then up to the map maker to assure that the city placements are meaningful and will not overlap names badly.

Offline Tjoeker

Re: Minimap citylabels
« Reply #11 on: July 04, 2016, 08:12:46 PM »
I'd like to see it implemented like Wlindley put it. And as Dwachs stated, we could also use this for stations.
What's wrong with hiding names if you can't read them?

The merging of cities into one city with different districts seems to be a whole different topic to me...

Offline DrSuperGood

Re: Minimap citylabels
« Reply #12 on: July 05, 2016, 12:17:59 AM »
Quote
What's wrong with hiding names if you can't read them?
It adds ambiguity as to what you are seeing. If you see a mess due to name tags overlapping then at least you know there are 2 objects with tags nearby even if you cannot read what they are. If you hide 1 of them then you may only be aware of 1 named object existing which you might be able to read perfectly but the other object is ambiguous to you.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4451
  • Total likes: 141
  • Helpful: 105
  • Languages: EN, NO
Re: Minimap citylabels
« Reply #13 on: July 05, 2016, 08:46:02 AM »
If anything it would make maps more realistic. Cities often are divided into zones/districts for administration/governing. For example the city of Glasgow has many council districts inside it, many with Glasgow somewhere in their name.

That is a feature of subdividing cities, not automatically merging them, which is what I replied to.

In the case of two cities which should remain separate growing into each other (eg for a scenario) then a flag could be used to prevent city merger. It is then up to the map maker to assure that the city placements are meaningful and will not overlap names badly.

Then the problem we are discussing here remains, because the meaningful positions of real life cities will cause overlap. Just check out Newark, Jersey City and New York City. In Google Maps, New York City (without "City", but I don't think it's the state, because no other state names can be seen) makes Newark invisible until you zoom far enough in. At that point, the names of some of the districts of New York City have already become visible. And you have to zoom in even more for the name Jersey City to become visible.

Label conflicts is a problem as old as the concept of maps. It is resolved on the maps, not by rearranging the world the map represents. All people reading maps must just cope with it. (Fortunately, the "inhabitants" in Simutrans won't be confused by offset labels, as is happening in the real world when hastily digitized maps were put into GPSes.)