Note
Lecția a fost dezvoltată de Linfiniti și S Motala (Cape Peninsula University of Technology
Statisticile spațiale vă permit să analizați și să înțelegeți ce se întâmplă într-un anumit set de date. QGIS include mai multe instrumente standard de analiză statistică, care se dovedesc utile în acest sens.
The goal for this lesson: To know how to use QGIS’ spatial statistics tools.
În scopul de obținerii unui set de date pentru a lucra cu el, vom crea un set de puncte aleatorii.
Pentru a face acest lucru, veți avea nevoie de un set de date poligonale, care definește extinderea zonei în care doriți să creați punctele.
Vom folosi aria acoperită de străzi.
Note
You might find that your SRTM DEM layer has a different CRS to that of the roads layer. If so, you can reproject either the roads or DEM layer using techniques learnt earlier in this module.
Now you can check the sampled data from the raster file in the attributes table of the random_samples layer, they will be in a column named srtm_41_19.tif.
Un posibil strat eșantion este prezentat aici:
The sample points are classified by their value such that darker points are at a lower altitude.
Veți folosi acest strat eșantion pentru restul exercițiilor statistice.
Obține statisticile de bază pentru acest strat.
Note
You can copy and paste the results into a spreadsheet. The data uses a (colon :) separator.
To understand the statistics above, refer to this definition list:
Valoarea medie (medie) valoarea reprezintă pur și simplu suma valorilor împărțită la cantitatea de valori.
Abaterea standard. Oferă o indicație despre cât de strâns sunt grupate valorile în jurul mediei. Cu cât este mai mică deviația standard, cu atât mai apropiată tinde să fie media.
Toate valorile adunate.
Valoarea minimă.
Valoarea maximă.
Cantitatea de eșantioane/valori.
Diferența dintre valorile minime și maxime.
Dacă aranjați toate valorile de la cea mai mică la cea mai mare, valoarea de mijloc (sau media celor două valori de mijloc, în cazul în care N este un număr par) este mediana valorilor.
To generate a distance matrix using these points:
Setați-l astfel:
To do a nearest neighbor analysis:
Note
You can copy and paste the results into a spreadsheet. The data uses a (colon :) separator.
Pentru a obține coordonatele medii ale unui set de date:
Haideți să-l comparăm cu coordonatele centrale ale poligonului care a fost folosit pentru a crea eșantionul aleator.
As you can see from the example below, the mean coordinates and the center of the study area (in orange) don’t necessarily coincide:
The histogram of a dataset shows the distribution of its values. The simplest way to demonstrate this in QGIS is via the image histogram, available in the Layer Properties dialog of any image layer.
Selectați Proprietăți.
Alegeți fila Histogram. Poate fi necesar să faceți clic pe butonul Compute Histogram pentru a genera graficul. Veți vedea un grafic care descrie frecvența valorilor din imagine.
O puteți exporta ca o imagine:
The mean value is 332.8, and the maximum value is 1699! But those values don’t show up on the histogram. Why not? It’s because there are so few of them, compared to the abundance of pixels with values below the mean. That’s also why the histogram extends so far to the right, even though there is no visible red line marking the frequency of values higher than about 250.
Prin urmare, rețineți că o histogramă vă arată distribuția valorilor, dar nu toate valorile sunt în mod necesar vizibile pe grafic.
Let’s say you have a collection of sample points from which you would like to extrapolate data. For example, you might have access to the random_samples dataset we created earlier, and would like to have some idea of what the terrain looks like.
To start, launch the Grid (Interpolation) tool by clicking on the Raster ‣ Analysis ‣ Grid (Interpolation) menu item.
Iată o comparație a setului de date original (stânga) cu cel construit din eșantionul nostru de puncte (dreapta). Al dvs. poate să arate diferit, din cauza naturii aleatorii a locației punctelor de eșantionare.
As you can see, 100 sample points aren’t really enough to get a detailed impression of the terrain. It gives a very general idea, but it can be misleading as well. For example, in the image above, it is not clear that there is a high, unbroken mountain running from east to west; rather, the image seems to show a valley, with high peaks to the west. Just using visual inspection, we can see that the sample dataset is not representative of the terrain.
Folosiți aceste puncte pentru a eșantiona DEM-ul original.
Rezultatele (în funcție de poziționarea punctelor aleatorii) va arata mai mult, sau mai puțin, ca aceasta:
The border shows the roads_hull layer (which represents the boundary of the random sample points) to explain the sudden lack of detail beyond its edges. This is a much better representation of the terrain, due to the much greater density of sample points.
Here is an example of what it looks like with 10 000 sample points:
Note
It’s not recommended that you try doing this with 10 000 sample points if you are not working on a fast computer, as the size of the sample dataset requires a lot of processing time.
Originally a separate project and then accessible as a plugin, the SEXTANTE software has been added to QGIS as a core function from version 2.0. You can find it as a new QGIS menu with its new name Processing from where you can access a rich toolbox of spatial analysis tools allows you to access various plugin tools from within a single interface.
You will probably see it docked in QGIS to the right of the map. Note that the tools listed here are links to the actual tools. Some of them are SEXTANTE’s own algorithms and others are links to tools that are accessed from external applications such as GRASS, SAGA or the Orfeo Toolbox. This external applications are installed with QGIS so you are already able to make use of them. In case you need to change the configuration of the Processing tools or, for example, you need to update to a new version of one of the external applications, you can access its setting from Processing ‣ Options and configurations.
For a simple indication of the spatial distribution of points in the random_samples dataset, we can make use of SAGA’s Spatial Point Pattern Analysis tool via the Processing Toolbox you just opened.
Note
If SAGA is not installed on your system, the plugin’s dialog will inform you that the dependency is missing. If this is not the case, you can skip these steps.
Included in your course materials you will find the SAGA installer for Windows.
Once you have installed SAGA, you’ll need to configure SEXTANTE to find the path it was installed under.
Homebrew users can install SAGA with this command:
If you do not use Homebrew, please follow the instructions here:
http://sourceforge.net/apps/trac/saga-gis/wiki/Compiling%20SAGA%20on%20Mac%20OS%20X
Now that you have installed and configured SAGA, its functions will become accessible to you.
The output will look like this (the symbology was changed for this example):
The red dot is the mean center; the large circle is the standard distance, which gives an indication of how closely the points are distributed around the mean center; and the rectangle is the bounding box, describing the smallest possible rectangle which will still enclose all the points.
Often, the output of an algorithm will not be a shapefile, but rather a table summarizing the statistical properties of a dataset. One of these is the Minimum Distance Analysis tool.
It does not require any other input besides specifying the vector point dataset to be analyzed.
QGIS oferă multe posibilități de analiză a proprietăților statistice spațiale pentru seturile de date.
Acum, că am acoperit analiza vectorială, de ce să nu vedem și ce se poate face cu rasterele? Asta e ceea ce vom face în modulul următor!