www.sdlsuite.com Forum Index www.sdlsuite.com
Discussion of technical aspects of the SDL Component Suite
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using tiles in GeoMap and GeoDB

 
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack
View previous topic :: View next topic  
Author Message
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Wed Sep 28, 2011 3:22 pm    Post subject: Using tiles in GeoMap and GeoDB Reply with quote

Many charting and mapping programs work with tiles. Are there any samples for working with tiles in combination with the GeoPack?

What we want to achieve. We have several pages that together form the map of Holland. Some are overlapping and some areas are missing. When we would "stitch" all the pages together the resulting image would be to big to handle as each page is about 65 Mb and there are more than 100 pages all together. So the idea is to cut all pages in to tiles (for example 128x128 pixels) and to only show the tiles that are visible in a viewport way.

If you have any tips or suggestions I would be very happy.

Yours sincerely,

Jaap van Goor
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Tue Jan 31, 2012 4:08 pm    Post subject: Working with tiles Reply with quote

I am trying to work with Tiles in the Geomap component. Creating a tile and loading this calibrated (bit)map in Geomap works fine. The real problem/challenge starts when you want to zoom or pan the map outside the area loaded in the Mapbitmap.

Typically every zoom level has its own set of tiles. You do want to use this as these tiles are usually of better quality as a bitwise zoom of the map image. Zooming thus means loading a new set of tiles, combine them to one viewport image and calibrating this again. Time consuming ...

The same goes for panning the map outside the mapbitmap that is loaded in Geomap. Just a small set of 256x256 tiles in many colours can grow over the max. map/image size that is allowed in Geomap. For example I find 12x12 tiles of 256x256 pixels in full colour a workable size that stays within the size limits of Geomap. (256x256 is the standard for Google Maps or for example Open Streetmap)

To make it more easy it would be great to use multi threading. For example a zoom would mean a Geomap zoom of the already loaded Mapbitmap and in another thread the loading of the new tiles. Once these are loaded they should overdraw de Mapbitmap, which would then be Geomap.Magnification=1 again. I studied the sources a bit and it might be usefull to have direct access to the bitmap that is actualy shown next to the already existing access to MapBitmap.

But of course all this is not a proper tiling engine as Geomap is not a tiling engine. So for best performance a tiling engine should be incorporated in the core of Geomap itself.

Anyway it must be possible to make a very well performing tiling engine as all online samples are in java or even javascript and seem to work fine, fast and smooth. Unfortunatedly I cannot find any coding examples in Delphi or ObjectPascal. Anybody has experience with this? I'd love to hear.

Greetings,

Jaap van Goor
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Mon Apr 23, 2012 10:23 am    Post subject: Tiles and overlays in Geomap Reply with quote

As you know I keep on working using different sources for my maps. Tiles like offered in OpenStreetMap are great for what I need.

Geomap now only offers to load maps (image plus calibration file) or construct a map by loading an image file and setting the calibration. This means you prepare the whole map outside Geomap and offer this to Geomap. Setting Geomap.MapBitmap is actually a call to Assign that means the function SetMapBitmap copies the image to the memory bitmap in Geomap (GrafBMP); When Geomap paints the map a copy of GrafBMP called AuxBmp is used to construct the visible bitmap using the appropriate magnification etc.. GrafBMP stays always the same.

For my work I need the possibility to overlay graphics over this shown Bitmap. For example: when using tiles there are several zoom levels available. So when the magnification is equal to a better zoom level I want to be able to overlay these tiles over the original image. To speed things up I only want to do this for the current view. After panning the map a new area will be visible, thus Paint is called again, the new overlay event will be triggered and I will be able to overlay a new view with the correct tiles.

To do this the proper way I request a new event to be triggered after resizing GrafBMP and this drawing this on AuxBmp, but before starting to draw landmarks. This will allow to insert overlays and tiles in a better zoom scale and over this show the landmarks etc.. This event should give direct access to the canvas to draw on.

GeoAtlas now does for example draw an outline on the map in the OnDataRendered event handler. This event is called after all landmarks are drawn. I would like to see a new "overlay insert"* event before landmarks start te be drawn.
* alternatively can be called OnStartDrawLandMarkEvent

Hope this is a nice idea for the next 10.1 version ?
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
hlohning



Joined: 08 Sep 2006
Posts: 277
Location: Austria

PostPosted: Wed Apr 25, 2012 10:38 am    Post subject: Reply with quote

Hi Jaap,

I completely agree that GeoPack should offer some kind of a "tiled map". However, after thinking over to implement it in the existing GeoMap, I doubt whether this would be any good (due to the overall layout of TGeoMap).

So what I'm intending to do is to create a completely new mapping engine which solely works on tiles (which are obtained either from a local storage or from a Web server).

However, this will take some time, the implementation has to wait until early summer (for now we have to struggle to finish the announced release 10.1).

Kind regards,

Hans
_________________
Hans Lohninger
Software Development Lohninger
http://www.lohninger.com/
Back to top
View user's profile Send private message Visit poster's website
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Wed Apr 25, 2012 11:27 am    Post subject: Tiles and overlays in Geomap Reply with quote

Hans,

I agree that a mapping engine dedicated to tiles is better as trying to squeeze this in to the existing TGeoMap.

For now I will continu to use my container objects and some small changes in you code of TGeoMap. Like for example the addition of an event that is triggered after resizing the image and before anything else like calibration points and landmarks are drawn.

And of course we wait for a new tile mapping engine.

Greetings,

Jaap
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group