Author Archive: GMD

Filter only visible legend items in QGIS

To only show legend items that appear in the map, QGIS has a filter function to easily do this.

 

Go to the filter icon above the layers panel, and check ‘Filter Legend by Map Content’

Likewise in the Map layout, the legend can be filtered by the checking the box ‘Only show items inside linked maps’

Connect to SFTP Using FME

To automate a connection to SFTP with a private key in FME, the private key cannot have a passphrase. A system caller is needed to start the Putty Pageant.exe file and specify the private key.

System caller: start “” “C:\Program Files\PuTTY\pageant.exe” E:\Private_Key.ppk 

The FTP caller parameters can be filled as shown below. In this example a test file is uploaded to a SAAS in folder.

 

URL- sftp://Domain.com:21/TESTFile.csv (remember the port number)

File – E:\data\TESTFile.csv

A second systemcaller is needed to stop the pageant process. If this isn’t included, the workbench won’t run after the initial run and a ‘log in failed’ error will appear in Flow.

System caller 2:  taskkill /IM “pageant.exe” /F (to stop the pageant process) 

Upload Shapefiles to SQL Server Spatial in QGIS

To import Shapefiles into SQL Server without the use of scripts such as Ogr2ogr, we can easily use QGIS instead. Make sure you have SQL Server and SQL Server Management studio installed.

Open QGIS and in the Browser panel add a new connection by right clicking on MSSQL.

Enter a connection name and enter the server name used in SQL Server. Click ‘List Databases’ to see the tables.

Once the SQL server connection has been established, you can drag shapefiles and other GIS formats directly into the SQL server connection.

 

Change the Levels of Features in the same Layer in QGIS

We will move a feature above/below another feature in the same layer in QGIS. In this example we want to move the green hatched polygon above the pink hatched polygon.

Open the properties for the layer and go to the Advanced drop down.

Change the level number of the features you want to move above a higher number than the features you want to move below.

In this example, Layer 0 column refers to the hatching pattern, and the Layer1 column refers to the outline of the polygon. Click apply and the features order will rearrange.

 

Draw lines specifying length and angle

This function in QGIS allows for CAD-like drafting.

Go to View menu>Panels and show “Advanced Digitizing Panel”

advanced draw

Click the “Add feature” icon and click the start point on the map.

type the “d” key on your keyboard and enter the distance. press enter. This will set the distance.

type the “a” key on your keyboard and enter the angle. press enter. This will set the angle of the line.

How to make your text labels standout on an aerial photo map

text color black

When creating a map with an aerial photo as it’s base, it is important to make the text labels stand out as plain text can get easily drowned out by the background colors.

text color Yellow

Yellow is often an appropriate color when the aerial photo is mainly made up of darker colors.

text color buffer

However yellow may not be very visible on light colors like white. A text buffer can overcome this issue. In the example above, I have used yellow text with a black buffer but black text with light buffer is just as effective.

text color curved

When labeling curvy features such as rivers and roads it is better to curve the text so that it sits neatly along the feature. This function in QGIS is found in the placement option in the layer properties as shown below.

text placement qgis

 

These are some tips to make your aerial photography maps easier to read and interpret. If you have any comments please let me know below.