News for hackers. Stuff that matters.

Show HN: Get any piece of Google Earth as a single normalized glTF 3D model

https://github.com/OmarShehata/google-earth-as-gltf

Google released an API in May to get fetch 3D Tiles of anywhere on Earth. Using this in standard 3D engines like Blender is tricky because (1) the tiles are in a geographic coordinate system (2) you get a lot of little tiles at varying quality levels

I wanted to simplify this so all you need to do is get an API key, select a map region and a zoom level, and get one combined glTF file that you can throw into any engine. Especially if you're just prototyping and want to see how this data looks in your engine before investing in figuring out all the nuances of the API & coordinate system.

(Note that the API prohibits offline use, as in you can't distribute a processed glTF file like this. But you can do this preprocessing in memory whenever you're fetching tiles).

( 30 comments | on HN )
Re:Show HN: Get any piece of Google Earth as a single normal... by CSMastermind on Sunday December 17, 2023 @06:47PM (#38677615)
Very cool! I'm surprised that Google doesn't offer this functionality. If you keep this project going you could make something extraordinary in this space.
Re:Show HN: Get any piece of Google Earth as a single normal... by crazygringo on Sunday December 17, 2023 @07:15PM (#38677794)
They license most of their data and surely those license terms would be far more expensive if they allowed for this kind of export and offline use. Or they just couldn't license it at all.
Re:Show HN: Get any piece of Google Earth as a single normal... by ivanjermakov on Sunday December 17, 2023 @09:28PM (#38678614)
Does this imply that I cannot make commercial product using this models?
Re:Show HN: Get any piece of Google Earth as a single normal... by exikyut on Sunday December 17, 2023 @11:42PM (#38679314)
Their lawyers have an infinite supply of dark glasses and sandwiches for the ensuing mexican standoff, compared to you... :/
Re:Show HN: Get any piece of Google Earth as a single normal... by knodi123 on Sunday December 17, 2023 @06:57PM (#38677683)
Looks like there's a blender plugin that lets you import glTF and output something a 3d printer would accept.

Would be cool to have a framed wall hanging of a bas relief portrait of your hometown. Maybe then print a satellite image onto a hydrographic film and apply it? (or just paint it to match?)

Re:Show HN: Get any piece of Google Earth as a single normal... by dylan604 on Sunday December 17, 2023 @11:49PM (#38679350)
my home town was just a bunch fields upon fields full of cows. i could probably just buy the toys from amazon and glue them to a piece of fake grass. would probably look 10x better than some 3D printer output.

not sure that's the image you had in mind.

Re:Show HN: Get any piece of Google Earth as a single normal... by knodi123 on Monday December 18, 2023 @03:28PM (#38687737)
haha, mileage may vary based on which miles you're talking about! but my town's topography is distinctive enough that I'd recognize it. and if you paint satellite imagery onto it, even more so.
Re:Show HN: Get any piece of Google Earth as a single normal... by MilStdJunkie on Monday December 18, 2023 @02:00AM (#38679924)
Yeah, BlenderGIS. It's the shiznit. I use that thing for basically all my terrain now; there's no tergen as good as ol' Planet Earth..

If you're doing visualizations or interactive stuff, it's also FAR better than just importing DEMs and displacing a subsurf plane, for the precisely same reason you can't have a perfectly accurate map on a 2d plane. The BlenderGIS stuff, meanwhile, will always be correcting for those sphere hijinks, so when fresh data comes in it isn't progressively more and more off. Which is precisely what happened to me when I tried to re-create FDR (flight data) on terrain generated from DEMs. The track kept deviating more . . and more . . and more . . even though the latlons were correct. BlenderGIS set me straight, and looked better.

Dang, I'd give my left nipple to do this stuff professionally full time, but whatcha gonna do.

Re:Show HN: Get any piece of Google Earth as a single normal... by savef on Sunday December 17, 2023 @07:31PM (#38677909)
A couple of years ago Troy Hunt printed a map of where he lives in Gold Coast[0], using a separate piece of plastic underneath to show off the canal running by his house. I spent a while trying to replicate this and eventually gave up as I was missing way too many skills (as well as a printer). I might have another bash at it using this project - thanks!

As an aside, has anybody in the UK used a 3D printing service that they would recommend?

0: https://twitter.com/troyhunt/status/1460146136514134021

Re:Show HN: Get any piece of Google Earth as a single normal... by ayashko on Sunday December 17, 2023 @08:59PM (#38678464)
https://www.3dprint-uk.co.uk Great people to deal with and prices are usually excellent, especially if you don't need fast turnaround.
Re:Show HN: Get any piece of Google Earth as a single normal... by heyoni on Sunday December 17, 2023 @11:34PM (#38679273)
If you do sort it out it needs a blog post!
Re:Show HN: Get any piece of Google Earth as a single normal... by bobsmooth on Sunday December 17, 2023 @11:53PM (#38679366)
If you want to replicate a 3D print of that scale, buying your own printer is likely more cost effective. You can get a good printer for only a few hundred dollars.
Re:Show HN: Get any piece of Google Earth as a single normal... by IshKebab on Monday December 18, 2023 @02:59AM (#38680171)
It will cost you less just to buy a 3D printer. Online 3D printing is very expensive. I would only recommend it for small parts that can't be done with FDM.
Re:Show HN: Get any piece of Google Earth as a single normal... by Eisenstein on Monday December 18, 2023 @05:31AM (#38680951)
It might be worth it to some people to avoid having to learn a new process involving bespoke software and hardware and have someone else do it with a guaranteed outcome.
Re:Show HN: Get any piece of Google Earth as a single normal... by canadiantim on Sunday December 17, 2023 @08:13PM (#38678163)
What a legend. Thank you, this is really cool and useful.
Re:Show HN: Get any piece of Google Earth as a single normal... by gia_ferrari on Sunday December 17, 2023 @08:27PM (#38678275)
Super cool that it includes high(ish)-resolution buildings! Folks interested in using this data may also be interested in OpenTopography[0], which is a repository of topographical datasets (some very high resolution) with possibly more friendly licensing terms. I used some data from them to make a physical topographic map of a mountain peak. The tooling is a little opaque from a newcomer's standpoint, so I wrote up a quick howto[1]. In short you go from GeoTIFF to an STL surface with phstl, then extrude into a volume using Meshmixer (could use something else).

0: https://opentopography.org/start 1: https://giferrari.net/blog/2023/1/2023-1-13-printing-lidar-t...

Re:Show HN: Get any piece of Google Earth as a single normal... by dr_kiszonka on Sunday December 17, 2023 @11:14PM (#38679177)
Nice write-up! I wish there was a place where I could have a piece like printed _and_ painted.
Re:Show HN: Get any piece of Google Earth as a single normal... by sorenjan on Monday December 18, 2023 @04:29AM (#38680652)
If you're willing to make the textured 3D model yourself there are services that can 3D print in color.

https://www.shapeways.com/materials

Re:Show HN: Get any piece of Google Earth as a single normal... by samstave on Wednesday December 20, 2023 @10:12PM (#38716593)
HA!

I have been following your tutorial for the past couple of days. I run into a major nightmare with GDAL not being seen in python. Its installed in pip list - I have OSgeoNW, GRASS GIS etc - and no matter what I do, I cant get GDAL to work, thus the phstl conveter for mesh cant be run and I get stuck.

I was inspired by that exact same user when that was posted to /r some time ago - and I went down this path then - and got just as frustrated.

This is a nice tool, along with its desktop friend:

https://github.com/potree/PotreeConverter

Re:Show HN: Get any piece of Google Earth as a single normal... by zone411 on Sunday December 17, 2023 @10:24PM (#38678913)
The viewer app for the Sony 3D monitor imports glTF files without any processing, and I can confirm that it displays effectively in actual 3D.
Re:Show HN: Get any piece of Google Earth as a single normal... by SamBam on Sunday December 17, 2023 @10:36PM (#38678976)
I created an API key, because I've been interested in creating a 3D map of Acadia National Park (Mt Desert Island) for a while.

On the website, I put in the coords (44.3386,-68.2733) and hit Fetch Tiles and get

    Fetching tiles at (44.3209 -68.2635, 9, sse: 7)
    Failed to fetch 3D Tiles! 

    Failed to load resource: the server responded with a status of 403 () index.f704be55.js:3623
    Error: Failed to fetch resource https://tile.googleapis.com/v1/3dti...
        at CS (index.f704be55.js:3605:16501)
        at async Tb (index.f704be55.js:3605:33883)
Re:Show HN: Get any piece of Google Earth as a single normal... by zone411 on Sunday December 17, 2023 @11:44PM (#38679324)
I'm getting

  ==== No tiles found for screen space error 8. Getting tiles 
  that are within 2x of 64 ===
  Fetching glTF 0/2
  Fetching glTF 1/2
  Normalizing & stitching together 2 glTF's
for these coordinates. Make sure you have enabled retrieving these 3D tiles in Google's console.
Re:Show HN: Get any piece of Google Earth as a single normal... by SamBam on Monday December 18, 2023 @08:41AM (#38682297)
> Make sure you have enabled retrieving these 3D tiles in Google's console.

D'oh, thank you.

Re:Show HN: Get any piece of Google Earth as a single normal... by zubairq on Monday December 18, 2023 @12:01AM (#38679400)
Very cool!
Re:Show HN: Get any piece of Google Earth as a single normal... by Eisenstein on Monday December 18, 2023 @01:25AM (#38679786)
Can someone explain the API situation? I have a dev account and I created a project, and I put a credit card in the billing info, and it gave me a maps api key which doesn't seem to work in the app (says 'failed to fetch resource).

When I go into the project it tried to get me to sign up for a monthly service which was unclear what it does and was not 'escapable' (I had to leave the page or choose a paid plan).

I really don't want to hit 'accept' on something and find out a month later I have a bill from google. Is there something simple I am missing?

Re:Show HN: Get any piece of Google Earth as a single normal... by dotancohen on Monday December 18, 2023 @04:34AM (#38680680)

  > Is there something simple I am missing?
Yes. Last year's Google Maps API. We all miss it.
Re:Show HN: Get any piece of Google Earth as a single normal... by lmpdev on Monday December 18, 2023 @02:13AM (#38679981)
Anyone aware of a search engine for DEM and LIDAR?

Australia has ELVIS which makes it fantastically easy for the whole country

Every other country seems to have a very fragmented approach to elevation data though

I’m aware of OpenTopography but they are extremely coarse compared to the precision of point cloud LIDAR

Re:Show HN: Get any piece of Google Earth as a single normal... by ddhhyy on Monday December 18, 2023 @02:51AM (#38680135)
In the U.S., a great place to start is the USGS Lidar Explorer: https://apps.nationalmap.gov/lidar-explorer/#/

This site provides access to lidar point clouds (and DEMs, etc) collected by many agencies.

Additional lidar data is often available from individual state agencies, which is sometimes not aggregated into the national-scale services. A good search term is "[state abbreviation] gis" for the state of interest.

AFAIK, OpenTopography merely aggregates the data available at the above sources and similar. Unfortunately, OpenTopography has relatively restrictive access terms (e.g., free access only for those with .edu addresses), even though the same data accessed directly from USGS or other federal agencies has no such restrictions.

Re:Show HN: Get any piece of Google Earth as a single normal... by oarfish on Monday December 18, 2023 @04:50AM (#38680754)
This would be very cool, if it worked for me. I tried this in firefox first and it downloaded something according to the log, but nothing was displayed and the downloaded gltf file was 800 bytes and seemed to contain only a "sun" object, no mesh.

In chrome instead, nothing gets downloaded at all, it hangs at

> Fetching glTF 0/10

In the console, one can find

  Uncaught (in promise) TypeError: Failed to fetch
    at ha.load (index.f704be55.js:3581:132050)
    at index.f704be55.js:3581:208771
    at new Promise (<anonymous>)
    at ev._loadLibrary (index.f704be55.js:3581:208749)
    at ev._initDecoder (index.f704be55.js:3581:209106)
    at ev.preload (index.f704be55.js:3581:208814)
    at new Hx (index.f704be55.js:3581:181131)
    at Tx.parse (index.f704be55.js:3581:165923)
    at Object.onLoad (index.f704be55.js:3581:164332)
    at index.f704be55.js:3581:133292
Re:Show HN: Get any piece of Google Earth as a single normal... by llamaInSouth on Monday December 18, 2023 @02:59PM (#38687377)
Here you can get terrain to STL: https://jthatch.com/Terrain2STL/