GithubHelp home page GithubHelp logo

Comments (18)

syyyr avatar syyyr commented on September 22, 2024 1

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.

from libosmscout.

syyyr avatar syyyr commented on September 22, 2024 1

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...

from libosmscout.

Framstag avatar Framstag commented on September 22, 2024

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?

from libosmscout.

Karry avatar Karry commented on September 22, 2024

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...

from libosmscout.

Framstag avatar Framstag commented on September 22, 2024

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"?

from libosmscout.

Framstag avatar Framstag commented on September 22, 2024

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

from libosmscout.

Karry avatar Karry commented on September 22, 2024

We may improve logging:

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

from libosmscout.

Framstag avatar Framstag commented on September 22, 2024

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

from libosmscout.

syyyr avatar syyyr commented on September 22, 2024

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.

from libosmscout.

Karry avatar Karry commented on September 22, 2024

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...

from libosmscout.

vyskocil avatar vyskocil commented on September 22, 2024

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

from libosmscout.

Framstag avatar Framstag commented on September 22, 2024

This looks like a good solution.

from libosmscout.

Framstag avatar Framstag commented on September 22, 2024

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

from libosmscout.

syyyr avatar syyyr commented on September 22, 2024

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

from libosmscout.

Framstag avatar Framstag commented on September 22, 2024

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

from libosmscout.

syyyr avatar syyyr commented on September 22, 2024

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'
...

from libosmscout.

Karry avatar Karry commented on September 22, 2024

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?

from libosmscout.

syyyr avatar syyyr commented on September 22, 2024

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 :)

from libosmscout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.