Monday, November 17, 2008

Shapefile Importer

While we are still deciding on a topic as of now. I have started working on a shape file importer for the XNA content pipeline.

A shapefile is a popular Geospatial vector data format, and contains different types of shape data, from 2dD points, polylines, polygons to 3d shapes.

The datafile I'm using is from the 'thematic mapping' blog, and contains the borders of all the countries.

The shapefile comes in a binary format, however there was enough information on the wikipedia to write an importer for it. I haven't done anything like this before, and it was actully easier then I thought it would be.

Here is a sample of the border data drawn in XNA;



The shapefile comes with a database file in an xBase format, which contains information for the shapes, in the case of the world border data, it has information like Country Codes, Names and Populations. I have also written an importer for this.

Michael

No comments: