Showing posts with label QGIS. Show all posts
Showing posts with label QGIS. Show all posts

Tuesday, 30 June 2015

Using the Clipper (Raster tools) in QGIS 2.8.1


CLICK HERE TO WATCH YOUTUBE VIDEO DEMO

Task
To demonstrate how to use the Clipper tool in QGIS 2.8.1 to clip out a section of a GeoTIFF image.

Procedure

Add the already registered raster image. Go To Raster > Extraction > Clipper
a

In the Clipper dialog box, name the output file. For the demo, Extent Clipping mode is selected. Select the extent by dragging the cross cursor to form a square around the area that is to be clipped out. Once that is done, the extent coordinates will automatically appear in the dialog window. Click OK.
b

A Processing completed message box will appear. A new raster layer will appear on the Layers window.
c

Right Click on the new layer > Zoom to Layer. The layer will appear in view.
d

The new layer may not have copied the correct CRS from the layer it was clipped from. To adjust the CRS, Right Click on the new layer >Set Layer CRS
e

In the dialog box, select the corresponding CRS. For the demo, Minna/Nigeria West Belt is selected.
f

Zoom to layer and observe the layer is now displaying the appropriate coordinates.
g

Thank you for the audience.

Friday, 15 May 2015

Performing Spatial Query on feature layers in QGIS


Document1-001



A Spatial Query is one made on the spatial element of the database. Unlike a query based on attributes, it is the feature's topology (relationship with other objects in the same geographic extent) of the object that is queried.

Task

This demonstration illustrates the spatial query to be carried out on feature layers in QGIS in order to resolve customer complaints to a Utility Company. The Utility Company has a Tariff Map that delineates areas within a city into High, Medium and Low Tariff Blocks (red boxed).

1

Subsequently, Customer complaints from Parcels-543,435 and 378 (as seen above) have reached the Company Office about abnormally high utility bills. In order to save time and money, the Company GIS team will analyze the complaints so as to forward the viable complaints to the ground teams.
Steps
Three spatial queries were performed.
- Spatial query to know which Parcels fall within the Low Tariff Block.
- Spatial query to know which Parcels fall within the High Tariff Block.
- And a third Spatial query to ascertain whether there are Parcels that overlap between the Low and High Tariff Blocks.

Procedure
1. Go to Vector >Spatial Query >Spatial Query
2

2. In the Spatial Query dialog box, we first want to determine which parcels are completely within the Low Tariff Block especially in respect to the complaint from Parcel 543. We Select Source features- PARCELS that are WITHIN target or reference feature- LOW TARIFF BLOCK. Two parcels are highlighted- 302 and 304 but 543 is not highlighted but it falls within the Low Tariff Block. But also note that Parcels 435 and 378 are not highlighted.
3

3. Right Click on the Parcels layer >Open Attribute Table to see that the Selected Parcels were highlighted.
4

4. See the Selection of our Spatial Query highlighted in blue.
5

5. We run another spatial query to ascertain which Parcels are within the High Tariff Block. The result shows that Parcels- 435 and 378 fall within the High Tariff block. Parcel 543 again is not within the High Tariff Block.
6
6. To further filter the data, we run a third spatial query selecting the Parcels that overlap into the High Tariff Block. Viola! Parcel 543 is selected.
7


Results of the Spatial Query
  1. for Customer Complaints from Parcels- 543, 435 and 378. Read brown box.8
  2. Hope you enjoyed the post.
     Keep practicing so we can share your experience.

Sunday, 10 May 2015

Uploading vector layers from QGIS and store in GPS receiver (USB Port) using DNR GPS







 YouTube Video Link


Overview
This post is what I would like to call the USB route to uploading GPX layers from QGIS into a USB Port GPS receiver.
Note-
- The GPS receiver- Garmin Dakota series- comes with only USB Port. If your receiver comes with a serial com port, you can do the upload direct without going through DNR GPS.
- Apart from converting files, DNR GPS also serves as an upload vehicle for GPS receivers.
- The DNR GPS is not acting as a converter in this procedure but an upload vehicle.
- In QGIS, one can digitize layers on the image using GPX file format direct.

Task
We want to create and upload layers (point, line and polygon) from QGIS and store as waypoints, route and track in our GPS receivers. Steps to follow- (a) Trace out waypoint, route and track layers on the image in QGIS; b) Upload to the GPS receiver using DNR GPS.
Note- One can save it straight into the GPX folder in the drive of the receiver but this denies one the opportunity that DNRGPS offers, which is, viewing the contents of the GPX file before upload.

Procedure
1. Launch QGIS. Go to Layer>Create new layer>Create new GPX layer.
2

2. Digitize waypoint, route and track features (point, line and polygon) on the image. The waypoints are in red, the route in purple and the track in yellow. Make sure the layers are properly saved after digitizing.
12

3. Launch DNR GPS. Go to File>Load from>File. Navigate to the folder where the gpx file was saved. Open the gpx file from the working folder. A message box will show indicating the file has been successfully loaded.
pix 5

4. Click on Waypoints and the waypoints created in QGIS will appear. Take a good look at the Tracks(red boxed) and Route buttons(green boxed). Note that the tracks and routes that were created were also uploaded together with the waypoints. Click on them to check the contents.
15

5. Go to Track and click Upload. Do the same for route and Waypoint. A message box saying Upload Complete indicates the file has been uploaded to the GPS receiver.
Capture-2


6. Disconnect the GPS receiver and check for the uploaded waypoints, route and track.
TrackRouteWaypoints_001

Hope you are already practicing with the QGIS. Feel free to send your feedback and comments.

Tip- you can double click on the images and it will open in a new window in a larger size.

Saturday, 25 April 2015

Querying the attribute table of a feature layer in QGIS

Overview of the task

In our earlier post we showed you how to join attribute data tables in a GIS using ArcMap 10.2.
For today’s exercise, we will be working with attribute data in QGIS and making a Selection by Attributes. Our data comprises a spatial layer of different point features digitized on a paper map of Ibadan municipality. These point features comprise of schools, churches and hospitals. A building repair survey was done in the area by the local authorities and we have section of that in a csv table – Building Repair Survey.

Task
  • Join the attribute data to the spatial layer. (In QGIS, we had to invent a runaround way by exporting the shape file out as csv, populating it in excel and returning back as a csv/shape file to QGIS).
  • Select on the map which point features where building color is blue.
Procedure
  1. Digitize the point features (places shape file) on the raster image. Right click on the layer and Save as
1
2. A Save vector dialog box will pop up. Change Format to CSV and save in your working folder under places.csv. Make sure you uncheck Add saved file to map.

2

Snippet of the Building Repair survey csv table. We are bringing in details to the places.csv file.In excel,  copy out the attribute column and rows from the building repair survey table and paste into the places.csv sheet.
3

3. When you paste the places.csv will look like this. The pasted contents are to the right beginning from column C.
4
  1. We will now return the places.csv table back to QGIS. Click on Create a layer from Delimited Text file and the dialog box will come up. Browse to where the places.csv file is and load it into QGIS.
5

5.       Put the proper coordinate reference system
5

6. You now have two identical spatial layers. Change the name of the new layer to placescsv so you don’t mix up the two. Remove the first layer –places.
7

7. To carry out the Selection by Attributes, we will need to build a query. Click on the Layer on the main menu, scroll down and select Query.
8

8. Our selection is “Building_col” = ‘blue’'. Double click on the field to be queried (Building_col), choose an operator (=) and take the value (blue) you are querying for. The message box gives the result.
9

9. Right Click on the layer- placescsv and open attribute table to view the rows selected from the Query.
10

Hope you enjoyed the post. Feel free to start practicing and send your comments.

Friday, 24 April 2015

Joining attribute data from related tables using QGIS

Our post today will show you how to join the attributes from one table to the attribute table  of a layer on a map using QGIS. To create a join of both tables, an identical field must exist between them, in other words, a relationship must exist between them.

Tables are a very important form of storage in GIS. Attribute (that is descriptive) data on a spatial object are usually kept in tabular form.
Below is our table containing data from the results of a building survey done on these points in the Ibadan municipality. the table is stored in comma seperated values .csv format.


Secondly, let us look below at a registered image of Ibadan municipality where we can clearly see our points (red dots) stored as a layer. All these other attribute data of these points on the table above will need to be joined to the shape file on the map.















Click on the link  Joining tables and follow the steps.

Hope you are practicing already. Feel free to send us your feedback.

Tuesday, 21 April 2015

Digitizing point, line and polygon features into shape files QGIS



This is a continuation of our QGIS series. We started with Georeferencing (See previous post ‘Georeferencing a raster image using QGIS’) and today we will demonstrate how to digitize a raster image to create point, line and polygon shape files.


Watch and follow the video lessons carefully and send any questions, comments or observations through our feedback page. I must chip in that it is quite tasking to show the process of digitizing offsite, but we hope it is made as simple as possible. Sorry, we couldn’t add sound as this would make the video too heavy to embed, we are working on that technicality.


Tips
  • Mouse Right Click on the Layer when you want to Open the attribute table
  • Make sure the layer you are creating and the raster image have the same spatial reference. Note how the spatial reference was changed in the video – ‘Digitizing polygon features’.
  • The ID field on the attribute table serves as index key to join database or tables.
  • Right click when u finish tracing a feature so the table to fill will pop up.
  • To delete the trace, open the attribute table, select it and use the trash bin icon to delete it.
Point features -https://drive.google.com/file/d/0B8z8JZ83pZMaTnlyT0kzTUtSOVE/view?usp=sharing
Line features https://drive.google.com/file/d/0B8z8JZ83pZMabVJLekEwQTRfR1E/view?usp=sharing
Polygon features https://drive.google.com/file/d/0B8z8JZ83pZMaT2p2OW9fQ0RBZ1U/view?usp=sharing


Hope you have started practicing yourself. remember to feel  free to comment.

Sunday, 19 April 2015

Downloading data from the handheld GPS receiver using DNRGPS software


Downloading data from the GPS after use on the field can be a very fulfilling task. After sweating it out to meticulously collect spatial and non-spatial data on the field, it is quite relaxing to be able to view, process and file away the data for future work.
Most GPS receivers today have proprietary download software, such as Basecamp for Garmin and Vantage Point for Magellan. I have used a couple of them and found that converting GPS data from the format in the GPS – (usually in the GPS Xchange Format *.Gpx) to other formats can be tasking without the right tools.
So a few years ago I discovered a powerful non-proprietary middle man known then as the DNR GARMIN. DNR GARMIN is a product of the Department of Natural Resources, Minnesota and then could only work with Garmin receivers. However with subsequent versions, of which the DNR GPS 6.0 series is the latest, it is adapted to other brands of receivers,as long as the native format of the data is stored as GPX format. DNR GPS is free and has a download size of about 40mb.
DNRGPS will do the following for us in this post-
  • Conversion of GPS data to Spreadsheet form is much easier and direct using the Text Tab delimited format *.txt;
  • Converting GPS data to projected and/or unprojected .shp shape files allowing one to create features in both ArcGIS and QGIS seamlessly.
The GPS data for the tutorial is downloaded from a Garmin Dakota 10 and are waypoints. The Garmin Dakota comes with a downloading cable with a USB port.
Click the icon below to download the tutorial and follow the process (same process can be used for routes and track features)


Saturday, 18 April 2015

Georeferencing a raster image in QGIS


Georeferencing basically implies the registration of a raster image in its proper location on the surface of the earth. Practically, its just registering to a GIS the image's geographical control points.
The link below takes you to a video presentation of how to georeference a raster image using QGIS
feel free to send your comments.

QGIS SERIES- MAKING GIS AFFORDABLE?



The QGIS (formerly known as Quantum GIS) platform is an open source GIS platform run by contributors from all over the world. Before the advent of QGIS, similar GiS software packages have been proprietary like MapInfo and Esri ArcGIS. These proprietary packages are expensive and mostly were targeted at corporate users. If the Americans and Europeans mourn about the cost of acquiring these proprietary softwares then we in Nigeria and Africa as a whole are just about at our wits end.

The long term effect of these inaccessibility to affordable GIS software packages has been a software market awash with faulty, half complete, unstable and pirated copies of ArcGIS and Mapinfo. Of course, one should forget the calm group that always managing through on trial versions.

Suffice to say QGIS on the scene  and for free naira is a cool relief. And here comes the catch, we hope to help in making it as popular and useful on the scene as ArcGIS and MapInfo has been for years.

We intend to be posting basic tips on how to use QGIS and the plugins.  QGIS statement is clear, you don’t have to pay so much to become a GIS user. We start this series with a presentation on how to georeference a raster  image with QGIS  using the 2.8 version.why georeferencing? Most times in our clime her, the first thing most people want to know is how to georeference their raster images so as digitize the features into vectors.

QGIS 2.8 is a free application downloadable from the web. Just google ‘download QGIS 2.8′ on your browser.

If you are a user of QGIS, what do you think? we welcome your feedback. Just go to our Feedback page and fill the form.