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 openoffice. Show all posts
Showing posts with label openoffice. 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 3: Adding External data


1. Using Openoffice.org Calc to create a table of capture data
 a) Create the following columns: Trap_ID, Date, Captures, FTD.
 b) Enter trap numbers from 10-30 for three different dates in December.
• Enter random values for capture data.
• Calculate Flies/Trap/Day (FTD) as captures/14  (each trap is checked once every two
weeks)
• You should have 60 rows of data, 20 rows for each date.
 c) Use “Data Pilot” (or “Pivot Table” in Excel) to create a new table (in a new sheet)
• Trap_ID in the first column, and dates in each successive column and FTD data in the
table.
• This new table will have 4 columns (TrapID, and three columns for the three dates) and
20 rows, one for each Trap_ID.
 d) Enter a new set of column headers in the top row:
• Trap_ID in the first column, and for the date columns enter:“FTD_ddmm” (where
dd=day, mm=month)
• Remove the original column header from the pivot table
 e) Export the new table to a dbf format file (in Geodata\Exercises directory). Name the
dbf file trap_data.dbf.
 2. Merge data into a shapefile
 a) Start a new QGIS project and load the traps shapefile from Geodata\fruitfly.
 b) Use the Tool plugin: Vector-> Data Management->Join Attribute data to attach
the above dbf file to the traps GIS layer. The column “Trap_ID” from the trap_data dbf
file will connect to the Trap_ID column in the traps layer. Name the new shapefile
traps_ftd.shp
 c) Open the attribute table of traps_ftd and verify that the attribute columns of FTD data are
available for all dates.
 d) Display the traps_ftd layer with “Graduated symbol” so that higher FTD values display as
larger circles. Choose to classify into 5 categories, and switch between each of the date
columns to display FTD for each date.
 e) When you find a suitable symbology for the FTD data, save as a QGIS style file. Name the
file standard_ftd_style.qml