Importing DEMs into SketchUp

Over morning coffee I looked into this. Understand that the DEM format is ancient so there is a lot of dust sitting in the corners of old software.

What became apparent is that the DEM importer cannot interpret the floating point values in bytes 817-952 of the file. This is a three-element array containing spatial resolution for the x, y, and z axes. The values should be 1.0 in the FORTRAN format 0.100000E+01. Here’s a patched DEM file for you that appears to import. Oh, and a Sketchup file with your data.

stanwood spacial reference patched.zip (45.7 KB)

Stanwood Complete Import SKP.zip (2.2 MB)

Thank you @sWilliams . I was able to make that change to other DEM files and it seems to work consistently.

The DEM files were created using gdal_translate. Either GDAL has the wrong format or SketchUp is expecting the wrong format. Would be great if SketchUp could understand either of the number formats, given that it’s easy to distinguish between them in the parser.

Hi, can you describe the process you followed to repair the dem file? I am facing the same issue with the tiffs I downloaded from USGS below and converted with gdal_translate. I left the CRS in UTM, but getting a file import error in Sketchup Web and Desktop (latest version as of today on Mac).

https://prd-tnm.s3.amazonaws.com/index.html?prefix=StagedProducts/Elevation/1m/Projects/CO_CameronPeakWildfire_2021_D21/TIFF/

gdalinfo:

Driver: USGSDEM/USGS Optional ASCII DEM (and CDED)
Files: 7065.dem
7065.dem.aux.xml
Size is 625, 625
Coordinate System is:
PROJCRS[“unnamed”,
BASEGEOGCRS[“NAD83”,
DATUM[“North American Datum 1983”,
ELLIPSOID[“GRS 1980”,6378137,298.257222101,
LENGTHUNIT[“metre”,1]]],
PRIMEM[“Greenwich”,0,
ANGLEUNIT[“degree”,0.0174532925199433]],
ID[“EPSG”,4269]],
CONVERSION[“UTM zone 13N”,
METHOD[“Transverse Mercator”,
ID[“EPSG”,9807]],
PARAMETER[“Latitude of natural origin”,0,
ANGLEUNIT[“degree”,0.0174532925199433],
ID[“EPSG”,8801]],
PARAMETER[“Longitude of natural origin”,-105,
ANGLEUNIT[“degree”,0.0174532925199433],
ID[“EPSG”,8802]],
PARAMETER[“Scale factor at natural origin”,0.9996,
SCALEUNIT[“unity”,1],
ID[“EPSG”,8805]],
PARAMETER[“False easting”,500000,
LENGTHUNIT[“metre”,1],
ID[“EPSG”,8806]],
PARAMETER[“False northing”,0,
LENGTHUNIT[“metre”,1],
ID[“EPSG”,8807]],
ID[“EPSG”,16013]],
CS[Cartesian,2],
AXIS[“(E)”,east,
ORDER[1],
LENGTHUNIT[“metre”,1,
ID[“EPSG”,9001]]],
AXIS[“(N)”,north,
ORDER[2],
LENGTHUNIT[“metre”,1,
ID[“EPSG”,9001]]]]
Data axis to CRS axis mapping: 1,2
Origin = (482439.000000000000000,4479723.500000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Metadata:
AREA_OR_POINT=Point
Corner Coordinates:
Upper Left ( 482439.000, 4479723.500) (105d12’25.74"W, 40d28’ 4.80"N)
Lower Left ( 482439.000, 4479098.500) (105d12’25.68"W, 40d27’44.53"N)
Upper Right ( 483064.000, 4479723.500) (105d11’59.20"W, 40d28’ 4.85"N)
Lower Right ( 483064.000, 4479098.500) (105d11’59.14"W, 40d27’44.58"N)
Center ( 482751.500, 4479411.000) (105d12’12.44"W, 40d27’54.69"N)
Band 1 Block=625x625 Type=Int16, ColorInterp=Gray
Min=1592.000 Max=1672.000
Minimum=1592.000, Maximum=1672.000, Mean=1604.676, StdDev=7.324
NoData Value=-32767
Unit Type: m
Metadata:
STATISTICS_MAXIMUM=1672
STATISTICS_MEAN=1604.6756615384
STATISTICS_MINIMUM=1592
STATISTICS_STDDEV=7.3236553468365
STATISTICS_VALID_PERCENT=99.84

I was able to import the stanwood patched file into SketchUp Web with no issues.

@dhollema

Please upload one of your DEM files ands I’ll take a look at what you have at this point.

7065.dem.zip (47.3 KB)

What I have changed, with a Hex Editor, is the floating point representation of the three numbers that are highlighted in red in the image below.

Originally they were 1.000000D+00

They are rewritten as 0.100000E+01

It’s the same value, 1.0, but in a format that Sketcxhup likes.

The repaired file:
7065 v2.zip (59.4 KB)

I took a moment, using the coordinates you posted above, and sucked the LIDAR data into a Sketchup file. You’ll find that file at the WeTransfer link below. This is at about 10% of the horizontal resolution that is available. Gimme a hollar if there is a smaller area that you’d like to see at full resolution.

Thanks! Can you explain how you did that?

Are you really using the free web version of SketchUp as indicated in your forum profile?

It wouldn’t allow you to use extensions.

Many many years ago I wrote an extension to import LAS files. If I remember correctly, it was about four hours from the time I read the file format specifications to having a functioning importer. Not too complicated.

I’m using both Sketchup Web and a trial of desktop for Mac, which just expired.

So, as I wrote, you can’t use extensions as sWilliams did for importing into the free web version. You can purchase a subsctiption for SketchUp Pro and then use extensions in the desktop version, though.

Thank you for providing the fix and the instructions. Can that specific type of fix be applied in gdal_translate, which is the original command I used to go from tif to USGS dem? Or in other common GIS packages (QGIS)?