This tutorial will teach the user how to use a delimited text file containing X,Y coordinate data and turn it into a shapefile for use with GIS software. A delimited text file is an attribute table with each column separated by a defined character and each row separated by its own line. The first row usually contains the column names. A common type of delimited text file is a CSV (Comma Separated Values) with each column separated by a comma.
Download the sample data here. This is a CSV file containing the coordinates of theU.S. states in latitude and longitude. The file has three columns: state, longitude, latitude.
The process for completing this tutorial will be to import the CSV file, define its delimiter and X Y fields, define the coordinate reference system, and export to a shapefile to be saved on disk.
This tutorial has been designed for QGIS 1.7
Open QGIS and click on the “Add Delimited Text Layer” button
.
Under “File Name” browse to the location of the sample CSV file.
Under “Selected delimiters” put a check next to “Comma” and make sure there are no checks on any other delimiter. This option specifies the character(s) that are used to separate columns in your attribute table.
Under “X Y fields” set the X field to be “long” and the Y field to be “lat”. QGIS will use this information to draw points on the map.
Ensure the “Sample text” displays 3 columns with correct values and press “OK”.
You should see a map displaying the locations of each of your records.
To export the file as a shapefile, right click it in the layers menu and choose “Save As”.
Under “Format”, choose “ESRI Shapefile”.
Browse to the location you would like to save your shapefile and give it a name.
Under CRS, click the browse button. This will allow you to specify the Coordinate Reference System. Our data is in geographic coordinates and located across the U.S. so we will set this to NAD83.
Under “Geographic Coordinate Systems”, select NAD83 (EPSG:4269) and click “OK”.
If desired, add the data source information and layer name then click “OK” to generate the shapefile. You will receive a message saying the vector file has been saved.
Note: The Save As function can export your data to many different vector formats other than ESRI Shapefile such as AutoCAD DXF, GeoJSON, GML, KML, MapInfo File, Microstation DGN, SQLite and more.
0 commentaires