liste

Bonjour et bienvenue dans mon site ! Willkommen auf meiner Seite! welcome in my homepage! http://assistance-en-sig.blogspot.com/ SIG ; Bases de données ; Géomatique; Python; ArcGIS; QGIS;

recherche

Showing posts with label OSM. Show all posts
Showing posts with label OSM. Show all posts

Wednesday, October 31, 2012

GIS Training with QGIS - Exercise 5: Using the Field Calculator


1. Load OSM layer
a) From the directory Geodata\vector\OSM load the OSM vector layer.
b) In Settings->Project Properties choose the CRS Pulkovo(1948) EPSG:3330. Verify
that the units are set to meters. Be sure to check the “Enable on the fly” checkbox. Use the
“Zoom Full” button to zoom back to the OSM layer.
2. Edit new polygon layer.
a) Create a new vector polygon layer. Add two attribute columns: FarmerName as text and
AreaSqm as a whole number. Call the new layer Fields, and save in the
Geodata\Fruitfly directory.
b) Start editing the new layer, and digitize four or five new polygon fields on the map. Enter a
farmer's name in the Farmer_Name column for each field. When you're finished, stop
editing.
c) Open the layer's Attribute table and click the Edit button. Now click the Field Calculator
button, to start the Field calculator. Check the Use existing field option and select
the AreaSqm field. Then click the Area button. Stop editing and close the Field
calculator. Examine the results and close the Attribute table.
3. Create a spreadsheet data table.
a) Using Openoffice.org or Excel create a table with two columns: Farmer and Yield. In the
Farmer column enter the exact same names as in the polygon shapefile attribute table. In
the Yield column enter some numeric values.
b) Save the spreadsheet as a dbf file, yields.dbf in the Geodata\Fruitfly directory.
4. Field Calculator
a) Now, back to QGIS, select the menu item Vector->Data Management->Join
Attributes. Select the Fields shapefile as the target, and the FarmerName column as
the target join field. Click the Join dbf table radio button, and browse to select the new
yields.dbf file. Use the Farmer column as the Join field. For the output shapefile, click
browse and enter the name farmer_yields.shp into the Geodata\Fruitfly directory.
After clicking OK answer Yes to add the new shapefile to the map.
b) Select the new farmer_yields layer in the table of contents, and open its attribute table.
c) Begin editing and click the Field Calculator. In the New Field section enter
Yld_per_Ha as the Output field name. Set it's Output field type as Decimal
number.
d) Now using the available fields and the operator buttons, create the following expression in
the lower Field calculator expression window:
( Yield / AreaSqm ) * 10000. Click OK to run the calculation.
5. Display using Graduated symbol.
a) Open the Properties window, Symbology tab, for the farmer_yields layer.
b) Select to display using Graduated symbol. Choose the Yld_per_Ha column as the
Classification field, and choose Number of classes equal to the number of polygons in
your farmer_yields layer. Now click the Classify button, and click OK to examine the
results.

Friday, October 26, 2012

GIS Training with QGIS - Exercise 2: Editing


1. OpenStreetMap plugin
 a) Start a new empty QGIS project, set projection again to WGS84.
 b) Click Plugins->Fetch Python Plugins. When the list has refreshed, find the
OpenStreetMap plugin and click install.
 c) On the OpenStreetMap toolbar click Load OSM from file. Browse to the directory
Geodata\vector\OSM and load the file sarajevo.osm
 2. Point layer from a table
 a) Now load the shapefile traps from the Geodata\fruitfly directory. Symbolize as red triangles.
 b) Locate the CSV file trap_locations.csv in the Geodata\fruitfly directory.
 c) Import the CVS file using the Delimited Text plugin. Choose ',' (comma) as the delimiter.
 d) Convert the trap locations to a shapefile (right-click on the layer name). Name it traps_tbl.shp
and save in the Geodata\fruitfly directory. Now load the new shapefile (“Add Vector Layer”
button).
 3. Digitize new point layer
 a) Zoom in to the traps layer.
 b) Click on the “New vector layer” button to create a new vector layer within QGIS, as a point layer
with two columns: Trap_ID as Whole Number, and TrapType as String. Call the layer
traps_digitize.shp in the Geodata\fruitfly directory.
 c) Start editing this new layer and digitize ten new points south of Sarajevo. Give the points Trap_ID
numbers 201, 202,...210.
 d) Save the layer. Save the project  in Geodata\exercises as fruitfly.qgs
 4. Merge three point layers into one
 a) Start editing the traps.shp layer
 b) Copy all points from traps_tbl into traps by activating the traps_tbl layer, and selecting all
traps in that layer. Click the copy button. Then activate the traps layer and use the paste buttons to
insert all the points from traps_tbl into traps.
 c) In the same way, copy all points from traps_digitize into traps.
 d) Move some of the points to make a better distribution of traps.
 e) Save changes.
 5. Edit attribute table
 a) Open the attribute table of traps, and begin editing
 b) Enter an appropriate value for each trap in the column “TrapType”.
 c) Save the edits and save the project.