You are on page 1of 6

1/22/13

Share 5

Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS
More Next Blog

Quantum GIS (QGIS) Tutorials


Beginner to Advanced level Quantum GIS tutorials with screenshots QGIS Tutorials QGIS Tips Blog Resources Using These Tutorials Disclaimer GIS in India

Tutorial: Importing Spreadsheets or CSV files to QGIS


Many times the GIS data comes in a table or an Excel spreadsheet. If you have a list of lat/long coordinates and some attributes, you can easily use this data in your GIS project. In this tutorial, I will show you how to import and use such tabular data into Quantum GIS. We will using a plugin called Add Delimited Text Layer for this. The dataset we will use comes from NOAAs National Geophysical Data Center. We will be importing the Significant Earthquake Database containing information about all major earthquakes globally. Examine your tabular data source. To import this data to QGIS, you will have to save it as a text file and need at least 2 columns which contain the X and Y coordinates. If you have a spreadsheet, use Save As function in your program to save it as a Tab Delimited File or a Comma Separated Values (CSV) file. Once you have the data exported this way, you can open it in a text editor such as Notepad to view the contents. In case of the Significant Earthquake Database, the data already comes as a text file which contains latitude and longitude of the earthquake centers along with other related attributes. You will see that each field is separated by a TAB.

Follow by Email
Email address...

Follow on Twitter
Ujaval

spatialthough

underdarkGIS great interv local government #austria #foss4g


15 day s ago reply

spatialthoughts Google's M Maps Became Personal - A po.st/KwIvhQ


17 day s ago reply

Follow on Google+

In Quantum GIS, enable the Add Delimited Text Layer plugin. In you dont have it, refer to this tutorial on finding and adding plugins.

View my c

License

Use These Tutorials to T

Popular Posts

Tutorial: Georeferencing Maps, Satellite Image or QGIS Most GIS projects requir some raster data. In this the concepts, strategies QGIS ...

Once enabled, you will see a menu item under Layers Add Delimited Text Layer. Click on it to open the plugin.

Tutorial: Importing Sprea to QGIS Many times the GIS data an Excel spreadsheet. If lat/long coordinates and can e...

Tutorial: Working with Pr Map projections often ca frustration when working proper understanding of access to the rig...

Tutorial: Making Maps fo Often one needs to crea printed or published. QG tool called Print Compos take yo...

Tutorial: Using Tabular D Not every dataset you w a shapefile, or in a spati data would come as a ta

qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html

1/6

1/22/13

Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS
and ...

Tutorial: Making Heatma GRASS Heatmaps are one of the tools for dense point dat used to easily identify fin there is a ...

Tutorial: Basic Raster An QGIS A lot of scientific observa produces raster dataset essentially grids of pixels value ...

Tutorial: Working with Te Terrain or elevation data GIS Analysis and it is oft QGIS has good terrain p capabilities built...

Tutorial: Spatial Analysis The power of GIS lies in data sources together. O are seeking lies in many you n...

Tutorial: Styling Vector D To create a map, one ha data and present it in a informative. There are a options a...

There was an error in th


In the dialog box, click on Browse and specify the path to the text file. Then in the delimiters section, check the Tab delimiter. If your data is in CSV format, you should check the comma as the delimiter. The plugin will try to guess the correct X and Y coordinate fields. In our case they are LONGITUDE and LATITUDE. You may change it if the plugin selects the wrong fields. Click OK.

In the next screen, you will be asked to select the Coordinate Reference System. Since the earthquake coordinates are in WGS84, we select that. Click OK.

qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html

2/6

1/22/13

Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS

You will now see that the data will be imported and displayed in the QGIS canvas. The layer is now imported and ready for analysis. You may right click on the layer and select Save As to save it as a shapefile. This way you can readily use it again without importing.

+5 Recommend this on Google

Labels: beginner, tutorial

22 comments:
Robert March 20, 2012 at 5:26 PM How can I import a Delimited Text File whose coordinates in UTM format? Reply Replies Ujaval Gandhi April 30, 2012 at 2:56 PM

qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html

3/6

1/22/13
Hi Robert,

Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS

You can follow the same process, but choose the appropriate UTM CRS in the Coordinate Reference System Selector instead of WGS84. Reply

hello May 27, 2012 at 5:35 PM sir pls teach me how to use wro claw 1.7 version topogragphy plug ins with azimuth and disntance Reply

hana escariote May 31, 2012 at 6:48 AM good tutorial i really learn a lot

importance of good health Reply

cirex June 21, 2012 at 7:19 AM Helo! I already imported the csv format and there is only 1 point.How am i going to do see all the points? Reply Replies Ujaval Gandhi June 21, 2012 at 11:18 AM

I am not sure. Did your file have valid lat/long coordinates? Open attribute table and see if all points are there but the location defaulted to a single point. ( like 0,0). Make sure you select the correct X and Y fields when importing. Reply

HealthMaps June 30, 2012 at 3:21 AM two of the fields in my earthquake data are quoted text which has commas inside, for example columns Region, long, lat which appear as "Lima,Peru",-121.213,45.644 in the data but using the "Add Delimited Text Layer" plug-in it seems to want to read it in as Region = Lima, long = Peru, lat = -121.213. As if the quotes are ignored in the data and the commas within the quoted text are seen as delimiters. How can I correct this? Thanks Reply Replies Ujaval Gandhi June 30, 2012 at 11:54 AM

Hi. There's no easy way. One way to correct this would be to change the delimiter for the file. You can open the data in a spreadsheet program, merge the Lima and Peru columns and then export with a different delimiter like ':'. When importing, select ':' as your delimiter. Reply

Barry Smith July 10, 2012 at 12:45 PM Hi there, I wonder if you could clear up an issue I am having with this method of import - I have a CSV file containing x, y, and z values (unfortunately not gridded, so I cannot simply rename the file .xyz and use it thus). I can import this into QGIS without any real problems, but when I save it as a shape file, then inspect that layer, all the points have the correct x and y coordinates, but the z coordinate seems to have disappeared. My ultimate plan is to rasterize this data and then combine a few different datasets. Any help would be appreciated. Reply Replies Ujaval Gandhi July 10, 2012 at 10:03 PM

You can directly import your text file and create a grid via Raster -> Analysis -> Grid which uses gdal_grid command to create a DEM directly from a text file with x,y,z coordinates. http://www.gdal.org/gdal_grid.html#gdal_grid_csv Reply

qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html

4/6

1/22/13
Elvira July 16, 2012 at 5:58 PM

Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS
In another tutorial you say that csv files/tables can be imported using Add Vector Layer. However, is the difference in importing them using the method in this tutorial is that QGIS looks for coordinates in the table to map points? And if Add Vector Layer is used, you need to use a join? Thanks Reply Replies Ujaval Gandhi July 17, 2012 at 12:25 PM

Yes, the difference in the two methods is if your CSV/table file has coordinates ( x,y coordinates for points or WKT strings for line/polygons ) you can import them directly using the 'Add delimited text' plugin. If they do not have coordinate information, you need to join it with another existing layer with coordinates, so you need to use Table Joins.

Elvira July 18, 2012 at 5:02 PM Great, thanks! Reply

Alejandro Lemmo August 5, 2012 at 11:38 PM Hello, I'm working with the Delimited text plug in, and works fine, but, is there a way to add more data to a point, for example, settlement data. I have an Excel spreadsheet with daily measurement for each point that I would like to display or associate to a point. How can I do this if I have already loaded the layer with the points using the delimited text plug in? Thanks Reply Replies Ujaval Gandhi August 19, 2012 at 9:43 PM

You'll need to do a table join (http://qgis.spatialthoughts.com/2012/03/using-tabular-data-in-qgis.html) using a common field between your CSV file and excel. Reply

PB August 18, 2012 at 11:23 PM Hi - when I import a csv file (x,y points plus data), is a dynamic link created to the original file? That is, if I update my original datafile, will my qgis project show the update when I re-open it? Many Thanks! Reply Replies Ujaval Gandhi August 19, 2012 at 9:44 PM

No. This is a static import, so you'll have to import it again when the source file has changed. Reply

meles15 August 21, 2012 at 12:25 PM fist of all, I thank you next i would like ask some question 1. is there an extension that used to make a polygon using points? 2.can you show me the steps to make a polygon using points in qgis? thank you Reply Replies Ujaval Gandhi Hi, There is a plugin called 'Points2One'. You can use it to convert points to polygons. Converting points to polygon is tricky. You need 2 things to make it work correctly - An attribute in the point layer that identifies which points are part of which polygon - An attribute that identifies the order in which the points need to be joined to form the polygon. The plugin may work in some cases without this, but you may get errors. Try it out and let me know how it goes. Reply November 20, 2012 at 8:23 PM

qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html

5/6

1/22/13

Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS
meles15 November 20, 2012 at 8:04 PM after importing the x,y coordinates which are the vertices of parcels of farmers then how can i make a polygons using these points in qgis? Reply

Zaher Chehayeb November 21, 2012 at 10:45 PM Is there a method for importing a csv file using Add Delimited Text Layer plugin and preserving UTF-8 encoding? The problem is that when I import using the Add Delimited Text Layer plugin, UTF-8 characters are not being imported correctly. Reply

Mark Pryor January 18, 2013 at 6:48 PM Hi I have used the delimted text layer import and it works fine but all the text types will not be allowed to categorize. In my case I am using type Chemical symbol? How can I change the .csv file (I have tried formatting cells but it reverts on import.)to read the same or double as the others which are selectable in categorize? Reply E n t e ry o u rc o m m e n t . . .

Comment as: Google Account Publish Preview

Newer Post

Home
Subscribe to: Post Comments (Atom)

Older Post

2010 Ujaval Gandhi. Awesome Inc. template. Powered by Blogger.

qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html

6/6

You might also like