Yesterday’s post dealt with converting point shapefiles to a text format compatible with spreadsheets. Today’s post handles the opposite – converting spreadsheet data to point shapefile format.
First step is to prepare the spreadsheet data. The first row should contain the field name for the data columns, and it’s best to modify the field name into a DBF-friendly format before conversion. That means no more than 10 characters in the field name, capital letters only, with no spaces. You should also remove commas, since the converter will read in the data in comma-separated value (CSV) format, and extra commas can throw it off. And, of course, you’ll need two columns with the coordinate data, in any coordinate system. Save the data from your spreadsheet program in CSV format.
MapWindow GIS comes with a plug-in that converts CSV files into point shapefiles. Coordinate data is used to create the point vertexes, while any additional data can be converted into an associated DBF attribute table. Look for a “Converters” menu on the top toolbar; if it’s not present, you’ll have to enable the “CSV to Shapefile converter” plug-in in the “Plug-ins” menu. Start up the converter, select the input CSV file you want to convert, and also select the comma as the field delimiter. Oddly enough, even though this is labeled a “CSV to Shapefile converter”, it will accept other characters as text delimiters as well, and the comma is not the default. Click on “Open File”, and specify the X and Y coordinate fields (Z and M are optional):
Checkboxes at the bottom allow the options of adding coordinate columns to the attribute table, converting all the other fields in the CSV file into shapefile attributes, and loading the generated shapefile into the MapWindow display. Click on Convert, specify the name and location for the shapefile to be created, and MapWindow will do the rest. Here’s the resulting map for a CSV file of US cities converted into a point shapefile:
converter: CSV to shapefile
Great link, I have been testing it out today on a large dataset. When making lines, I found that the Converter would fail if I only passed it a single point for an ID. I haven’t tested with polygons, but you will likely need 3 points (perhaps a “non-overlapping” shape, too).
Thanks for a great product.
Was wondering if its possible to do more than one at once. I have over 300 to convert.