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

Lots of "Warning: Unknown type" #1499

Closed
syyyr opened this issue Sep 13, 2023 · 18 comments
Closed

Lots of "Warning: Unknown type" #1499

syyyr opened this issue Sep 13, 2023 · 18 comments
Labels
bug For issues that describe a bug help wanted Signal that help of other is appreciated

Comments

@syyyr
Copy link
Contributor

syyyr commented Sep 13, 2023

Hi, when I start up my app, I get a lot of these warnings:

855,12 Warning: Unknown type 'aerialway_gondola'
859,12 Warning: Unknown type 'aerialway_chair_lift'
863,12 Warning: Unknown type 'aerialway_drag_lift'
871,10 Warning: Unknown type 'amenity_hospital_building'
876,10 Warning: Unknown type 'railway_station'
877,10 Warning: Unknown type 'leisure_stadium'
882,12 Warning: Unknown type 'landuse_farmyard_building'
887,12 Warning: Unknown type 'power_sub_station'
889,12 Warning: Unknown type 'sport_building'
894,12 Warning: Unknown type 'leisure_sports_centre'
895,12 Warning: Unknown type 'leisure_building'
902,12 Warning: Unknown type 'amenity_post_office_building'
907,12 Warning: Unknown type 'amenity_building'
908,12 Warning: Unknown type 'amenity_bank_building'
909,12 Warning: Unknown type 'amenity_cafe_building'
910,12 Warning: Unknown type 'amenity_fast_food_building'
911,12 Warning: Unknown type 'amenity_fuel_building'
912,12 Warning: Unknown type 'amenity_kindergarten_building'
913,12 Warning: Unknown type 'amenity_library_building'
914,12 Warning: Unknown type 'amenity_restaurant_building'
915,12 Warning: Unknown type 'amenity_pub_building'
916,12 Warning: Unknown type 'amenity_bar_building'
917,12 Warning: Unknown type 'amenity_school_building'

What do these mean? How do fix them (or disable them, since my map works fine)?

@Framstag Framstag added bug For issues that describe a bug help wanted Signal that help of other is appreciated labels Sep 13, 2023
@Framstag
Copy link
Owner

I did check this before. AFAIR this is an initialisation order problem in the qt-client lib. I'll have to check again. @Karry, any input?

@Karry
Copy link
Collaborator

Karry commented Sep 13, 2023

Well, qt client library is using "empty" database to allow to render base map and overlays even in case that application is started without offline databases. As a side effect when this "empty" database is initialized, it prints these warnings...

@Framstag
Copy link
Owner

Would it be possible to detect that the database is empty (does not have types?) and skip loading the style sheet? Or would this result in further "complication"?

@Framstag
Copy link
Owner

Hmm, the empty database still has 9 types - we always register some internal types even if there is no data...

@Karry
Copy link
Collaborator

Karry commented Sep 13, 2023

We may improve logging:

  • log all unknown types on single lime
  • supress warnings for "empty" database

@syyyr
Copy link
Contributor Author

syyyr commented Sep 13, 2023

log all unknown types on single lime

It'd be an improvement, but I get like a hundred of these, so the single line would be probably very long.

Also, would it be possible to make all libosmscout logs print through its logger mechanism? I think these warnings are printed directly through std::cerr, which is why I can't disable them.

@Framstag
Copy link
Owner

Would it work to do not load the style sheet if the database is empty. This would IMHO be the best option.

@syyyr
Copy link
Contributor Author

syyyr commented Sep 14, 2023

Also, would it be possible to make all libosmscout logs print through its logger mechanism? I think these warnings are printed directly through std::cerr, which is why I can't disable them.

This is incorrect. They aren't printed through std::cerr. Sorry.

@Karry
Copy link
Collaborator

Karry commented Sep 21, 2023

Would it work to do not load the style sheet if the database is empty. This would IMHO be the best option.

It is not possible. It is necessary to have have stylesheet even with this empty database - when you want to render basemap, you need to know which color ocean have, when you want to render waypoint, you need to know what symbol to use...

I tried to pass "do not log warnings" argument while loading stylesheet, but resulted patch was pretty nasty. Instead, I am considering to allow hierarchy of loggers (with different log level) and not using global log singleton in some places... But define logger instance explicitly in some cases. That way, it would be possible to hide warnings when loading stylesheet for empty database...

@vyskocil
Copy link
Collaborator

It seems I don't have this issue in my app, for the basemap I'm using a very stripped down world.oss stylesheet :

OSS
 ORDER WAYS
  GROUP _route
  GROUP highway_motorway, highway_motorway_trunk, highway_motorway_primary
  GROUP highway_trunk
  GROUP highway_primary
  GROUP highway_secondary
  GROUP highway_tertiary
  GROUP highway_motorway_link, highway_trunk_link, highway_primary_link, highway_secondary_link, highway_tertiary_link
  GROUP highway_unclassified, highway_road, highway_residential
  GROUP railway_rail,
        aeroway_runway, aeroway_taxiway
  GROUP highway_living_street, highway_service, highway_bus_guideway,
        railway_tram, railway_light_rail, railway_subway, public_transport_platform
  GROUP highway_track, highway_pedestrian, highway_path, highway_cycleway,
        highway_footway, highway_bridleway, highway_construction,
        leisure_track,
      waterway_stream, route_ferry
  GROUP highway_steps, barrier_fence
  GROUP waterway_river, waterway_canal, waterway_drain
  GROUP elevation_contour_major, elevation_contour_medium, elevation_contour_minor

CONST
  // Label priorities
  UINT labelPrioContinent           = 1;
  UINT labelPrioIsland              = 1;
  UINT labelPrioCountry             = 2;
  UINT labelPrioState               = 3;
  UINT labelPrioRegion              = 4;
  UINT labelPrioCounty              = 5;
  UINT labelPrioMillionCity         = 6;
  UINT labelPrioBigCity             = 7;
  UINT labelPrioCity                = 8;
  UINT labelPrioTown                = 9;
  UINT labelPrioVillage             = 10;
  UINT labelPrioHamlet              = 11;
  UINT labelPrioSuburb              = 12;
  UINT labelPrioLocality            = 13;

  UINT labelPrioNatural             = 20;
  UINT labelPrioLanduse             = 25;
  UINT labelPrioLeisure             = 26;

  UINT labelPrioPeak                = 29;

  UINT labelPrioHighwayServices     = 34;
  UINT labelPrioRailwayStation      = 35;

  UINT labelPrioSpecialBuilding     = 37;
  UINT labelPrioMajorBuilding       = 38;

  UINT labelPrioRailwayHalt         = 40;
  UINT labelPrioTramHalt            = 40;

  UINT labelPrioHighwayArea         = 43;

  UINT labelPrioAmenity             = 45;
  UINT labelPrioShop                = 50;

  UINT labelPrioHighwayJunction     = 55;

  UINT labelPrioBuilding            = 100;

  // Ground tiles

  COLOR waterColor            = #9acffd;
  COLOR landColor             = #f1eee9;
  COLOR unknownColor          = #c4dff6;

  COLOR coastColor            = lighten(@waterColor,0.5);

  COLOR blackColor            = #000000;
  COLOR redColor              = #ff0000;

  COLOR countryBorderColor    = #9f6bff99;

STYLE

 [MAG world-] {
   [TYPE _tile_sea] AREA {color: @waterColor;}
   [TYPE _tile_coast] AREA {color: @waterColor;}
   //[TYPE _tile_coast] AREA {color: @waterColor;  borderColor: #000000; borderWidth: 0.1mm;}
   [TYPE _tile_land] AREA {color: @landColor;}
   [TYPE _tile_unknown] AREA {color: @unknownColor;}
 }

END

@Framstag
Copy link
Owner

This looks like a good solution.

@Framstag
Copy link
Owner

Framstag commented Oct 2, 2023

@syyyr : Should now be fixed. Please check and close the issue (if fixed).

@syyyr
Copy link
Contributor Author

syyyr commented Oct 2, 2023

Thank you. I am on vacation right now, I'll look into it on the 16th.

@syyyr
Copy link
Contributor Author

syyyr commented Oct 16, 2023

Hi, I have checked out the fix and it seems like I still get the warnings when I run the QtWidgetsDemoApp demo.

$ ./Demos/QtWidgetsDemoApp ~/maps/ ../stylesheets/standard.oss 
10,10 Warning: Unknown type 'highway_motorway'
20,10 Warning: Unknown type 'highway_trunk'
21,10 Warning: Unknown type 'highway_motorway_trunk'
29,10 Warning: Unknown type 'highway_primary'
30,10 Warning: Unknown type 'highway_motorway_primary'
40,10 Warning: Unknown type 'highway_secondary'
50,10 Warning: Unknown type 'highway_tertiary'
60,11 Warning: Unknown type 'highway_motorway_link'
68,10 Warning: Unknown type 'route_ferry'
73,8 Warning: Unknown type 'highway_mini_roundabout'
76,8 Warning: Unknown type 'amenity_ferry_terminal'
81,10 Warning: Unknown type 'highway_trunk_link'
89,10 Warning: Unknown type 'highway_primary_link'
97,10 Warning: Unknown type 'highway_secondary_link'
105,10 Warning: Unknown type 'highway_tertiary_link'
113,10 Warning: Unknown type 'highway_road'
121,10 Warning: Unknown type 'highway_unclassified'
122,10 Warning: Unknown type 'highway_residential'
135,10 Warning: Unknown type 'highway_service'
146,10 Warning: Unknown type 'highway_living_street'
155,10 Warning: Unknown type 'highway_construction'
157,10 Warning: Unknown type 'highway_pedestrian'
162,10 Warning: Unknown type 'public_transport_platform'
170,10 Warning: Unknown type 'highway_footway'
...
... more of these warnings...

@Framstag
Copy link
Owner

Framstag commented Nov 1, 2023

Since there was another pull request from @Karry... @syyyr: Does it work now? Can we close the issue?

@syyyr
Copy link
Contributor Author

syyyr commented Nov 1, 2023

I have tested again with the demo app and I get this behavior:

  • if the map argument is an empty directory, I get no warnings
$ ./Demos/QtWidgetsDemoApp ~/empty-maps/ ../stylesheets/standard.oss 
Lookup databases
  • if the map directory has some libosmscout databases, I still get the warnings
$ ./Demos/QtWidgetsDemoApp ~/osm-imported/ ../stylesheets/standard.oss 
Lookup databases
found db : /home/vk/osm-imported/pilsen
found db : /home/vk/osm-imported/helsinki
found db : /home/vk/osm-imported/melbourne
found db : /home/vk/osm-imported/lol
found db : /home/vk/osm-imported/world
found db : /home/vk/osm-imported/prague
396,13 Warning: Unknown type 'elevation_contour_major'
403,13 Warning: Unknown type 'elevation_contour_medium'
408,13 Warning: Unknown type 'elevation_contour_minor'
396,13 Warning: Unknown type 'elevation_contour_major'
403,13 Warning: Unknown type 'elevation_contour_medium'
408,13 Warning: Unknown type 'elevation_contour_minor'
396,13 Warning: Unknown type 'elevation_contour_major'
403,13 Warning: Unknown type 'elevation_contour_medium'
408,13 Warning: Unknown type 'elevation_contour_minor'
396,13 Warning: Unknown type 'elevation_contour_major'
403,13 Warning: Unknown type 'elevation_contour_medium'
408,13 Warning: Unknown type 'elevation_contour_minor'
41,9 Warning: Unknown way type 'highway_motorway'
42,9 Warning: Unknown way type 'highway_motorway_trunk'
43,9 Warning: Unknown way type 'highway_motorway_primary'
44,9 Warning: Unknown way type 'highway_trunk'
45,9 Warning: Unknown way type 'aerialway_gondola'
45,28 Warning: Unknown way type 'aerialway_chair_lift'
45,50 Warning: Unknown way type 'aerialway_drag_lift'
...

@Karry
Copy link
Collaborator

Karry commented Nov 1, 2023

It is strange. When I try widget demo, I have almost none of these warning (just one about srtm_tile type). Can you try to put breakpoint to the line where this warning is printed and run it in debugger, to see what database is causing that?

...and just out of curiosity, what is in your "world" database? How did you prepared it?

@syyyr
Copy link
Contributor Author

syyyr commented Nov 1, 2023

Maybe it is caused by a database imported by an earlier version of the database? I have reimported all of my databases and the problem seems to be gone.

...and just out of curiosity, what is in your "world" database? How did you prepared it?

It's the planet osm file filtered to contain just administrative_level=3. I used that as a "background" base database for the world and then had separate databases for specific cities I wanted. However, in the end, I'm only using libosmscout to implement the map widget (which is esentially the same as the demo I have contributed) and I use a tile server (Overv/openstreetmap-tile-server), so I don't deal with libosmscout's databases anymore. I also tried osmscout-server as you suggested, but they have already dropped support libosmscout last year unfortunately.

By the way, thank you for all your help with my other issues. I was successful in the map widget implementation in our app.

Díky :)

@syyyr syyyr closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a bug help wanted Signal that help of other is appreciated
Projects
None yet
Development

No branches or pull requests

4 participants