OGR Geometry#

The OGRGeometry actor lets you import vector geometry data from OSM or any file format supported by GDAL and visualize the imported areas on your landscape.

Import Geometry#

  1. First make sure that you have a Level Coordinates actor in your level.

  2. Search for OGRGeometry in the Content Browser, and drag one into your level.

  3. In the Details Panel, select a geometry source:

    • OSM Roads, OSM Rivers, OSM Buildings, OSM Forests, OSM Beaches, OSM Parks, OSM Ski Slopes, or OSM Grass for built-in OSM data queries

    • Overpass Short Query or Overpass Query for custom Overpass API queries

    • Local File for any vector file supported by GDAL (e.g., Shapefile, GeoJSON, KML)

  4. Choose a Bounding Actor (a volume, landscape, or rectangular actor) to define the area for importing geometry, or use tile-based bounding.

  5. Press the Import Geometry button.

Preview Decal#

Once geometry is imported, you can preview it as a colored decal overlay on your landscape:

  • Enable Show Geometry Preview to display the imported geometry on the landscape

  • Adjust the Preview Material, Preview Resolution, and Preview Color to customize the look

This preview helps you verify that the geometry covers the correct area before using it for filtering.

Use with OGR Filter#

The imported geometry can be used with the OGR Filter node in PCG to filter procedural generation points based on the imported area. For example, you can spawn trees only within OSM forest areas or place foliage only in park boundaries.

See OGR Filter for details on using geometry to filter PCG points.

OGR Geometry Settings#

GDAL Importer

  • Position Based Generation (ULCPositionBasedGeneration)

  • Source (EVectorSource, default OSM Roads)

    • OSM Roads

    • OSM Rivers

    • OSM Buildings

    • OSM Forests

    • OSM Beaches

    • OSM Parks

    • OSM Ski Slopes

    • OSM Grass

    • Overpass Short Query

    • Overpass Query

    • Local File

  • Overpass Server (FString): Choose an Overpass API server from https://wiki.openstreetmap.org/wiki/Overpass_API#Public_Overpass_API_instances (while respecting their limitations)

  • Local File (FString)

  • Overpass Query (FString)

  • Overpass Short Query (FString)

  • Overpass Short Query Preset (FString)

  • Spawned Actors Path (FName): Folder used to spawn the actors. This setting is unused when generating from a combination.

  • Area Tag (FName): Tag to apply to the current actor when importing the area.

  • Clear Geometry Before Importing (bool, default true)

  • Bounding Method (EBoundingMethod, default Bounding Actor)

    • Bounding Actor

    • Tile Numbers

  • Bounding Actor Selection (FActorSelection): Use a volume, a landscape, or another rectangular actor to specify the area on which you want to import vector data.

  • Bounding Zone Zoom (int, default 14)

  • Bounding Zone Min X (int, default 0)

  • Bounding Zone Max X (int, default 0)

  • Bounding Zone Min Y (int, default 0)

  • Bounding Zone Max Y (int, default 0)

  • Flush PCG Cache After Import (bool, default false): If true, flushes the global PCG cache once after a successful import.

GDAL Importer > Preview

  • Show Geometry Preview (bool, default false): Show a colored decal overlay of Geometry on the landscape.

  • Preview Material (UMaterialInterface)

  • Preview Resolution (int32, default 256)

  • Preview Color (FLinearColor, default FLinearColor(1.0f, 1.0f, 1.0f, 0.1f))

  • Preview Decal (UDecalComponent)