I spun my wheels on this one for a while as well. It’s frustrating that such an old and easily reproducible feature remains unfixed.
In any event, I’m using the following workaround. It requires:
- Sketchup Pro
- gdal_translate and gdalinfo command line tools
- ThomThom’s excellent Bitmap To Mash plugin.
I’m working with a 1m resolution USGS DEM file called USGS_NED_one_meter_x38y378_CA_LosAngeles_2016_IMG_2018.img, which I downloaded from TNM Download v2. Since that’s quite a mouthful, let’s just call it NortheastLA.img.
Step 1. Figure out the subset of the image you need. The full thing is roughly 10,000 x 10,000 height measurements, which would result in 2 * 10000 * 10000 = 200M polygons – far too many.
Make a png file:
gdal_translate NortheastLA.img NortheastLA.png
Open it in your favorite image viewer and figure out the region that you’re interested in. Something around 200 x 200 is reasonable. The neighborhood I’m looking at has an upper-left corner at 8500, 6200, so I’ll use “-srcwin 8500 6200 200 200” in subsequent runs of gdal_translate to limit the output to that region.
Step 2. Determine the range of elevations in that region. I couldn’t get anything other than an 8-bit png to work in Sketchup. Since that does not afford much vertical resolution (8 bits = 256 possible height values), you want to use its entire dynamic range.
Create a GeoTIFF file of the target region. The default TIFF output uses floating-point elevations, so dynamic range is not a concern. Then run gdalinfo to find the range of elevations:
gdal_translate NortheastLA.img -srcwin 8500 6200 200 200 Neighborhood.tiff
gdalinfo -stats Neighborhood.tiff
The resulting stats give STATISTICS_MAXIMUM=185.28 and STATISTICS_MINIMUM=128.87, the maximum and minimum elevations of my neighborhood in meters.
Step 3. Create the final png file.
gdal_translate NortheastLA.img -srcwin 8500 6200 200 200 \
-scale 128.87 185.28 Neighborhood.png
Step 4. Import Neighborhood.png into Sketchup. Set its size to match the data; in this case, 200 m x 200 m, or equivalently 7874.0" since I’m still using caveman units.
Step 5. Create the height map. Right click on the image, select “Mesh from Bitmap” (an option provided by ThomThom’s plugin), and set the Depth to be the height range of the file. Here, the height range is 185.28 m - 128.27 m = 2244.5".
That’s it. If anyone can figure out how to get floating-point inputs like GeoTIFF to work, that would save a step, but the above works well enough for me.