Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Downloading multiple octants? #48

Open
ljarasunas2021 opened this issue Feb 20, 2020 · 8 comments
Open

Downloading multiple octants? #48

ljarasunas2021 opened this issue Feb 20, 2020 · 8 comments

Comments

@ljarasunas2021
Copy link

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
Copy link

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
Copy link
Author

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

@disembarkedone
Copy link

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

@ljarasunas2021
Copy link
Author

Perfect thank you!

@ljarasunas2021
Copy link
Author

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
Copy link

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

@kwea123
Copy link

kwea123 commented May 31, 2020

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
Copy link
Contributor

I fixed that folder length issue with the following commit: campmdabt@f98bbef

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants