GeoJSON Converter#

Overview#

The NVIDIA Omniverse™ GeoJSON Converter Extension parses geospatial data stored in GeoJSON files and visualizes them in Omniverse™.

Features#

  • Parses GeoJSON (.geojson) files and converts the data into prims on a USD stage

  • This converter supports conversion of Point, MultiPoint, LineString, MultiLineString, Polygon, and MultiPolygon GeoJSON feature geometry types.

  • UI window provides a field for the user to define a file location containing the GeoJSON file(s) and a checkbox to toggle for recursively checking for GeoJSON files from user-defined file location

Note

The tool is currently able to convert data following the WGS84 coordinate system

Parsing and Converting GeoJSON Data#

This tutorial provides the steps to generate map tiles as meshes in Omniverse USD Composer. The OGC Map Tile Loader Extension is not enabled by default in Composer and will need to be enabled for use.

  1. Open Omniverse USD Composer.

_images/open-geospatial-consortium-extension_image_extension-window.png
  1. Navigate to Window > Extensions.

_images/OGC-Ext_0_Open_Window_For_Ext.png
  1. Search for and enable the GeoJSON Converter Extension.

_images/Geojson-Ext_1_Search_for_geojson.png
  1. Navigate to Window > GeoJSON Converter (beta) to open the extension window.

_images/Geojson-Ext_2_Select_extension.png
  1. Click on the GeoJSON Converter (Beta) tab.

_images/Geojson-Ext_3_Geojson_ext_startup.png

The window is contains a collapsible window for settings for the extension. Below is a description of each field.

Fields

Description

File location(s)

(string) starting directory path containing GeoJSON file(s)

Recursively check for GeoJSON files?

(checkbox) when set to True, extension will recursively check for GeoJSON files starting at this directory; otherwise, parse GeoJSON files at this directory
  1. In the “Settings” collapsible window, for the “File location(s)” field add the absolute path for the folder you wish to parse GeoJSON data from.

_images/Geojson-Ext_4_Filled_url.png

Note

Providing a relative path will causes errors. Some paths may be invalid due to user read-write permissions and whether the folder exists.

  1. In the “Settings” collapsible window, select or deselect the “Recursively check for GeoJSON files?” checkbox in order to recursively traverse through folders starting from the defined directory or only parse the files at the defined directory.

  2. When inputs have been provided and ready, click on the Convert GeoJSON File(s) button.

Note

The conversion may take some time to load.

  1. Verify your feature(s) has/have been created in the stage by navigating to the Stage tab, clicking on the Geospatial prim, and hitting the F-key to focus on the desired feature.

_images/Geojson-Ext_5_Generated_output_hierarchy_2023-1-0.png _images/Geojson-Ext_6_Generated_output_stage.png

Note

You may not be able to see the feature, so try to zoom in and out. To help with rendering, follow the following steps.

  1. (Optional) In your viewport, select the Perspective camera and select the three-slider icon to the right of Perspective.

_images/OGC-Ext_16_perspective_camera.png
  1. (Optional) In the Properties tab, increase the far clipping range value. You can multiply the value by inserting a zero (0) before the decimal (.) point (i.e., “100000000.0” becomes “1000000000.0”).

_images/OGC-Ext_15_increase_far_clipping_range_add_0.png
  1. (Optional) If your GeoJSON file contains features with a “properties” object, then the GeoJSON Converter will convert each entry as a USD attribute for the given USD feature. Here are the currently supported GeoJSON property types:

GeoJSON Type

Matching USD type in C++ and Python

boolean

pxr::SdfValueTypeNames->Bool (save as bool)

number

pxr::SdfValueTypeNames->Double (save as C++ double, Python float)

string

pxr::SdfValueTypeNames->String (save as C++ std::string, Python str)

The namespace of each attribute begins with “omni:kit:converter:ogc” then is followed by “:property_name”. See below example of accessing attributes.

Here is an example of accessing the attributes in C++:

bool readBool;
pxr::UsdAttribute readBoolAttr = my_prim.GetAttribute( pxr::TfToken("omni:kit:converter:geojson:my_boolean_attribute") );
readBoolAttr.Get( &readBool );

double readNumber;
pxr::UsdAttribute readNumberAttr = my_prim.GetAttribute( pxr::TfToken("omni:kit:converter:ogc:my_number_attribute") );
readNumberAttr.Get( &readNumber );

std::string readString;
pxr::UsdAttribute readStringAttr = my_prim.GetAttribute( pxr::TfToken("omni:kit:converter:geojson:my_string_attribute") );
readStringAttr.Get( &readString );

You can also view how to get the value of an attribute in Python from the Omniverse documentation here: https://docs.omniverse.nvidia.com/prod_kit/prod_kit/programmer_ref/usd/properties/get-attribute-value.html

Release Notes#

0.0.8#

  • Store String/Number (as doubles)/Boolean properties and save as USD attributes

  • Precision fix to store values GeoJSON values as doubles where possible (exceptions of casting to floats for USD basis curve and mesh points)

  • Conversion of Lat/Long: changed conversion to convert from degrees-to-meters instead of default value of stage’s metersPerUnit (0.01)

  • BasisCurves now set to linear

  • Change in Stage hierarchy: Additional Xform added between GeoJSON and Features that takes the name of the folder (path /World/Geospatial/GeoJSON/<folderName>/Features/); Purpose - to group features together from this source GeoJSON and allow the user to move features to origin

  • “Features” Xform has first coordinate of the first GeoJSON geometry to allow the user to move the feature set to the origin {0,0,0} as users may notice gaps between features when placed far from origin

0.0.7#

  • Updates to packages for Kit 105, USD 22.11, Python 3.10

0.0.5#

  • Added title bar for undocked window

0.0.3#

  • Extension beta release for Create 2022.3

  • Added GeoJSON features “Point”, “MultiPoint”, “MultiLineString”

0.0.1#

  • Initial beta build

Known issues#

Rendering Issues#

  • When prims are placed far from origin, there are gaps between them. The user can select the set of prims with the “Features” Xform from where the file originated from then set the translation to {0,0,0}