Difference between revisions of "QGIS/C2/Importing-Spreadsheets/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 41: Line 41:
  
 
'''https://spoken-tutorial.org/'''
 
'''https://spoken-tutorial.org/'''
|| To follow this tutorial you should be familiar with,
+
|| To follow this tutorial you should be familiar with '''QGIS''' interface.
 
+
 
+
'''QGIS''' interface
+
  
  
Line 59: Line 56:
  
  
Data in the form of spreadsheet can be imported to QGIS.
+
Data in the form of spreadsheet can be imported to '''QGIS'''.
  
  
The data file must have 2 columns which contain the X and Y coordinates.
+
The data file must have 2 columns which contain the '''X''' and '''Y coordinates'''.
  
 
|-
 
|-
Line 71: Line 68:
  
 
'''https://www.qgistutorials.com'''
 
'''https://www.qgistutorials.com'''
|| To practise this tutorial you need to,
+
|| To practise this tutorial you need to download the folder given in '''Code files''' link, located below the player.  
 
+
 
+
download the folder given in code files link, located below the player.  
+
  
  
Line 84: Line 78:
 
|-
 
|-
 
|| Click on the folder '''Code-files''' to open, point to the text files.
 
|| Click on the folder '''Code-files''' to open, point to the text files.
|| I have already download the code file, extracted and saved it in a folder on desktop.
+
|| I have already downloaded the '''code file''', extracted and saved it in a folder on '''Desktop'''.
  
 
|-
 
|-
 
|| Double-click on Code-file folder.
 
|| Double-click on Code-file folder.
|| I will double-click on Code-files folder to view the contents.
+
|| I will double-click on '''Code files''' folder to view the contents.
  
 
|-
 
|-
Line 122: Line 116:
  
  
Here too we have names of cities, with '''longitude''' and '''latitude '''data.
+
Here too, we have names of cities, with '''longitude''' and '''latitude '''data.
  
 
|-
 
|-
Line 131: Line 125:
  
  
Click on '''QGIS''' icon on desktop.
+
Click on '''QGIS''' icon on '''Desktop'''.
 
|| Close the text file.
 
|| Close the text file.
  
Line 138: Line 132:
  
 
|-
 
|-
|| '''Double Click on the QGIS icon'''
+
|| Double Click on the '''QGIS''' icon
  
 
Click on '''Layers''' on menu bar.
 
Click on '''Layers''' on menu bar.
 
 
 
 
|| Click on '''Layer '''menu on the menu bar.
 
|| Click on '''Layer '''menu on the menu bar.
  
Line 178: Line 169:
 
|-
 
|-
 
|| Point to the file path in '''File Name '''text box.
 
|| Point to the file path in '''File Name '''text box.
|| In the create a layer dialog-box,  
+
|| In the create a layer dialog-box, the '''file path''' is now seen in the '''File Name''' text box.
 
+
File path is now seen in the '''File Name''' text box.
+
  
 
|-
 
|-
Line 187: Line 176:
  
  
If not click on '''CSV''' radio button to select it.  
+
If not, click on '''CSV''' radio button to select it.  
  
  
Line 197: Line 186:
  
 
Point to '''Latitude '''and '''Longitude'''.
 
Point to '''Latitude '''and '''Longitude'''.
|| '''Geometry definition''' section,
+
|| '''Geometry definition''' section will be auto-populated with''' Latitude '''and '''Longitude '''data.
 
+
 
+
will be auto-populated with''' Latitude '''and '''Longitude '''data.
+
  
 
|-
 
|-
 
|| Point to '''Latitude '''and '''Longitude'''.
 
|| Point to '''Latitude '''and '''Longitude'''.
|| Please note x-coordinate is '''longitude''' and y-coordinate is '''latitude'''.
+
|| Please note '''X-coordinate''' is '''longitude''' and '''Y-coordinate''' is '''latitude'''.
  
  
Line 231: Line 217:
 
|-
 
|-
 
|| Cursor on QGIS canvas.
 
|| Cursor on QGIS canvas.
|| The data is imported and displayed on QGIS canvas.
+
|| The data is imported and displayed on '''QGIS canvas'''.
  
 
|-
 
|-
Line 245: Line 231:
  
  
This will be demonstrated in detail in upcoming tutorials.
+
This will be demonstrated in detail in the upcoming tutorials.
  
 
|-
 
|-
Line 268: Line 254:
  
  
The path connects southern most city to the northern most city
+
The path connects southern-most city to the northern-most city.
  
 
|-
 
|-
Line 289: Line 275:
 
|-
 
|-
 
|| Cursor on the list.
 
|| Cursor on the list.
|| It shows the list of all available algorithms grouped in different blocks.
+
|| It shows the list of all available '''algorithms''' grouped in different blocks.
  
 
|-
 
|-
Line 295: Line 281:
  
  
Click on the black triangle next to  
+
Click on the black triangle next to '''Vector creation tools'''.
 
+
'''Vector creation tools'''.
+
 
|| Expand '''QGIS geoalgorithm''' by clicking on the black triangle next to it.
 
|| Expand '''QGIS geoalgorithm''' by clicking on the black triangle next to it.
  
Line 306: Line 290:
 
|| Double click on '''Points to path''' tool.
 
|| Double click on '''Points to path''' tool.
  
|| From the expanded menu, double click on '''Points to path''' tool to execute the algorithm.
+
|| From the expanded menu, double click on '''Points to path''' tool to execute the '''algorithm'''.
  
 
|-
 
|-
Line 312: Line 296:
  
  
Select '''Input point layer''' as '''Places'''.
+
Select '''Input layer''' as '''Places'''.
 
|| '''Points to path''' dialog-box opens.
 
|| '''Points to path''' dialog-box opens.
  
Line 320: Line 304:
 
|-
 
|-
 
|| Select '''Group field''' as '''type,C,16.'''
 
|| Select '''Group field''' as '''type,C,16.'''
|| From the '''Group field''' drop-down select '''type,C,16.'''
+
|| From the '''Group field''' drop-down, select '''type,C,16.'''
  
  
Line 327: Line 311:
 
|-
 
|-
 
|| Select '''Order field''' as '''Latitude,N,19,11'''.
 
|| Select '''Order field''' as '''Latitude,N,19,11'''.
|| From the '''Order field '''drop-down select '''Latitude,N,19,11'''.
+
|| From the '''Order field '''drop-down, select '''Latitude,N,19,11'''.
  
  
This denotes the path will go in the ascending order of the latitude.  
+
This denotes the path will go in the ascending order of the '''latitude'''.  
  
 
|-
 
|-
Line 336: Line 320:
  
 
From the drop-down select '''Save to file''' option.
 
From the drop-down select '''Save to file''' option.
|| Click on the button next to''' Paths''' field, from the sub-menu select, '''Save to file''' option.
+
|| Click on the button next to''' Paths''' field.
 +
 
 +
From the sub-menu select '''Save to file''' option.
  
 
|-
 
|-
Line 349: Line 335:
  
  
Select a suitable location to save the file.
+
Select a suitable location to save the file. I will select '''Desktop'''.
 
+
I will select '''Desktop'''.
+
  
  
Line 364: Line 348:
  
  
The path with file name appears on the '''Paths''' field.
+
The path with filename, appears on the '''Paths''' field.
  
 
|-
 
|-
Line 382: Line 366:
 
|-
 
|-
 
|| Cursor on the map on canvas.
 
|| Cursor on the map on canvas.
|| Using this algorithm any two points on the map can be connected by a path.
+
|| Using this '''algorithm''' any two points on the map can be connected by a path.
  
 
|-
 
|-
Line 401: Line 385:
  
 
'''About WMS'''
 
'''About WMS'''
|| About WMS
+
|| About '''WMS'''
  
  
WMS stands for '''Web Map Services'''.
+
'''WMS''' stands for '''Web Map Services'''.
  
  
WMS is an Open GIS standard specification for interactive mapping.
+
'''WMS''' is an open '''GIS''' standard specification for interactive mapping.
  
  
This is based on requesting map images from a server over the Internet.
+
This is based on requesting map images from a '''server''' over the Internet.
  
  
For this demonstration you must be connected to the internet.
+
For this demonstration you must be connected to the Internet.
  
 
|-
 
|-
Line 424: Line 408:
  
  
In the address bar type bhuvan.nrsc.gov.in
+
In the address bar type '''bhuvan.nrsc.gov.in'''
  
 
+
Press '''Enter'''.
Press enter.
+
  
 
|-
 
|-
Line 448: Line 431:
  
  
choose '''Land Use Land Cover (50K):2005-06 '''option.
+
choose '''Land Use Land Cover (50K):2005-06 '''.
  
 
|-
 
|-
Line 464: Line 447:
 
|| Click on the '''Web Services''' tab.
 
|| Click on the '''Web Services''' tab.
  
Under section, '''For QGIS, uDig, ArcGIS and Other Users, Web Map Service (WMS)URL'''
+
Under section '''For QGIS, uDig, ArcGIS and Other Users, Web Map Service (WMS)URL'''
 
+
 
+
Note the Layer id for this layer.
+
  
'''layer - "vector:KA_LULC50K_0506" '''
 
  
 +
Note the '''Layer id''' for this '''layer'''.
 
|-
 
|-
 
|| Highlight the URL.
 
|| Highlight the URL.
Line 477: Line 457:
  
 
Right click and copy the URL
 
Right click and copy the URL
|| Highlight the '''URL'''.
+
|| And highlight the '''URL'''.
  
Right click and copy the '''URL'''. http://bhuvan5.nrsc.gov.in/bhuvan/wms
+
 
 +
Right-click and copy the '''URL'''.  
  
 
|-
 
|-
Line 489: Line 470:
  
  
In the Layers menu, uncheck the '''Paths''' and '''Place''' layers to hide them.
+
In the '''Layers''' panel, uncheck the '''Paths''' and '''Place layers''' to hide them.
  
 
|-
 
|-
Line 495: Line 476:
  
 
From the sub-menu, click on '''WMS/WMTS layer.'''
 
From the sub-menu, click on '''WMS/WMTS layer.'''
 
 
 
 
|| Click on '''Layer''' menu on the menu bar, from the drop-down, select '''Add Layer.'''
 
|| Click on '''Layer''' menu on the menu bar, from the drop-down, select '''Add Layer.'''
  
Line 527: Line 505:
  
  
In the URL field, paste the copied URL link from the Bhuvan website.
+
In the '''URL''' field, paste the copied '''URL''' link from the '''Bhuvan''' website.
  
  
[http://bhuvan5.nrsc.gov.in/bhuvan/wms h][http://bhuvan5.nrsc.gov.in/bhuvan/wms ttp://bhuvan5.nrsc.gov.in/bhuvan/wms]
+
[http://bhuvan5.nrsc.gov.in/bhuvan/wms http://bhuvan5.nrsc.gov.in/bhuvan/wms]
  
 
Click on '''OK''' button at the bottom-right corner of the dialog-box.
 
Click on '''OK''' button at the bottom-right corner of the dialog-box.
Line 539: Line 517:
  
 
Click on '''OK''' button.
 
Click on '''OK''' button.
|| In the '''Save Connection''' dialog-box.
+
|| In the '''Save Connection''' dialog-box, click on '''OK''' button.
 
+
 
+
Click on '''OK''' button.
+
  
 
|-
 
|-
Line 555: Line 530:
  
 
'''Select id 971 with the name. vector:KA_LULC50K_0506.'''
 
'''Select id 971 with the name. vector:KA_LULC50K_0506.'''
|| In the id section,
+
|| In the '''id''' section, select '''id 971'''.  
 
+
Select id 971.  
+
  
  
This id corresponds to to the id layer of the WMS layer from Bhuvan website.
+
This '''id''' corresponds to to the '''id layer''' of the '''WMS layer''' from '''Bhuvan''' website.
  
 
|-
 
|-
Line 572: Line 545:
 
|-
 
|-
 
|| Cursor on canvas.
 
|| Cursor on canvas.
|| On canvas, the '''Land Use Land Cover layer''' for Karnataka is displayed.
+
|| On '''canvas''', the '''Land Use Land Cover layer''' for Karnataka is displayed.
  
 
|-
 
|-
Line 586: Line 559:
 
In this tutorial we have learnt to
 
In this tutorial we have learnt to
  
* Import speadsheets in CSV format to create a Point Layer.
+
* Import speadsheets in '''CSV''' format to create a '''Point Layer'''
  
* Convert Point Layer to a Polyline Layer. And,
+
* Convert '''Point Layer''' to a '''Polyline Layer''' and,
  
* Load '''WMS''' (Web Map Service) layer in '''QGIS.'''
+
* Load '''WMS''' (Web Map Service) layer from '''Bhuvan''' website in '''QGIS.'''
  
 
|-
 
|-
Line 596: Line 569:
  
 
'''About Spoken Tutorial project'''
 
'''About Spoken Tutorial project'''
||* The video at the following link summarizes the Spoken Tutorial project.
+
||
 +
* The video at the following link summarizes the Spoken Tutorial project.
 
* Please download and watch it.
 
* Please download and watch it.
 
  
 
|-
 
|-
Line 624: Line 597:
 
|| Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.
 
|| Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.
  
More information on this mission is available at
+
More information on this mission is available at this link.
 
+
this link.
+
  
 
|-
 
|-

Revision as of 15:11, 18 January 2019


Visual Cue Narration
Slide Number 1

Title Slide

Welcome to this tutorial on Importing spreadsheets in QGIS.
Slide Number 2

Learning Objectives

In this tutorial, we will learn to,
  • Import speadsheets in CSV format to create a Point Layer.
  • Convert Point Layer to a Polyline Layer. and
  • Load WMS (Web Map Service) layer in QGIS.
Slide Number 3

System Requirement

To record this tutorial, I am using,
  • Ubuntu Linux OS version 16.04.
  • QGIS version 2.18.
  • And a Working internet connection.
Slide Number 4

Pre-requisites


https://spoken-tutorial.org/

To follow this tutorial you should be familiar with QGIS interface.


If not for relevant tutorials please visit our website.

Slide Number 5

GIS Data


Often GIS data is available in table or spreadsheet format (.txt or .csv files)


Data in the form of spreadsheet can be imported to QGIS.


The data file must have 2 columns which contain the X and Y coordinates.

Slide Number 6

Example to Practise


https://www.qgistutorials.com

To practise this tutorial you need to download the folder given in Code files link, located below the player.


Extract the contents of the downloaded zip file.


Locate Places.txt and Places.csv files in the extracted folder.

Click on the folder Code-files to open, point to the text files. I have already downloaded the code file, extracted and saved it in a folder on Desktop.
Double-click on Code-file folder. I will double-click on Code files folder to view the contents.
Point to the files. Here you will see 2 files Places.csv and Places.txt.
Double-click on Places.csv file.


Double-click on Places.csv file.


A spreadsheet in CSV format opens.

Point to the columns.


Close the CSV file.

It has names of cities with latitude and longitude data.


Close the CSV file.

Double-click and open Places.txt file.


Point to the columns.

Double-click and open Places.txt file.


Here too, we have names of cities, with longitude and latitude data.

Click on red cross on the top-left corner.


Click on red cross on the top-left corner.


Click on QGIS icon on Desktop.

Close the text file.


Close the Code-files folder and open QGIS interface.

Double Click on the QGIS icon

Click on Layers on menu bar.

Click on Layer menu on the menu bar.
Select Add layers and then select Add Delimited Text Layer. From the drop-down list, select Add layer.


From the sub-menu, select Add Delimited Text Layer.

Create a Layer from a Delimited Text File dialog-box opens.


Click on browse

A dialog-box opens.


Click on Browse button next to File Name text box.

Desktop>> Select Places.csv.


Click on Open button.

A dialog-box opens.


Navigate to the csv file you had downloaded and saved earlier.


Click on Open button.

Point to the file path in File Name text box. In the create a layer dialog-box, the file path is now seen in the File Name text box.
In the File format section, click on CSV radio button. In the File format section, by default CSV option gets selected.


If not, click on CSV radio button to select it.


When you use .txt file, select Custom Delimiters option.

Cursor on Geometry definition section.


Point to Latitude and Longitude.

Geometry definition section will be auto-populated with Latitude and Longitude data.
Point to Latitude and Longitude. Please note X-coordinate is longitude and Y-coordinate is latitude.


Longitude specifies the east-west position of a point.


Latitude specifies the north-south position of a point.

Click on OK button. Click on OK button.
Cursor on Coordinate Reference System Selector dialog-box.


Click on OK button.

Coordinate Reference System Selector dialog-box opens.


Select WGS 84 EPSG 4326.


Click on OK button.

Cursor on QGIS canvas. The data is imported and displayed on QGIS canvas.
Cursor on QGIS canvas. A map of India opens with points.


These points correspond to different cities listed in the CSV file.

Cursor on QGIS canvas. The style and color of these point features can be changed.


This will be demonstrated in detail in the upcoming tutorials.

Slide Number 7

Assignmemt-1

As an assignment,


Import Places.txt file in QGIS.


Places.txt file is available in the folder downloaded from Code files link.

Cursor on the map. Now let us convert this Point layer to Polyline layer.
Cursor on the map. Here we will connect all the cities with a path.


The path connects southern-most city to the northern-most city.

Click on Processing menu on the menu bar.


From the drop-down select Toolbox option.

This is based on latitude data of each city.


Click on Processing menu on the menu bar.


From the drop-down select Toolbox.

Cursor on Toolbox. Processing Toolbox panel opens on the right-side of the screen.
Cursor on the list. It shows the list of all available algorithms grouped in different blocks.
Click on the black triangle next to QGIS geoalgorithms.


Click on the black triangle next to Vector creation tools.

Expand QGIS geoalgorithm by clicking on the black triangle next to it.


From the displayed list, expand Vector creation tools option.

Double click on Points to path tool. From the expanded menu, double click on Points to path tool to execute the algorithm.
Cursor on Points to path dialog-box.


Select Input layer as Places.

Points to path dialog-box opens.


Select Input layer as Places.

Select Group field as type,C,16. From the Group field drop-down, select type,C,16.


This field contains the names of the cities for all the features in the shapefile.

Select Order field as Latitude,N,19,11. From the Order field drop-down, select Latitude,N,19,11.


This denotes the path will go in the ascending order of the latitude.

Click on the button next to Paths field.

From the drop-down select Save to file option.

Click on the button next to Paths field.

From the sub-menu select Save to file option.

Cursor on Save file dialog-box.


Select Desktop location.


Type file name as Path-1.

Save file dialog-box opens.


Select a suitable location to save the file. I will select Desktop.


Name the file as Path-1.

Click on Save button.


Cursor on Paths field.

Click on Save button.


The path with filename, appears on the Paths field.

Click the check box for Open output file after running algorithm. Click the check box for Open output file after running algorithm.
Click on Run button. Click on Run button at the bottom right corner of the dialog-box.
Cursor on the map on canvas. Notice the map on the canvas.

The output path between the cities is shown.

Cursor on the map on canvas. Using this algorithm any two points on the map can be connected by a path.
Slide Number 8

Assignment-2

As an Assignment,
  • Create a path between the cities from West to East.
  • Hint: In the Points to path dialog-box, Order field drop-down use Longitude,N,19,11 option.
Cursor on the map. Now let us add a WMS layer in QGIS.
Slide Number 9

About WMS

About WMS


WMS stands for Web Map Services.


WMS is an open GIS standard specification for interactive mapping.


This is based on requesting map images from a server over the Internet.


For this demonstration you must be connected to the Internet.

Click on web browser

Type bhuvan.nrsc.gov.in


Open any web browser.


In the address bar type bhuvan.nrsc.gov.in

Press Enter.

Cursor on Bhuvan home page. Bhuvan home page opens.
Click on Thematic Services tab. Click on Thematic Services tab.


Thematic Services page opens in a new window.

Under Search tab, Select Theme drop-down,


Click on Land Use Land Cover (50K) 2005-06

In the left panel, under Search tab, under Select Theme drop-down,


choose Land Use Land Cover (50K):2005-06 .

Click on Select Geography dropdown, select Karnataka. Under Select Geography drop-down, choose Karnataka.
Click on Web services tab.


Point to Layer heading.


layer - "vector:KA_LULC50K_0506"

Click on the Web Services tab.

Under section For QGIS, uDig, ArcGIS and Other Users, Web Map Service (WMS)URL


Note the Layer id for this layer.

Highlight the URL.

URL - "http://bhuvan5.nrsc.gov.in/bhuvan/wms"

Right click and copy the URL

And highlight the URL.


Right-click and copy the URL.

Cursor on QGIS interface.


In the Layers menu, uncheck the Paths and Place layers to hide them.

Back to QGIS interface,


In the Layers panel, uncheck the Paths and Place layers to hide them.

Click Add Layer from the Layer menu.

From the sub-menu, click on WMS/WMTS layer.

Click on Layer menu on the menu bar, from the drop-down, select Add Layer.


From the sub-menu, Select Add WMS/WMTS layer.

Point to Add Layers from WMS Server dialog-box.


Under Layers tab, Click on New button.

Add Layer dialog-box opens.


In the Layers tab click on New button.


Create a new WMS Connection dialog-box opens.

Type Bhuvan in the Name field.


In the URL field, paste the copied link http://bhuvan5.nrsc.gov.in/bhuvan/wms


Click on OK button.

In Name field type Bhuvan.


In the URL field, paste the copied URL link from the Bhuvan website.


http://bhuvan5.nrsc.gov.in/bhuvan/wms

Click on OK button at the bottom-right corner of the dialog-box.

In the Save Connection dialog-box.


Click on OK button.

In the Save Connection dialog-box, click on OK button.
In the Add Layers from WMS Server dialog-box, Click Connect.


In the Add Layers dialog-box, click on Connect button.


In the id section,

Select id 971 with the name. vector:KA_LULC50K_0506.

In the id section, select id 971.


This id corresponds to to the id layer of the WMS layer from Bhuvan website.

Click on Add button.

Click on Close button.

Click on Add button at the bottom-right corner of the dialog-box.

Click on Close button.

Cursor on canvas. On canvas, the Land Use Land Cover layer for Karnataka is displayed.
Cursor on canvas. Similarly we can load any available layer of different themes.
Slide Number 10

Summary

Let us summarize,

In this tutorial we have learnt to

  • Import speadsheets in CSV format to create a Point Layer
  • Convert Point Layer to a Polyline Layer and,
  • Load WMS (Web Map Service) layer from Bhuvan website in QGIS.
Slide Number 11

About Spoken Tutorial project

  • The video at the following link summarizes the Spoken Tutorial project.
  • Please download and watch it.
Slide Number 12

Spoken Tutorial workshops

The Spoken Tutorial Project team:
  • conducts workshops using spoken tutorials and
  • gives certificates on passing online tests.

For more details, please write to us.

Slide number 13

Forum for specific questions:

Please post your timed queries on this forum.
Slide Number 14:

Acknowledgement

Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.

More information on this mission is available at this link.

This tutorial is contributed by Prajwal M from NIT Suratkal and Snehalatha from IIT Bombay.

Thank you for joining.

Contributors and Content Editors

Madhurig, Nancyvarkey, Snehalathak