Line-of-sight Analysis from Shapefile Building Data

« Go Back

Information

 
QuestionHow do I use buildings (shapefile data) to constrain line-of-sight calculations in STK?
Answer
You can use shapefile data to visualize buildings in STK and for analysis using the Urban Propagation extension. However, to use the buildings for simple line-of-sight calculations, you must first convert the buildings to terrain data. Luckily, there are free GIS utilities that can convert shapefile data to raster data, which STK can then read as terrain data. If you're comfortable working with Python scripts, you can use the gdal_rasterize function from GDAL's library.

For a more user-friendly experience, try the open-source QGIS project. Download and install the latest release of QGIS from their website. Then complete the following steps:
 

Add a layer

  1. Run QGIS Desktop.
  2. From the main page of the application, extend the Layer menu.
  3. Extend the Add Layer menu and select the Add Vector Layer… option.
Add Vector Layer

Browse to the shapefile

  1. In the Vector Dataset(s) field, browse to your shapefile data and select the SHP file. Leave all the options as default and click Add.
  2. After the data loads, you need to convert the vector data to raster.
  3. Extend the Raster menu.
  4. Extend the Conversion menu.
  5. Select the Rasterize (Vector to Raster)... option.
Rasterize

Select the correct attribute

  1. In the Rasterize menu under “Field to use for a burn-in value,” make sure to select the attribute in the shapefile that contains the height values for the buildings. In this example, the value is ZV2. Commonly it is the ELEVATION attribute.
  2. Then in the Rasterized field, save the file as a TIF file to a location of your choice.

Select the raster resolution

  1. When you return to the Rasterize menu, select the “Georeferenced units” option for "Output raster size units." 
  2. Assign the horizontal and vertical resolution. Higher resolution will take longer to process and result in a larger file, but will have smoother edges to the buildings. AGI recommends 1e-5 as a good starting resolution.
  3. Click Run.
Rasterize Window

Load the raster file into STK

  1. After the raster finishes, load it into STK.
  2. Open the Scenario (User-added image) Properties (User-added image).
  3. Select the Basic - Terrain page. 
  4. Clear the "Use terrain server for analysis" check box.
  5. Add a Custom Analysis Terrain Source.
Add Custom Terrain

Create a PDTT file

  1. Extend the Utilities menu.
  2. Select the Imagery and Terrain Converter option to create a PDTT for the terrain data.
TerrainConverter

Add the newly generated PDTT file to your Globe Manager for visualization. You can now visualize and analyze the buildings’ effects on line-of-sight!
AzElMask
 
TitleLine-of-sight Analysis from Shapefile Building Data
URL NameLine-of-sight-analysis-from-shapefile-building-data

Related Files

ExampleShapefileBuildings.zip