MapWindow 5 - open source GIS Desktop Application

MapWindow v5 - How to help?

In early May 2015 I posted the following appeal in order to try to get some new .NET developers involved in the MapWindow 5 project:

Any Unit Test developers around with some free time?
I'm part of an Open Source GIS project written in .NET v4 and we are rewriting our application. A s most Open Source projects we are short on volunteers and the few that are on the project don't have much experience with Unit Tests, so they are not written. It would be great if an experience Unit Test developer could assist us and get us on track.

Luckilly for us several developers reacted positive.

Below we created a step-by-step workflow, which will help you getting started.
MapWindow relies on MapWinGIS, which is our C++ ActiveX mapping control. MapWinGIS in its turn relies on several external libraries, like GDAL, GEOS and Proj4.

Update:  We've created a Release branch which holds the compiled version of MapWinGIS to make it easier to just compile MapWindow 5.

MapWindow 5 - The most user-friendly open source GIS desktop application

Update: Pre-build MapWinGIS binaries

To make it easier for MapWindow 5 contributors we've created a Release branch on mapwindow5.codeplex.com.
This Release branch holds the needed MapWinGIS binaries and the source code of MapWindow 5 which will work with that version of MapWinGIS.
Weekly we will merge the Release branch with the current trunk and update the MapWinGIS binaries.
Don't forget to re-register the ocx when it is updated. Run the following file as Admin: D:\dev\MapWindow-v5\src\regMapWinGIS.cmd
The steps mentioned below are still needed.

Compiling MapWindow 5

Step 1:
Get the source code from mapwindow5.codeplex.com. Check out the trunk or Release branch (see above).
I assume you save the source code at D:\dev\MapWindow-v5\.
Step 2:
With MapWindow 5 we use SyncFusion's Essential Studio. They have a community license you can use. Claim your free license here.
Step 3:
Make sure you registered MapWinGIS (the ocx). Now you should have no problems compiling MapWindow with Visual Studio 2013.
The solution file is D:\dev\MapWindow-v5\src\MW5.sln
We already started with some unit tests at D:\dev\MapWindow-v5\test. That might be a good starting point for creating new unit tests.
GIS-data is in a seperate SVN repository: gisdata.codeplex.com. This data can be freely used.

MapWindow 5 - Development set up

Because it might be difficult to set up your development environment when you just want to use the Release branch, we've made the following action plan:

  1. Start with a fresh virtual machine with Win8.1.
  2. Download and install all updates.
  3. Download and install Visual Studio 2013 Community Edition (it's free).
  4. Download and install all updates again.
  5. Download and install Syncfusion WinForms (no need to get the full Essential Studio).
  6. Run Syncfusion's Dashboard and run the tool to install all in the GAC.
  7. Start Visual Studio, go to the Team Explorer. Clone the mapwindow5.codeplex.com GIT repository. Next switch to the Release branch.
  8. Start Windows Explorer and go to the folder you saved the MW5 source. Go to the 'src' folder and run 'regMapWinGIS.cmd' as Admin (right click on the file and select 'Run as Admin'). On my first time I did get an error, but also the message that the MapWinGIS.ocx was properly installed. To make sure I ran the command file again and this time no errors just success.
  9. Now finally open MW5.sln and recompile the solution. Everything should build just fine.
  10. Make sure the MW5 project is set as startup project and run the application.
  11. At gisdata.codeplex.com we've put some sample data you can use. It is a svn repository, so easier to get only some of the data.
    Just drop a .shp file on the map and it will open.
  12. A quick start for MapWindow Lite (the predecessor of MW5) can be found here. This document might help to get started.
  13. We will try to regularly commit the latest version of MW5 and MapWinGIS.ocx to the Release branch. If this happens you need to do steps 8 and 9 again.
  14. When you have questions you can ask them in the discussion tab.

MapWinGIS - The C++ mapping engine

Update:  If you are not going to work on MapWinGIS, it is recommended you use the Release branch at mapwindow5.codeplex.com. It holds the pre-build binaries for MapWinGIS.

Compile MapWinGIS

Step 1:
Get the source code from mapwingis.codeplex.com. Most of us use Source Tree to clone the GIT repo.
I assume you save the source code at D:\dev\MapwinGIS\.
Don't forget to get the dev494 branch!
SoureTree settings
Step 2:
Get the GDAL binaries, libraries and header files from gisinternals.com
Download these 2 zipfiles: compiled binaries and compiled libraries and headers.
Unzip them in D:\dev\MapwinGIS\support\GDAL_SDK\v120 in the appropriate subfolders.
Step 3:
Start Visual Studio as an administrator (because the ocx will be registered after compiling), the visual studio 2013 solution file is D:\dev\MapwinGIS\src\MapWinGIS.sln
Step 4:
Make sure the pre-build event to copy the GDAL_SDK files is enabled. Everytime you update the GDAL_SDK this needs to be enabled:
MapWinGIS Build events
Step 5:
Compile the solution for Release|Win32 or Debug|Win32. Visual Studio still can't handle 64Bit ActiveX controls.

Known errors

  • cannot open file 'mfc120.lib' The solution is to download and install the Multibyte MFC Library for Visual Studio 2013
  • Can't register the ActiveX control Most likely you didn't run Visual Studio as an Admin. If you did run VS as admin, you might want to try to compile the first time with 'Register output' to No. When that compiles fine, set 'Register output' to Yes again and recompile.