5i1&let's&do&it:&& intro&to&qgis& leaflet&& -...

20
ITS488 – Geographic Informa5on System Teerayut Horanont, PhD Sirindhorn Interna5onal Ins5tute of Technology (SIIT) Thammasat University E: [email protected] 51 Let's do it: Intro to QGIS Leaflet a JavaScript library for mobilefriendly maps 2014 09 09 9/9/14 ITS488 1

Upload: nguyendat

Post on 10-Aug-2019

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

ITS488  –  Geographic  Informa5on  System

Teerayut  Horanont,  PhD  Sirindhorn  Interna5onal  Ins5tute  of  Technology  (SIIT)  Thammasat  University        E:  [email protected]  

5-­‐1  Let's  do  it:    Intro  to  QGIS  

Leaflet      a  JavaScript  library  for  mobile-­‐friendly  maps  

2014  09  09

9/9/14 ITS488 1

Page 2: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Today’s  Outline  

•  We  will  have  a  hands-­‐on  session  to  understand  how  to  manipulate  GIS  data  using  QGIS    (Quantum  GIS)  

•  Fun  with  you  first  map  applica5on  “leaflet”  a  JavaScript  library  for  mobile-­‐friendly  maps  

9/9/14 ITS488 2

Page 3: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Installa5on  QGIS    

h]ps://www.qgis.org/en/site/forusers/download.html  

 

9/9/14 ITS488 3

Page 4: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Requirements:  

•  GDAL  Complete  1.11  framework  package  •  NumPy  •  Matplotlib  

Then  •  QGIS  2.4.0-­‐1  

9/9/14 ITS488 4

Page 5: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14 ITS488 5

Page 6: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14 ITS488 6

Quicktool  

Toolbar  

Layer  control  

Status  bar  

Toolbox,    etc  

Map  view  

Page 7: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Add  and  display  data  

9/9/14 ITS488 7

Open  province.shp  

1    

2    

Page 8: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Iden5fy  features    

9/9/14 ITS488 8

1    

2    

Page 9: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14 ITS488 9

Explore  the  various  a]ributes  and  their  values.  

1    

Page 10: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14 ITS488 10

Which  province  that  the  total  area  is  larger  than  4000  sq.km.  and  name  end  as  “buri”?  

Q  

Page 11: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14 ITS488 11

A  

Please  save  the  result  as  new  shape  file  

Page 12: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Import  GIS  point  data  from  csv  file  

9/9/14 ITS488 12

1    

Page 13: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14 ITS488 13

ntsb_uniq_cell.csv    -­‐>  shape  file  

Page 14: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Spa5al  analysis  

9/9/14 ITS488 14

Page 15: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14

ITS488 15

Assume  that  the  mobile  signal  coverage  is  about  6  km.  from  the  cell  site.    Please  draw  the  mobile  coverage  map  in  Chiang  Rai  province  

Q

Save  the  output  shapefile  

Do  you  know  6    km.  in  decimal  degree?  

Page 16: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14 ITS488 16

9/9/14

There  were  several  big  earthquakes  happen  in  Chiang  Rai  province  in  the  past  3-­‐4  months.      Find  the  area  in  Chiang  Rai  that  were  affected  by  the  earthquake  stronger  than  Magnitude  5  and  and  possible  out  of  the  mobile  phone  signal.        Assume  that  the  possible  damage  area  from  the  earthquake  (Mag  >  5)  is  30  km.  from  the  epicenter.    

Q

Page 17: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

9/9/14 ITS488 17

Use:  eq_chiangrai_may_4above.csv  

Page 18: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Check  points  

9/9/14 ITS488 18

1)  Remove  the  created  layer.  2)  Go  to  your  working  folder,  see  how  many  files  QGIS  

generated  for  1  layer.  3)  Double  click  to  open  the  layer  again  4)  Did  you  remember  what  is  mandatory  for  

shapefile?    5)  Remove  2  files  and  double  click  to  open  again.  6)  Try  to  apply  the  layer  with  different  projec5on  and  

see  the  effect.  

Page 19: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Spa5al  analysis  ques5ons  

1.  Can  you  generate  a  region  map  from  the  given  province  map?  

2.  Can  you  count  how  many  mobile  cell  site  in  Chiang  Rai  province?      

3.  Open  the  transporta5on  network  file.  Can  you  clip  only  the  transpira5on  network  in  ChiangRai  province?  

     9/9/14 ITS488 19

Page 20: 5I1&Let's&do&it:&& Intro&to&QGIS& Leaflet&& - siit.tu.ac.th · • QGIS&2.4.0I1& 9/9/14 ITS488 4. 9/9/14 ITS488 5. 9/9/14 ITS488 6 Quicktool) Toolbar Layercontrol Statusbar) Toolbox,

Open  for  ques5ons  

9/9/14 ITS488 20