April 2nd, 2007
We will now create a simple XNA program that uses some of the functionality discussed in our last 2 posts (XNA and GIS [1][2]). It will also introduce how to include input from the keyboard and mouse.
For the first time, we’ve added the option to download the source code at the bottom of this page. The primary reason for doing this is because our projects are becoming too complex to list the entire source code in the post itself. Instead, we will now try to highlight only the new and most important code snippets.
Read the rest of this entry »
Posted in XNA
March 25th, 2007
As mentioned in our previous post, XNA offers a graphical framework to build some cool mapping applications. We will first discuss several coding techniques as it relates to our objectives before building an actual XNA program. For more general XNA tutorials, I encourage you to see some of the sites discussed in the last post.
Open Visual C# Express (after installing the XNA Game Studio Express) and create a new Windows Game. The new project comes with all of the base XNA code already setup in several functions. In fact, you can go ahead and press F5 to compile and run the program right away. A form should display with a light blue background.
Read the rest of this entry »
Posted in XNA
March 17th, 2007
Put very simply, our ultimate goal is to build a mapping application from scratch. Obviously, this will take some time so we will split this objective into several smaller projects. The first set of projects will work towards creating a program that features mapping, “mash-up” capabilities, and GPS integration.
Why build a GIS from scratch when there are both open source and proprietary mapping applications available? Because it’s fun…and it provides a tremendous learning experience on the core topics of geography and computer science. Having complete control over the program, from the map engine to the interface, also presents the unique opportunity to create an application designed exactly the way you want.
Read the rest of this entry »
Posted in XNA
March 11th, 2007
In our last post, we created an application that queried the GeoNames webservice and returned the results into a table. A logical next step would be to add the capability to map the results on a world map. So today will be use some of the code we already wrote for the WorldMapper project to add that functionality.
Here is how my final form looked after I added a world map picture and 2 new buttons:

Read the rest of this entry »
Posted in GeoNames
March 4th, 2007
In this demonstration, a simple C# application will be created to search the GeoNames database and display the results in tabular form. Let’s begin by creating a new Windows Application in Visual C# Express.
A simple form can be set up to capture the necessary input parameters: location name, country, and the number of rows returned. At the bottom of the form, add a DataGridView control to display the XML results. My completed form looks like this:

Read the rest of this entry »
Posted in GeoNames
February 25th, 2007
Geonames.org is a great resource for free geographic information. It is a collection of millions of locations that can be searched online or downloaded for offline use. In this project, we will build a simple application to query the Geonames web service and display the results in a table and on a map.
Read the rest of this entry »
Posted in GeoNames
February 15th, 2007
One of the objectives of this website is to create our own mapping applications. This requires a strong knowledge base of geography, mathematics, and computer programming. So before we can jump into the more advanced projects, we have to start with the basics. We’ve already been investigating GPS in our previous posts but today we will create a very basic mapping application.
Our “World Mapper” program begins by acquiring a map of the earth. I downloaded this one from Wikipedia Commons and shrunk it down to 400 pixels by 200 pixels.

Read the rest of this entry »
Posted in C#
February 4th, 2007
Continuing with our GPS program, we now need to add a method to read from the GPS device. This step will grab the NMEA information, parse it, and store it in the classes provided in from the Coding 4 Fun project.
public bool ReadData()
{
byte[] bData = new byte[256];
try
{
_port.Read(bData, 0, 256);
_protocol.ParseBuffer(bData);
_validData = true;
return true;
}
catch
{
_validData = false;
return false;
}
}
Read the rest of this entry »
Posted in GPS
January 29th, 2007
Using the information in the previous 3 posts, we can now build our own GPS solution based on the Coding 4 Fun project. Our objective is to create a DLL that can be used in future projects that need to read from GPS devices. The DLL will serve as the interface between the program and a GPS device.
Read the rest of this entry »
Posted in GPS
January 21st, 2007
As I mentioned before, Microsoft’s Coding 4 Fun GPS project contains a math error when calculating latitude and longitude. I’ll first provide a brief review of the NMEA protocol to better understand the error and how to correct it.
GPS receivers communicate using the NMEA protocol. Another device, such as a computer, receives the data in the form of NMEA sentences. There are several different types of NMEA sentences that allow for information on location (GPGGA), accuracy (GPGSA), satellite reception (GPGSV), etc. to be transmitted.
Read the rest of this entry »
Posted in GPS