This project is read-only.

Map Rotation

Jan 8, 2011 at 5:37 PM

Hi,

I've just discovered MapWinGIS and it looks like a great tool.  I'm looking at producing a satellite-navigation type application and are looking for a way to rotate the map with vehicle direction.  I saw a discussion on the main message board from last year about adding rotation support and have downloaded the 4.8.2 OCX but can't find the functionality.  Is map rotation available or likely to come to an OCX build soon?

Many Thanks,

Ed

Jan 12, 2011 at 12:42 PM

Hi Ed, so far no one has had luck with fast/seamless/easy map rotation in our ActiveX control. You may have more success with rotation using our other software, DotSpatial.codeplex.com.

- Dan
--------
Daniel P. Ames Ph.D.
Idaho State University Dept. of Gesciences
dan.ames@isu.edu
--------
Sent from my Droid
Mekong Delta,
Southern Vietnam

On Jan 9, 2011 12:37 AM, "ed_whittaker" <notifications@codeplex.com> wrote:
> From: ed_whittaker
>
> Hi,I've just discovered MapWinGIS and it looks like a great tool. I'm looking at producing a satellite-navigation type application and are looking for a way to rotate the map with vehicle direction. I saw a discussion on the main message board from last year about adding rotation support and have downloaded the 4.8.2 OCX but can't find the functionality. Is map rotation available or likely to come to an OCX build soon?Many Thanks,Ed
>
>
Jan 15, 2011 at 5:36 PM

Ed,

rotation functionality is implemented I believe. The following methods are available:

Map.MapRotationAngle()

Map.GetRotatedExtent()

Map.GetBaseProjectionPoint()

To rotate the map you need simply to set Map.MapRotationAngle property. I tried it just now and it worked (Map.DoubleBuffer should be set to true).

I haven't time to test the functionality properly, so let us know in case there are some problems.

The initial discussion of the topic is here: http://www.mapwindow.org/phorum/read.php?5,17541

Regards,

Sergei

Feb 13, 2011 at 5:11 PM

Sergei,

I just downloaded the 4.8.2 OCX and the associated dlls and got it to register fine.  However, I can not find the MapRotationAngle method?  or any of the other methods listed above. 

Can you check on your end and let me know what you find?

Thanks,

Greg

Feb 13, 2011 at 8:12 PM
sleschinski wrote:

Ed,

rotation functionality is implemented I believe. The following methods are available:

Map.MapRotationAngle()

Map.GetRotatedExtent()

Map.GetBaseProjectionPoint()

To rotate the map you need simply to set Map.MapRotationAngle property. I tried it just now and it worked (Map.DoubleBuffer should be set to true).

I haven't time to test the functionality properly, so let us know in case there are some problems.

The initial discussion of the topic is here: http://www.mapwindow.org/phorum/read.php?5,17541

Regards,

Sergei

 

Sergei,

I just downloaded the 4.8.2 OCX and the associated dlls and got it to register fine.  However, I can not find the MapRotationAngle method?  or any of the other methods listed above. 

Can you check on your end and let me know what you find?

Thanks,

Greg

Feb 14, 2011 at 7:27 PM
Edited Feb 14, 2011 at 7:28 PM

Greg,

the methods definitely are present and work in my current version.

So,

- have you tried to download the latest version (12 of Feb)?

- are your sure that you have appropriate interop dlls?

Regards,

Sergei

Feb 14, 2011 at 7:37 PM
sleschinski wrote:

Greg,

the methods definitely are present and work in my current version.

So,

- have you tried to download the latest version (12 of Feb)?

- are your sure that you have appropriate interop dlls?

Regards,

Sergei


I have downloaded the latest 4.8.2 ocx and all the dlls in the http://svn.mapwindow.org/svnroot/SupportLibraries/bin/Win32/ directory.

I am using VS 2008.  I didn't see the interop dlls there.  Are they located someplace else?

Thnaks,

Greg

Feb 14, 2011 at 10:20 PM
sleschinski wrote:

Greg,

the methods definitely are present and work in my current version.

So,

- have you tried to download the latest version (12 of Feb)?

- are your sure that you have appropriate interop dlls?

Regards,

Sergei


Ok, I THOUGHT i downloaded the right OCX but there is only the Nov 10,2010 OCX avaialable.  I tried to download the code and compile on my machine but have over 200 errors so it won't compile.  IS there a link to just the Feb 12 OCX?

Thanks,

Greg

Feb 15, 2011 at 12:07 AM

Greg,

the binaries are in the downloads section of this site. If there are troubles with them, report it ASAP.

As for errors, most likely you haven't downloaded the support libraries.  They are here (just in case): http://svn.mapwindow.org/svnroot/SupportLibraries/

Regards,

Sergei

Feb 15, 2011 at 12:34 AM
sleschinski wrote:

Greg,

the binaries are in the downloads section of this site. If there are troubles with them, report it ASAP.

As for errors, most likely you haven't downloaded the support libraries.  They are here (just in case): http://svn.mapwindow.org/svnroot/SupportLibraries/

Regards,

Sergei


Where is the Feb 12 OCX?  I have downloaded all the files in  that directory.

Greg

Feb 15, 2011 at 1:15 AM

Strange enough. It's there: downloads section->Other Available Downloads->MapWinGIS-32bit-12-feb-11.rar

the direct link

Feb 15, 2011 at 1:28 AM
sleschinski wrote:

Strange enough. It's there: downloads section->Other Available Downloads->MapWinGIS-32bit-12-feb-11.rar

the direct link


Ok, I am not sure what an .rar file is?  However, I did download the code and finally got it to rebuild on my machine.  I found the rotation method.  Works great.  I have another problem, but I need to do a little more digging on my end.  A large tif file that opened fine in v4.7.5 seems to hang the app now.  I will let you know if I can not figure it out.

Thanks.

But again, how do i unzip(?) an .rar file?

Feb 15, 2011 at 2:15 AM
sleschinski wrote:

Strange enough. It's there: downloads section->Other Available Downloads->MapWinGIS-32bit-12-feb-11.rar

the direct link


Sergei,

Ok, I can't seem to get this file to load properly.  It is produced by the US government and it would load fine with the v4.7.5 OCX.

A zip file containing it can be found at http://naco.faa.gov/Enroute/01-13-2011/ENR_L17.zip

Can you try to load it and see what happens for you?

Thanks in advance

Greg

Feb 15, 2011 at 2:27 AM

It loads good in both MW4 and C# app, with just this:

            OpenFileDialog dlg = new OpenFileDialog();
            MapWinGIS.Image img = new MapWinGIS.Image();
            dlg.Filter = img.CdlgFilter;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                img.Open(dlg.FileName, MapWinGIS.ImageType.USE_FILE_EXTENSION, false, null);
                axMap1.AddLayer(img, true);
            }
Where is the problem?

Feb 15, 2011 at 2:41 AM
sleschinski wrote:

It loads good in both MW4 and C# app, with just this:

 

            OpenFileDialog dlg = new OpenFileDialog();
            MapWinGIS.Image img = new MapWinGIS.Image();
            dlg.Filter = img.CdlgFilter;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                img.Open(dlg.FileName, MapWinGIS.ImageType.USE_FILE_EXTENSION, false, null);
                axMap1.AddLayer(img, true);
            }
Where is the problem?

 


I use vb.net but I don't think that would be a problem.  It seems that when I remove the associated .tfw file, the image loads.  Try unzipping the tfw file from the zip and see what happens.  On my side it will step thru the code just fine, but all i get is an hour glass cursor and the app hangs.

 

Greg

Feb 15, 2011 at 3:20 AM
Edited Feb 15, 2011 at 3:21 AM

I renamed the file to .tfwx -> .tfw, and now I see it indeed. Wait cursor and nothing happens. It seems I know the reason.

From the last summer ocx handles both 2nd and 3rd parameters of the world file. In simplified form we can say that they do rotation of the image.

In your file the 2 parameters are very small values. So actually there is no transformation here. But it appeared to be the problem for OCX.

The fast way to fix it - edit the file and set 2nd and 3rd parameters to 0. In 4.7.5 version this parameters were skipped, so you don't miss anything.

I'll try to work on this problem when there is time. But it's highly possible that GDAL is responsible here. QGis which implements image rotation

in the same manner (using GDAL) have the problem with your image as well.

Feb 15, 2011 at 1:23 PM
sleschinski wrote:

I renamed the file to .tfwx -> .tfw, and now I see it indeed. Wait cursor and nothing happens. It seems I know the reason.

From the last summer ocx handles both 2nd and 3rd parameters of the world file. In simplified form we can say that they do rotation of the image.

In your file the 2 parameters are very small values. So actually there is no transformation here. But it appeared to be the problem for OCX.

The fast way to fix it - edit the file and set 2nd and 3rd parameters to 0. In 4.7.5 version this parameters were skipped, so you don't miss anything.

I'll try to work on this problem when there is time. But it's highly possible that GDAL is responsible here. QGis which implements image rotation

in the same manner (using GDAL) have the problem with your image as well.


Ok.  Let me know when you have a fix.  You might also want to try http://naco.faa.gov/Enroute/01-13-2011/ENR_L01.zip or http://naco.faa.gov/Enroute/01-13-2011/ENR_L02.zip or http://naco.faa.gov/Enroute/01-13-2011/ENR_L03.zip or http://naco.faa.gov/Enroute/01-13-2011/ENR_L04.zip because their tfw files have large non-zero numbers for the two rotation numbers.

Greg

Feb 23, 2011 at 4:23 AM
sleschinski wrote:

I renamed the file to .tfwx -> .tfw, and now I see it indeed. Wait cursor and nothing happens. It seems I know the reason.

From the last summer ocx handles both 2nd and 3rd parameters of the world file. In simplified form we can say that they do rotation of the image.

In your file the 2 parameters are very small values. So actually there is no transformation here. But it appeared to be the problem for OCX.

The fast way to fix it - edit the file and set 2nd and 3rd parameters to 0. In 4.7.5 version this parameters were skipped, so you don't miss anything.

I'll try to work on this problem when there is time. But it's highly possible that GDAL is responsible here. QGis which implements image rotation

in the same manner (using GDAL) have the problem with your image as well.


Sergei,

I found a workaround for the app hanging when those values are non-zero.  I basically have renamed the tfw file to a different name, read the parameters into my application and  used the formula from http://en.wikipedia.org/wiki/World_file to produce the proper long/latitude values I need.

So no rush.

Greg