retroplasma / earth-reverse-engineering

Reversing Google's 3D satellite mode
2.23k stars 213 forks source link

Downloading multiple octants? #48

Open ljarasunas2021 opened 4 years ago

ljarasunas2021 commented 4 years ago

Hello,

First off I will say that this is a great plugin - definitely the best I have found online. I was wondering if it is possible to download more than one octant at a time? Is this related to LexSong's script? If so I received this error when running it -

File "find_overlaps.py", line 10 URL_PREFIX = f"https://kh.google.com/rt/{PLANET}/" ^ SyntaxError: invalid syntax

If that is not the case - don't worry about the error. All that I'm trying to do is to download multiple octants at the same time. Thank you in advance!!!

-Lukas

disembarkedone commented 4 years ago

downloading multiple octants works using the dump_obj script

you can do

node dump_obj.js 3060417360436156121 3060417360436156123 3060417360436156130 3060417360436156131 3060417360436156301 3060417360436156311 20

for example

in regards to your error in the .py script you might be using an unsupported version? just a guess

ljarasunas2021 commented 4 years ago

Ah thank you! Do you mean an unsupported version of python or of this github repo? Thank you so much!

disembarkedone commented 4 years ago

You might have Python2 which may not work. Try installing Python3

ljarasunas2021 commented 4 years ago

Perfect thank you!

ljarasunas2021 commented 4 years ago

Ok so I downloaded Python3 but obtained this error:

LatLonBox(north=37.420626, south=37.419714, west=-122.085045, east=-122.083275) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1319, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1230, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1276, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1225, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1004, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 944, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1399, in connect self.sock = self._context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "find_overlaps.py", line 92, in planetoid_metadata = read_planetoid_metadata() File "find_overlaps.py", line 26, in read_planetoid_metadata return read_protobuf(url) File "find_overlaps.py", line 20, in read_protobuf data.ParseFromString(urlread(url)) File "find_overlaps.py", line 14, in urlread with urlopen(url) as f: File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1362, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1322, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>

Any ideas on what went wrong?

disembarkedone commented 4 years ago

think you need to run Install Certificates.command. do a search for certifi

kwea123 commented 4 years ago

There is still one problem, if we download too many octants once, currently the folder name is the concatenation of all octants, which could exceed the max possible filename length and result in an error. There is need to modify line 28 of dump_obj.js to avoid this.

campmdabt commented 4 years ago

I fixed that folder length issue with the following commit: https://github.com/campmdabt/earth-reverse-engineering/commit/f98bbef183249a872e0d9b32585358d1b76d949b

It limits the number of octants used in the name to 4.