Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

you choose the easiest case, large city blocks in a grid. Try a European or Asian city with lots of twisty roads and alleys and it gets much harder. The maps here are already covered with the names of buildings, stations, parks, hospitals etc...

I often want road names in Tokyo but they are also competing for space of transit lines as well as places with double or triple decker differently named things like there's a freeway named A over aroad named B which is over a Subway line named C

Road names are usually not as important in Japan as they are not used in addresses but they come in handy when explaining to a cab driver how to get somewhere



> Try a European or Asian city with lots of twisty roads and alleys and it gets much harder.

I showed what would happen if you literally follow the rule "whenever [...] there's enough room on a visible street to put a label, then put the label".

That's the specification. If you show me a twisty road with no room for a label, then according to this specification it doesn't get the label. The specification (for what we're testing) says "whenever there is room". Whenever there is enough whitespace on the road.


That’s a misunderstanding of the spec. The ask is to put in at least one label if there is space (when previously there were none). Filling all available space with redundant labels is not the ask.


OK, mine is the result of running this pseudocode:

   # Label all streets as much as possible
   for (each street on screen):
     while (that street has room for a label): # (even if already labeled)
       put a label on that street              # i.e. an additional one
yours is:

   # Try to label unlabeled streets
   for (each street on screen)
     if (no label on screen for that street): # if unlabeled
       if (street has room for a label):      # ...can we fix?
         put a label on that street           # ...then fix
(I would usually write this with an && rather than nested if's but I know mobile makes you scroll sideways)

As a followup, could you please define "street has room for a label"? When do you consider that a street has room for a label?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: