[Interest] Qt Location custom osm plugin and high res tiles

maitai maitai at virtual-winds.org
Wed Feb 20 20:44:01 CET 2019


Thanks for the explanation, that part about high-dpi is now clear, and 
was worth the question :)

I am porting a (=my) QWidget application (with tiled maps) to QML Map, 
many things are better with qml but of course I am sure I will need in 
the end to build my own plugin. For instance in some cases I have 
encrypted tiles that I cannot just serve un-encrypted through an 
internal tcpserver that will reply to anyone, obviously. Ideally the 
plugin itself should do the decryption, from disk cache or not. There 
are some other tricky cases.

Thanks again
Philippe.

Le 20-02-2019 18:29, Paolo Angelelli a écrit :
> The way this works is that the logical tile size (in osm case fixed at
> 256x256) is
> independent of the physical tile size (in your case 512x512).
> 
> QtLocation/Qt/OpenGL will basically push the pixels through the tiles
> either by enabling mipmapping
> if the tile on-screen size is < tile physical size, or bilinear
> interpolation if the opposite is true.
> 
> in case of x1 screens, with 512x512 tiles (lets call them @2x), this
> is enough to give you a sharp map all the way through zooming.
> 
> with a high-dpi screen it's different. at x2, you will get sharp maps
> at integer zoom levels only, but in between you won't have enough
> pixels and will get tiles bilinearly interpolated because of that.
> 
> To get a map that is sharp all the way through zooming on an x2
> screen, you would need @4x rasters, which however become overkill
> (1024x1024 tiles would probably kill most desktop HW).
> 
> So it's a matter of tradeoff there
> 
> 
> 
> On Wed, 20 Feb 2019 17:33:05 +0100
> maitai <maitai at virtual-winds.org> wrote:
> 
>> Hi Paolo,
>> 
>> My initial question was concerning a custom map type, not a derived
>> plugin. So basically you are saying that on a retina x2 screen I can
>> send back 512x512 tiles and the plugin will mark the tile with
>> pixelRatio = 2 (i.e not just rescale it) ?
>> 
>> But in fact I would prefer to be able to create my own plugin, because
>> the charts I am using are just local (some of them drawn on the fly,
>> some of them stored in mbtiles, some of them encrypted, and 
>> potentially
>> I also need vector tiles). For the time being I create a thread for 
>> each
>> type of map which is also a QTcpServer, but I would prefer to be able 
>> to
>> communicate directly and control more things at the plugin level. I 
>> will
>> investigate all this once more.
>> 
>> Thanks again for you replies
>> Philippe.
>> 
>> Le 20-02-2019 09:59, Paolo Angelelli a écrit :
>> > I may have misunderstood what you meant with "custom osm plugin".
>> > What does that mean?
>> > If you meant "a modified osm plugin", then you would be already using
>> > this class anyway.
>> > If you meant "custom map type", then just feeding 512x512 tiles should
>> > work.
>> >
>> > On Wed, 20 Feb 2019 08:38:44 +0100
>> > maitai <maitai at virtual-winds.org> wrote:
>> >
>> >> Hi,
>> >>
>> >> Seems to me that QGeoCameraCapabilities is a private qt API?
>> >>
>> >> From what I found on the net seems it would help a lot for customizing
>> >> own map plugin or tile server, but it's not clear how I can access it.
>> >>
>> >> Philippe
>> >>
>> >> Le 19-02-2019 19:40, maitai a écrit :
>> >>
>> >> > Thanks I'll give it a try
>> >> >
>> >> > -------- Message d'origine --------
>> >> > De : Paolo Angelelli <paolo.angelelli at qt.io>
>> >> > Date : 19/02/2019 7:21 PM (GMT+01:00)
>> >> > À : interest at qt-project.org
>> >> > Objet : Re: [Interest] Qt Location custom osm plugin and high res tiles
>> >> >
>> >> > Hi, yes it's easy.
>> >> > All you have to do is setting the appropriate QGeoCameraCapabilities for the map types you have high dpi tiles for.
>> >> > So in your case, set the tilesize to 256x256, so that you will have more data per logical pixel.
>> >> >
>> >> > hope it's clear enough. Or just check how it's done in either osm or here or mapbox plugins
>> >> >
>> >> > On Tue, 19 Feb 2019 09:51:30 +0100
>> >> > maitai <maitai at virtual-winds.org> wrote:
>> >> >
>> >> >> Hello,
>> >> >>
>> >> >> Is it possible to use high res tiles with a custom osm plugin?
>> >> >> In fact I created my own local server and would like to know if I can
>> >> >> send high res tiles, for instance if devicePixelRatio is 2 I would send
>> >> >> 512x512 tiles, expecting Qt Location to set the tile pixel ratio to 2.
>> >> >>
>> >> >> Thanks
>> >> >> Philippe.
>> >> >> _______________________________________________
>> >> >> Interest mailing list
>> >> >> Interest at qt-project.org
>> >> >> https://lists.qt-project.org/listinfo/interest
>> >> >
>> >> > _______________________________________________
>> >> > Interest mailing list
>> >> > Interest at qt-project.org
>> >> > https://lists.qt-project.org/listinfo/interest
>> >> >
>> >> > _______________________________________________
>> >> > Interest mailing list
>> >> > Interest at qt-project.org
>> >> > https://lists.qt-project.org/listinfo/interest
>> >
>> > _______________________________________________
>> > Interest mailing list
>> > Interest at qt-project.org
>> > https://lists.qt-project.org/listinfo/interest
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> https://lists.qt-project.org/listinfo/interest
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest



More information about the Interest mailing list