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 

Question about Geomap.CreateAndLoadEmptyMap

 
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 5:17 pm    Post subject: Question about Geomap.CreateAndLoadEmptyMap Reply with quote

How do I calibrate an empty Geomap that I create with the CreateAndLoadEmptyMap function?

Greetings,

Jaap
_________________
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: Sat Oct 01, 2011 7:13 am    Post subject: Reply with quote

Jaap,

you need not calibrate the resulting map - it is automatically calibrated using an equirectangular projection.

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: Sun Oct 02, 2011 12:29 pm    Post subject: Reply with quote

Hans,

Thanks for the reply.

In my work to cut up a sample map page in to 128x128 tiles and store these in GeoDB I come across some unexpected behaviour.

1. My sample chart is made up of a sample of a high resolution map using Mercator projection. When I add the given calibration points (70 per map) the resulting corners of the map in the xml dot not form a rectangular box. For example the bottom right corner longitude is a bit more east or west as the bottom left corner. This map in GeoMap works perfect, so calculations pix to position and vice versa work very well.

2. I cut this map (Geomap.MapBitmap) up in several 128x128 tiles and store these in GeoDB. In GeoDB (with the viewer you supplied) I notice that several tiles that are on one line do not exactly have the same top or bottom latitude.

3. I calculate the top, bottom and left and right margins of all tiles in GeoDB and create a new Geomap with this information. For testing I give the width and height of the original bitmap map.
When I then draw all tiles from GeoDB I notice that sometimes a tile is one pixel lower as it should be.

4. However when I load the original XML of the source bitmap with the original calibration points I do get an exact copy of the source bitmap. This seems to indicate that the automatic callibration does not work for this map material.

This leaves me with a puzzle that I did not yet manage to crack.

If you have some suggestions they would be more than welcome.

Why do I do all this?

I have several maps that together form an atlas of Holland. I do not want to flip pages , but want to cut up all these maps in to tiles and then show a 'custom' map depending of the 'viewport' a user wants to see. This view can be made up from tiles that originate from for example 3 maps.

Greetings,

Jaap
_________________
Jaap van Goor
Promanent b.v.


Last edited by jvgoor on Wed Oct 05, 2011 10:14 am; edited 1 time in total
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 Oct 05, 2011 10:12 am    Post subject: Reply with quote

Here is the content of the original xml file:
Code:

<?xml version="1.0"?>

<!-- TGeoMap Calibration / SDL Component Suite -->
<geomap sig="SDLCSuite" vers="1.0" id="m18_z1" model="biquadraticpn" map="C:\ProgramData\Promanent\Vaaratlas\m18_z1.bmp" caption="">
<corners>
[52.68988,5.57963] [52.56038,5.58008] [52.56038,5.88303] [52.68988,5.88348]
</corners>
<resolution>4.232</resolution>
<calquads npoints="70">
[52.68016,5.59572,256,256] [52.68020,5.62783,768,256] [52.68022,5.65994,1280,256] [52.68024,5.69205,1792,256] [52.68024,5.72416,2304,256] [52.68024,5.75627,2816,256] [52.68023,5.78837,3328,256] [52.68021,5.82048,3840,256] [52.68018,5.85259,4352,256] [52.68015,5.87605,4726,256] [52.66070,5.59578,256,768] [52.66073,5.62787,768,768] [52.66075,5.65997,1280,768] [52.66077,5.69206,1792,768] [52.66078,5.72416,2304,768] [52.66077,5.75625,2816,768] [52.66076,5.78835,3328,768] [52.66074,5.82044,3840,768] [52.66071,5.85254,4352,768] [52.66069,5.87598,4726,768] [52.64123,5.59584,256,1280] [52.64126,5.62792,768,1280] [52.64129,5.66000,1280,1280] [52.64130,5.69208,1792,1280] [52.64131,5.72416,2304,1280] [52.64131,5.75624,2816,1280] [52.64130,5.78832,3328,1280] [52.64128,5.82040,3840,1280] [52.64125,5.85249,4352,1280] [52.64122,5.87592,4726,1280] [52.62176,5.59590,256,1792] [52.62180,5.62797,768,1792] [52.62182,5.66003,1280,1792] [52.62184,5.69210,1792,1792] [52.62184,5.72417,2304,1792] [52.62184,5.75623,2816,1792] [52.62183,5.78830,3328,1792] [52.62181,5.82036,3840,1792] [52.62178,5.85243,4352,1792] [52.62175,5.87585,4726,1792] [52.60230,5.59596,256,2304] [52.60233,5.62801,768,2304] [52.60235,5.66006,1280,2304] [52.60237,5.69212,1792,2304] [52.60238,5.72417,2304,2304] [52.60237,5.75622,2816,2304] [52.60236,5.78827,3328,2304] [52.60234,5.82033,3840,2304] [52.60231,5.85238,4352,2304] [52.60229,5.87579,4726,2304] [52.58283,5.59602,256,2816] [52.58286,5.62806,768,2816] [52.58289,5.66010,1280,2816] [52.58290,5.69213,1792,2816] [52.58291,5.72417,2304,2816] [52.58291,5.75621,2816,2816] [52.58290,5.78825,3328,2816] [52.58288,5.82029,3840,2816] [52.58285,5.85232,4352,2816] [52.58282,5.87573,4726,2816] [52.56675,5.59607,256,3239] [52.56678,5.62810,768,3239] [52.56680,5.66012,1280,3239] [52.56682,5.69215,1792,3239] [52.56683,5.72417,2304,3239] [52.56682,5.75620,2816,3239] [52.56681,5.78823,3328,3239] [52.56679,5.82025,3840,3239] [52.56676,5.85228,4352,3239] [52.56674,5.87567,4726,3239]
</calquads>
</geomap>

As you will notice the longitude of the corners do not form a rectangle.
Greetings,

Jaap
_________________
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 Oct 12, 2011 5:58 pm    Post subject: Reply with quote

Jaap,

while I have to admit that I do not fully understand your problem, I suspect that this 1-pixel offset is due to a round-off effect.

Keep in mind that the calibration is a regression model which has to deal with integer pixels. So, if you cut out tiles, the number of calibration points of this tile is less than that of the entire map; as a consequence the calibrations functions of the individual tiles differ slightly from the overall calibration - which may result in 1-pixel shifts on rounding.

-

Anyway, this brings me to pay some attention to work with map tiles in the future. So in the end there should be a new component working with tiles. However, I know that this does not do any help to you, since I won't have time to work on that before the end of the year (sorry to say so, but I can't change that).

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: Thu Oct 13, 2011 10:39 am    Post subject: Reply with quote

Hans,

Thanks for the reply. It was my conclusion also that the 1 pixel offset would be caused by a rounding effect. Maybe we will do one more experiment with the new calibration in the XE2 set, but for now we decided to forget this track.

I am glad to hear that you also plan to support tiles. I think this is the road ahead. Almost all geoserver sources like Google, Openstreetmap etc. work with tiles and offer great API's and access to the tiles directly.

So we that is why we decided to forget our own tiles with calculated lat and long and stick to the way these sources work with tiles.

A nice view of what can be achieved with that can be found at:
http://www.klokan.cz/projects/gdal2tiles/overlay/openlayers.html

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