0

The goal is to be able to download a real-world height map, import it into Unreal as a landscape, then draw roads on that landscape based off the GeoJSON file coordinates for that road.

I use this program to select a tile, create a height map, and download the GeoJSON for that selected tile. https://terrain.justgeektechs.com/#/

Current work in progress but coordinates are not coming out correctly.

Selected tile from above application.

enter image description here

So, this tile has just one road as it's feature.

GeoJSON long/lat coordinates corresponding to road.

[
  {
    "geometry": {
      "type": "LineString",
      "coordinates": [
        [
          -80.28769165277481,
          26.931559068024825
        ],
        [
          -80.28771847486496,
          26.94196560632824
        ]
      ]
    },
    "type": "Feature",
    "properties": {
      "iso_3166_1": "US",
      "len": 4540,
      "iso_3166_2": "US-FL",
      "class": "secondary",
      "type": "secondary",
      "structure": "none",
      "oneway": "false",
      "name": "Pratt Whitney Rd",
      "name_script": "Latin",
      "shield_text_color": "black",
      "ref": "711",
      "reflen": 3,
      "shield": "default"
    },
    "id": 112027551,
    "layer": {
      "id": "road-secondary-tertiary",
      "type": "line",
      "source": "composite",
      "source-layer": "road",
      "metadata": {
        "mapbox:group": "1444855786460.0557"
      },
      "filter": [
        "all",
        [
          "match",
          [
            "get",
            "class"
          ],
          [
            "secondary",
            "tertiary"
          ],
          true,
          false
        ],
        [
          "match",
          [
            "get",
            "structure"
          ],
          [
            "none",
            "ford"
          ],
          true,
          false
        ],
        [
          "==",
          [
            "geometry-type"
          ],
          "LineString"
        ]
      ],
      "layout": {
        "line-cap": "round",
        "line-join": "round"
      },
      "paint": {
        "line-width": 8.693865073365155,
        "line-color": {
          "r": 1,
          "g": 1,
          "b": 1,
          "a": 1
        }
      }
    },
    "source": "composite",
    "sourceLayer": "road",
    "state": {}
  }

]

Sixteen-bit height map for this selected tile

enter image description here

The height map imports correctly to create a landscape in Unreal. Now my problem is getting the correct UE coordinates to create the road.

What I have so far in blueprints. I am using the new Geo Referencing System in UE 4.27 for the conversion.

https://blueprintue.com/blueprint/mdy1ytsa/

The long/lat pins are the data from the above GeoJSON coordinates

This is the resulting data after trying to convert the GeoJSON coordinates.

road-secondary-tertiary Latitude=26.93155861° Longitude=-80.28768921° Altitude=0.00m

long/lat converted to EFEC Cartesian coordinate
x = 959964.491
y = -5608767.070
z = 2871456.565

I am not sure why height is not 0 since that is a static value I am providing.

These coordinates do not match up with the height map. I am not sure what I am doing wrong.

Notes: GeoJSON coordinates are in (WGS 84) datum, with longitude and latitude units of decimal degrees.

Mapbox -- apps are visually rendered in the Web Mercator Projection (EPSG:3857)

Mapbox -- to pass data to show on these maps, either as a Marker or GeoJSON layer then that data must be passed as WGS 84 LL.

Unreal Georeferencing System doc.

https://docs.unrealengine.com/4.27/en-US/BuildingWorlds/Georeferencing/

Per doc Unreal supports this conversion as shown in link from doc to http://epsg.io/transform#s_srs=3857&t_srs=4326

1

1 Answer 1

0

I have solved this problem. The solution is a complex blueprint, here is the main part https://blueprintue.com/blueprint/5c_w2ofk/. It is implemented in this project https://github.com/delebash/UnrealMapboxBridgePlugin if you need further info just post a github issue and I will help.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Mar 4, 2023 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.