Quantum GIS (QGIS) Tutorials_ Tutorial_ Importing Spreadsheets or CSV Files to QGIS

Embed Size (px)

Citation preview

  • 7/22/2019 Quantum GIS (QGIS) Tutorials_ Tutorial_ Importing Spreadsheets or CSV Files to QGIS

    1/6

    1/22/13 Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS

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

    Beginner to Advanced level Quantum GIS tutorials with screenshots

    Quantum GIS (QGIS) TutorialsQuantum GIS (QGIS) Tutorials

    QGIS Tutorials QGIS Tips Blog Resources Using These Tutorials Disclaimer GIS in India

    Tutorial: Importing Spreadsheets or CSV files toQGIS

    Many times the GIS data comes in a table or an Excel spreadsheet. If you have a lis t of lat/long coordinates and some attributes, you c an easily use this

    data in your GIS project. In this tutorial, I will show you how to import and use such t abular data into QuantumGIS. 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 Databasecontaining

    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 atext file which contains latitude and longitude of the

    earthquake centers along with other related attributes. You will see that each field is se parated bya TAB.

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

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

    Follow by EmFollow by Em

    Email address..

    Follow on TwiFollow on Twi

    Ujaval

    spatia

    Follow on GoFollow on Go

    Use These Tut

    LicenseLicense

    Tutorial: GeoreMaps, SatelliteQGIS

    Most GIS projesome raster da

    the concepts, sQGIS ...

    Tutor ia l: Importto QGIS

    Many times thean Excel sprealat/long coordincan e...

    Tutorial: Worki

    Map projectionfrustration wheproper understaccess to the ri

    Tutorial: Makin

    Often one nee

    printed or publitool called Printtake yo...

    Tutorial: Using

    Not every dataa shapefile, or ida ta would co

    Popular PostPopular Post

    underdarkGISglocal governme#austria#foss415 days ago reply

    spatialthoughtsMaps Became Ppo.st/KwIvhQ17 days ago reply

    5ShareShare More Next Blog

    http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.htmlhttp://qgis.spatialthoughts.com/2012/02/tutorial-georeferencing-topo-sheets.htmlhttp://qgis.spatialthoughts.com/2010/10/using-plugins-in-quantum-gis_05.htmlhttps://plus.google.com/116912222767108657277https://plus.google.com/116912222767108657277http://www.blogger.com/http://www.blogger.com/next-blog?navBar=true&blogID=8478705592464727054https://twitter.com/intent/tweet?in_reply_to=287204696718987264https://twitter.com/spatialthoughts/status/287204696718987264http://t.co/kH53JtbZhttps://twitter.com/intent/user?screen_name=spatialthoughtshttps://twitter.com/intent/tweet?in_reply_to=287926988050681857https://twitter.com/underdarkGIS/status/287926988050681857http://twitter.com/search?q=%23foss4ghttp://twitter.com/search?q=%23austriahttps://twitter.com/intent/user?screen_name=underdarkGIShttp://qgis.spatialthoughts.com/2012/03/using-tabular-data-in-qgis.htmlhttp://qgis.spatialthoughts.com/2012/06/making-maps-for-print-using-qgis.htmlhttp://qgis.spatialthoughts.com/2012/04/tutorial-working-with-projections-in.htmlhttp://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.htmlhttp://qgis.spatialthoughts.com/2012/02/tutorial-georeferencing-topo-sheets.htmlhttp://qgis.spatialthoughts.com/p/using-these-tutorials.htmlhttps://plus.google.com/116912222767108657277https://plus.google.com/116912222767108657277https://twitter.com/https://twitter.com/intent/user?screen_name=spatialthoughtshttp://qgis.spatialthoughts.com/2010/10/using-plugins-in-quantum-gis_05.htmlhttp://www.ngdc.noaa.gov/nndc/struts/form?t=101650&s=1&d=1http://www.gisinindia.com/http://qgis.spatialthoughts.com/p/disclaimer.htmlhttp://qgis.spatialthoughts.com/p/using-these-tutorials.htmlhttp://qgis.spatialthoughts.com/p/resources.htmlhttp://blog.spatialthoughts.com/http://qgistips.spatialthoughts.com/http://qgis.spatialthoughts.com/http://qgis.spatialthoughts.com/
  • 7/22/2019 Quantum GIS (QGIS) Tutorials_ Tutorial_ Importing Spreadsheets or CSV Files to QGIS

    2/6

    1/22/13 Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS

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

    In the dialog box, cl ick 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.

    and ...

    Tutorial: MakinGRASS

    Heatmaps aretools for denseused to easily ithere is a ...

    Tutorial: BasicQGIS

    A lot of scientifiproduces rasteessentially grid

    value ...

    Tutorial: Worki

    Terrain or elevGIS Analysis aQGIS has goodcapabilities buil

    Tutorial: Spatia

    The power ofdata sources tare seeking lieyou n...

    Tutorial: Stylin

    To create a madata and presein formative . Th

    options a...

    There was an

    http://qgis.spatialthoughts.com/2012/02/tutorial-styling-vector-data-in-qgis.htmlhttp://qgis.spatialthoughts.com/2012/02/tutorial-spatial-analysis-points-in.htmlhttp://qgis.spatialthoughts.com/2012/03/working-with-terrain-data-in-qgis.htmlhttp://qgis.spatialthoughts.com/2012/10/tutorial-basic-raster-analysis-and.htmlhttp://qgis.spatialthoughts.com/2012/07/tutorial-making-heatmaps-using-qgis-and.html
  • 7/22/2019 Quantum GIS (QGIS) Tutorials_ Tutorial_ Importing Spreadsheets or CSV Files to QGIS

    3/6

    1/22/13 Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS

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

    Labels: beginner, tutorial

    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

    Replies

    22 comments:

    Robert March 20, 2012 at 5:26 PM

    How can I import a Delimited Text File whose coordinates in UTM format?

    Reply

    Ujaval Gandhi April 30, 2012 at 2:56 PM

    http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1335778001913#c4104124920583005838http://www.blogger.com/profile/03866971061806405296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1332244589862#c2301595377068140748http://www.blogger.com/profile/13816829033089385692http://www.blogger.com/share-post.g?blogID=8478705592464727054&postID=8703052281710403164&target=facebookhttp://www.blogger.com/share-post.g?blogID=8478705592464727054&postID=8703052281710403164&target=twitterhttp://www.blogger.com/share-post.g?blogID=8478705592464727054&postID=8703052281710403164&target=bloghttp://www.blogger.com/share-post.g?blogID=8478705592464727054&postID=8703052281710403164&target=emailhttp://qgis.spatialthoughts.com/search/label/tutorialhttp://qgis.spatialthoughts.com/search/label/beginner
  • 7/22/2019 Quantum GIS (QGIS) Tutorials_ Tutorial_ Importing Spreadsheets or CSV Files to QGIS

    4/6

    1/22/13 Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS

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

    Reply

    Replies

    Reply

    Replies

    Reply

    Replies

    Reply

    Hi Robert,

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

    WGS84.

    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

    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.

    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

    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.

    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

    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

    http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1341938033433#c8527361346447754439http://www.blogger.com/profile/03866971061806405296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1341904508537#c4472483320436146589http://www.blogger.com/profile/14617848424249541412http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1341037451441#c4522498540926807880http://www.blogger.com/profile/03866971061806405296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1341006666883#c8092890159625057508http://www.blogger.com/profile/11186034571596218594http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1340257707004#c1650674523228545762http://www.blogger.com/profile/03866971061806405296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1340243350872#c3735053926711723119http://www.blogger.com/profile/10612662616482339965http://www.staying-healthy.info/http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1338427098342#c1864209835589978667http://www.blogger.com/profile/09714428031166565741http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1338120329303#c8383436555288617109http://www.blogger.com/profile/04707004357645607271
  • 7/22/2019 Quantum GIS (QGIS) Tutorials_ Tutorial_ Importing Spreadsheets or CSV Files to QGIS

    5/6

    1/22/13 Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS

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

    Replies

    Reply

    Replies

    Reply

    Replies

    Reply

    Replies

    Reply

    Elvira July 16, 2012 at 5:58 PM

    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

    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!

    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?

    ThanksReply

    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.

    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

    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.

    meles15 August 21, 2012 at 12:25 PM

    fist of all, I thank you next i would like ask some question1. 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

    Ujaval Gandhi November 20, 2012 at 8:23 PM

    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.

    http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1353423201935#c5026258382612713802http://www.blogger.com/profile/03866971061806405296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1345532157741#c5287102230410168944http://www.blogger.com/profile/08288999578526315766http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1345392869339#c1132024230251693452http://www.blogger.com/profile/03866971061806405296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1345312407728#c3393959496961348087http://www.blogger.com/profile/03431512482370474227http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1345392815018#c1189574207941179905http://www.blogger.com/profile/03866971061806405296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1344190081232#c414258470583838993http://www.blogger.com/profile/12738753095432399459http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1342611157685#c2555741461552991168http://www.blogger.com/profile/17215714559179920296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1342508144158#c8598777084285782788http://www.blogger.com/profile/03866971061806405296http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1342441694552#c4864584998231485461http://www.blogger.com/profile/17215714559179920296
  • 7/22/2019 Quantum GIS (QGIS) Tutorials_ Tutorial_ Importing Spreadsheets or CSV Files to QGIS

    6/6

    1/22/13 Quantum GIS (QGIS) Tutorials: Tutorial: Importing Spreadsheets or CSV files to QGIS

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

    Newer Post Older PostHome

    Subscribe to: Post Comments (Atom)

    Enter your comment...

    Comment as: Google Account

    Publish Preview

    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

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

    http://www.blogger.com/http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1358515112601#c5977762443300793619http://www.blogger.com/profile/03571929507440834390http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1353518103709#c1711617491688074921http://www.blogger.com/profile/07820482484386859520http://qgis.spatialthoughts.com/2012/01/importing-spreadsheets-or-csv-files-to.html?showComment=1353422061569#c6071469249493892571http://www.blogger.com/profile/08288999578526315766http://qgis.spatialthoughts.com/feeds/8703052281710403164/comments/defaulthttp://qgis.spatialthoughts.com/http://qgis.spatialthoughts.com/2011/12/digitizing-in-qgis.htmlhttp://qgis.spatialthoughts.com/2012/01/setting-up-working-grass-environment-in.html