[Feature] Find octants by bounding box
LexSong opened this issue · 11 comments
I add a python script to find overlapping octants by bounding box, instead of a single point:
https://github.com/LexSong/earth-reverse-engineering-utils
The script will stop early if it finds too many octants at the same level, so it can be used to dump large areas. I don't know javascript well enough to add the function to the main repo.
Hopefully, people will find this useful.
Example output:
> python find_overlaps.py 37.419714, -122.083275 37.420626, -122.085045
LatLonBox(north=37.420626, south=37.419714, west=-122.085045, east=-122.083275)
[Octant level 1]
2
[Octant level 2]
20
[Octant level 3]
205
[Octant level 4]
2052
[Octant level 5]
20527
[Octant level 6]
205270
[Octant level 7]
2052706
[Octant level 8]
20527061
[Octant level 9]
205270616
[Octant level 10]
2052706160
[Octant level 11]
20527061605
[Octant level 12]
205270616052
[Octant level 13]
2052706160527
[Octant level 14]
20527061605273
[Octant level 15]
205270616052735
[Octant level 16]
2052706160527351
[Octant level 17]
20527061605273514
[Octant level 18]
205270616052735141
205270616052735140
[Octant level 19]
2052706160527351416
2052706160527351417
2052706160527351415
2052706160527351414
2052706160527351405
2052706160527351407
2052706160527351406
2052706160527351404
[Octant level 20]
20527061605273514162
20527061605273514160
....
Very nice! I would link to it in the README if you don't mind. We could also merge it if we document the pip goog proto dependency; at this point the repo is just a collection of scripts anyway.
Maybe we could use http://www.transcrypt.org to transpile python into JavaScript to have a single dependency ?
Hi there, i've been trying to get this to work but when I run the python script I get this error: Traceback (most recent call last):
File "find_overlaps.py", line 4, in
from proto.BulkOrPlanetoid_pb2 import BulkOrPlanetoid
File "C:\Users\snah\Documents\earth-reverse-engineering-master\proto\BulkOrPlanetoid_pb2.py", line 6, in
from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google'
any idea what might be going wrong? Thank you!
from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google'any idea what might be going wrong? Thank you!
you need to install google protobuf
@LexSong What website do you recommend to get the bounding box? I tried using coords from:
http://bboxfinder.com/ and your py output is empty:
python3.6 find_overlaps.py 41.340216 2.102509 41.465113 2.270393
LatLonBox(north=41.340216, south=2.102509, west=41.465113, east=2.270393)
[Octant level 1]
[Octant level 2]
[Octant level 3]
[Octant level 4]
[Octant level 5]
[Octant level 6]
[Octant level 7]
[Octant level 8]
[Octant level 9]
[Octant level 10]
[Octant level 11]
[Octant level 12]
[Octant level 13]
[Octant level 14]
[Octant level 15]
[Octant level 16]
[Octant level 17]
[Octant level 18]
[Octant level 19]
[Octant level 20]
I also would place a python version check at the top of the script.
@psociety you've mixed the number around, lexsong's script uses north then south then west then east, not north west south east
@Rakiah oh, i tried recombining them yet i got the same result:
python3.6 find_overlaps.py 41.340216 41.465113 2.102509 2.270393
LatLonBox(north=41.340216, south=41.465113, west=2.102509, east=2.270393)
[Octant level 1]
[Octant level 2]
[Octant level 3]
[Octant level 4]
[Octant level 5]
[Octant level 6]
[Octant level 7]
[Octant level 8]
[Octant level 9]
[Octant level 10]
[Octant level 11]
[Octant level 12]
[Octant level 13]
[Octant level 14]
[Octant level 15]
[Octant level 16]
[Octant level 17]
[Octant level 18]
[Octant level 19]
[Octant level 20]
I assume that the north latitude should larger than south latitude?
Try 41.465113 41.340216 2.102509 2.270393
@LexSong you're right now it does throw octants up to level 13 :)
Sorry for littering the thread.
Hey, total beginner to this stuff. Could someone explain a few things to me?
How do I use the output of this script and enter it into earth-reverse-engineering? I have the bounding box of a building I want a model for and I'm not really sure how to use the output in earth-reverse-engineering.
Also, what do the levels mean? For example, what does specifying the max level here mean?
#Dump octant with max-level 20
node dump_obj.js 20527061605273514 20
@bhaktatejas922 Level is the zoom, go to google maps and zoom in, you will see how a z var changes in the url. It obviously has a max zoom and not all areas have the same.