June 24th, 2007
We’ve demonstrated a number of smaller projects over the past couple of months showcasing some simple mapping and XNA applications. Now things are starting to get more interesting as we build upon what we’ve learned in an effort to create more interesting products. This next series of posts combines aspects from several of our projects, including World Mapper, Using Mapserver, Mapscript Demo, and the Image Swapping example. Basically, we now have the opportunity to incorporate Mapserver-generated images into an XNA program.
Read the rest of this entry »
Posted in Mapserver, XNA
June 17th, 2007
We’ve already discussed in general how XNA could be used as our graphics engine for building a mapping application. Today we will demonstrate a specific example of XNA in action as it relates to map images.
Let’s assume that we have a map image already generated by a mapping engine (Mapserver/Mapscript for example).

Read the rest of this entry »
Posted in XNA
June 9th, 2007

The final portion of this project involves adding some map functionality to our program. As a quick review, we first setup Mapserver on our computer and then created a simple desktop application (part 1, part 2) that used the Mapscript API.
Read the rest of this entry »
Posted in Mapserver
June 2nd, 2007
Continuing with our exploring into Mapscript, our desktop mapping application needs some more setup. Our last post added a map file constant and now we will add two more variables to our form:
const string MAP_FILE = @"C:\ms4w\apps\gmap\htdocs\gmap75.map";
mapObj m_map;
rectObj m_fullExtent;
Both are Mapscript objects. The first (m_map) is our map object that will be the primary class used in this project. The second will simply remember the extent of the map upon startup, which is usually also the full extent of the map.
In the form’s constructor method, we setup our map to match our picture box size and the define the full extent:
m_map = new mapObj(MAP_FILE);
m_map.width = picMap.Width;
m_map.height = picMap.Height;
m_fullExtent = new rectObj(m_map.extent.minx, m_map.extent.miny,
m_map.extent.maxx, m_map.extent.maxy, 0);
Read the rest of this entry »
Posted in Mapserver
May 26th, 2007
In our last post, we setup MapServer using the MS4W package. That tutorial enabled us to have a working web mapping environment on a desktop machine without much hassle. If you haven’t read that post, I encourage you to read it before continuing.
Today’s project will build off that setup by creating a small desktop application that uses MapServer’s ability to generate map images. Since MapServer is just a program (mapserv.exe) and some required DLLs, it is possible to create stand-alone applications that don’t have a web component.
Introducing Mapscript
In their own words…
MapScript provides a scripting interface for MapServer for the construction of Web and stand-alone applications. MapScript is used independently of CGI MapServer, it is a loadable module that adds MapServer capability to your favorite scripting language. MapScript currently exists in Php, Perl, Python, Ruby, Tcl, Java, and C# flavors.
Read the rest of this entry »
Posted in Mapserver
May 19th, 2007
UPDATE: This post was originally posted in May 2007 but since has been updated to cover the more recent release of Mapserver version 5.0.0.
Most of our recent posts have focused on topics relating more to the components of a mapping application then on the maps and data. This post begins the first of several posts discussing free and open source mapping software applications. After introducing each software, we will explore various ways to create applications around them.
Introduction to MapServer
One of the most popular open source GIS applications is MapServer. Initially developed by the University of Minnesota, MapServer has evolved into a fast and easy-to-use internet map server.
“MapServer is an Open Source development environment for building spatially-enabled internet applications. MapServer is not a full-featured GIS system, nor does it aspire to be. Instead, MapServer excels at rendering spatial data (maps, images, and vector data) for the web.” – http://mapserver.gis.umn.edu/
Read the rest of this entry »
Posted in Mapserver
May 13th, 2007
This project demonstrates how to use the new font support in XNA by building a basic console type application. Eventually it could be combined into a more robust program but for now we just want to focus on text input. For an introduction to the new XNA font support, see our last post.
Our definition of a console consists of two parts. First is the command prompt line where the user can enter text, press enter, and something occurs if the user enters a valid command. Below that line are past lines of text that the user has typed or it could be used to display information about the program.

Read the rest of this entry »
Posted in XNA
May 6th, 2007
The recent release of Microsoft’s XNA Game Studio Refresh offers one important new feature: font support. If we want to build any sort of mapping application, text is an absolute necessity. So here is a quick tutorial of how to incorporate font into a XNA program. For a complete description, check out the Game Studio documentation.
Font Preparation
Font is treated similar to any other 2D sprite in XNA except for the source of the texture. Instead of relying on graphics, XNA obtains the font from the font files already installed on your computer. Examples include Times New Roman, Courier New, and Arial.
Preparing to use a font is simple. In any XNA program, right-click in the Solution Explorer and select Add New Item. Scroll to the bottom and select the Sprite Font icon:

Read the rest of this entry »
Posted in XNA
April 28th, 2007
Microsoft has released an update (”refresh”) for the XNA Game Studio Express so I encourage everyone to go and download it. This update includes official support for fonts which we will start using very soon here at Spatial Horizons. Before you can install this 83MB update, you must have the C# Express Service Pack 1 installed first.
Posted in XNA
April 16th, 2007
This project continues our initial exploration into creating mapping applications using XNA. Last time we setup the basic application and today we will add some new functionality.
Resizing the Image
I first created a larger background image (800 pixels x 400) to be used for the rest of this project. Two new variables were added:
int mapWidth = 800;
int mapHeight = 400;
…and used in the Initialize Function:
graphics.PreferredBackBufferWidth = mapWidth;
graphics.PreferredBackBufferHeight = mapHeight;
Read the rest of this entry »
Posted in XNA