Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N-1432 (0104.U1.432) Position im Gebäude fehlt #1423

Closed
TCA-Bot opened this issue Aug 8, 2024 · 7 comments
Closed

N-1432 (0104.U1.432) Position im Gebäude fehlt #1423

TCA-Bot opened this issue Aug 8, 2024 · 7 comments
Labels
entry Related to an entry

Comments

@TCA-Bot
Copy link
Collaborator

TCA-Bot commented Aug 8, 2024

Der N-1432 (0104.U1.432) hat derzeit keine Position im Gebäude.
Es handelt sich dabei um den kleinen Raum vor dem N-1431 und seinem Nachbarraum.

@TCA-Bot TCA-Bot added entry Related to an entry webform labels Aug 8, 2024
@XSpielinbox
Copy link

N-1432
Hier ist wieder eine Markierung auf einer selbst-skizzierten Karte basierend auf der Karte der TUM WWW & Online Services

@CommanderStorm
Copy link
Member

thanks a ton, added the coordinate

@XSpielinbox
Copy link

@CommanderStorm Thanks a lot! The "Interaktive Karte" for the room N-1432 is now correct.

But in the "Lageplan" it selects the plan from the wrong building by default. If one changes this to the one of the correct building it is correct there as well. What can one do about that?

@CommanderStorm
Copy link
Member

CommanderStorm commented Aug 9, 2024

What can one do about that?

I looked at the coordinates for the map, they seem correct.
So the issue must be some edgecase in this function (I have cleaned up a few of the unnessesary bits today => should be pretty readable).
I have looked through that code more than once, but cannot really find the source of the wrong assignment.
Now, that the mapmerging is remove (my previuous guess), this should be a bit simpler too find.

Something I have not really checked: Maybe the rotation is handled wrong?

def add_roomfinder_maps(data: dict[str, dict[str, Any]]) -> None:
"""Add roomfinder maps to entries"""
utils.convert_to_webp(SITE_PLANS_PATH)
assign_roomfinder_maps(data)
remove_non_covering_maps(data)
assign_default_roomfinder_map(data)
build_roomfinder_maps(data)

Being blunt: I am not going to invest more time into that file this week, as I finally want to get the OSM based map prototype closer to mergable.

@CommanderStorm
Copy link
Member

Sidenote: that different floors are assigned is intentional, as some rooms need that context to be findable on the floorplan

@XSpielinbox
Copy link

XSpielinbox commented Aug 11, 2024

As noted in #131 (comment) to me it looks like this error occurs for all rooms without map data from the old roomfinder. I would assume the error in

def assign_default_roomfinder_map(data: dict[str, dict[str, Any]]) -> None:
"""Select map with the lowest scale as default"""
for entry in data.values():
if rf_maps := entry.get("maps", {}).get("roomfinder"):
rf_maps.setdefault("default", None)
if not rf_maps.get("available", None):
continue
available_maps = rf_maps["available"]
default_map = available_maps[0]
for _map in available_maps:
if int(_map["scale"]) < int(default_map["scale"]):
default_map = _map
rf_maps["default"] = default_map["id"]

  • If there is no data from the roomfinder that preselects maps (which I actually find quite helpful, because for many of the building specific maps like N4 and N5 it is not obvious that you are looking at the map of the wrong building), it goes through all maps and selects the one with the smallest scale.
  • However if it happens to be these building maps all have the same scale and it then just selects the one that comes first in the list and that is unfortunately the map of a wrong building.
  • Therefore the algorithm placing the marker on that map has no chance to place it in the right position.
  • From the building level maps only the one of the floor the room is actually located in, should be selectable (as only this one makes sense) and then this one is automatically selected as the correct default.

@CommanderStorm
Copy link
Member

First of all, at the point in the programm, all maps which don't show a certain coordinate should have been removed by

def remove_non_covering_maps(data: dict[str, dict[str, Any]]) -> None:

I think your deduction is not quite right.

Lets assume

>>> rf_maps = {
...   "available": [],
... }
>>> not rf_maps.get("available", None)
True

This means that for this rf_maps, no default is set.

Yes, the assignment to the smallest map is somewhat crude, but without more data about them, that is everything I can do. Refactoring the maps to the {building}_{floor}.webp is not something that I don't have the time-resources for in the next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entry Related to an entry
Projects
None yet
Development

No branches or pull requests

3 participants