Skip to content

Editing Sector Files for VAT Spy

Nelis-V edited this page Oct 21, 2021 · 9 revisions

Overview

  • Use vatspy-geojson to create GeoJSON files of the VATSIM FIRBoundaries.
  • Load, view and edit the polygons in QGIS
  • Save for use in VAT-Spy

Prerequisites

Set-up QGIS

Install the application and open QGIS Desktop (Non-GRASS version).

  1. First make sure the right tools are enabled: right click anywhere in the toolbar and activate the Digitizing, Advanced Digitizing and Snapping toolbars.

  1. Click on the Projection Properties button in the bottom right .
  2. Select the EPSG:4326 Projection.
  3. Extract the Natural Earth background map and drag the .tif file in the QGIS window. A geo-referenced map is displayed.

Parse the FIR Boundaries

To load the FIR Boundaries file in QGIS, it first needs to be converted to a supported format. In this case GeoJSON.

  1. Extract the two remaining archives.
  2. Open the VAT-Spy GeoJSON folder and run the executable.
  3. On the first tab, load your fork's firboundaries.dat and select a save location.

  1. Click the parse button
  2. Drag the created .geojson file in the QGIS window.

Convert to ESRI Shapefile

To make sure the geometry is displayed correctly on all zoom levels and simplify editing, save it as an ESRI Shapefile.

  1. Right Click on the layer.
  2. Click Export -> Save Feature As.
  3. Set the Format to ESRI Shapefile.
  4. Click the browse button and set a file name.

  1. Click OK: A third layer (Shapefile) is added to your workspace. This is the file you will use to do edits in.
  2. Right Click -> Remove the older layer used to create the Shapefile with to avoid confusion.

Displaying the Shapefile

  1. Double click on the layer and navigate to the Symbology tab.
  2. Click on Simple Fill and set the Fill color's opacity to 20%.
  3. In the top right, click the Add Symbol Layer button.
  4. Set this new layers type to Outline: Marker Line with Markers on every vertex.

  1. Click Apply.

Add Labels

  1. Click the Labels tab and select Single Labels.
  2. In the Value field select the ICAO property.
  3. In the Placement: Data Defined menu, set the X coordinate to CenterLon and the Y coordinate to CenterLat. This ensures it's using the label positions stored in the data.

  1. Click Apply.
  2. Save your QGIS Project.

Editing Sectors

  1. Select the shapefile layer and turn on editing .
  2. Enable the Vertex Tool .
  3. Enable Vertex Snapping .
  4. By pointing, dragging and clicking, edit the polygons to your liking. New polygons can also be created using the Add Polygon Feature button .

Updating Feature Properties

  1. After updating the geometry, some of it's properties still need to be updated. Right click on the layer to open its attribute table.
  2. To narrow down the list, only display edited and new features.

  1. Using the expression field and update selected button; update the following fields for the polygons you've made significant changes to:
Field Expression
Min_lat round(y_min($geometry),6)
Min_lon round(x_min($geometry),6)
Max_lat round(y_max($geometry),6)
Max_lon round(x_max($geometry),6)
CenterLat round(y(centroid($geometry)),6) A custom coordinate can also be used
CenterLon round(x(centroid($geometry)),6) A custom coordinate can also be used

  1. When you're done, click the save button , and close the attribute table.

Exporting as GeoJSON

  1. Right click the shapefile layer.
  2. Click Export -> Save Features As.
  3. Save the layer as GeoJSON, make sure to use a name that indicates this file contains your edits.

Converting back to FIRBoundaries.dat

  1. Reopen the VAT-Spy GeoJSON executable.
  2. On the second tab, load the GeoJSON you just saved.
  3. Select a save location for the FIRBoundaries.dat file.

  1. Click Parse

Wrap-up

Use the changed sectors from your new FIRBoundaries.dat file and replace them in the version downloaded from the github and push them.

Tips

  • Use the snapping tool to make sure all polygons align.
  • The topology checker in the vector menu can be used to check for gaps.
  • Filter layers using rule based layers in the symbology menu if you're encountering issues with layered geometry.