New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing higher zoom levels for coastal datasets #425
Implementing higher zoom levels for coastal datasets #425
Conversation
updating master (geoff's)
Merge new master into downscaling
- deleted geojsons from previous attempts
- forgot this was important
- exactly the same as having preloading at infinity for max zoom level 8 - this helps performance at higher zoom levels on lower end machines
Downscaling
- changed layer_bath url back to the old api so old caches still work
pull eslint
updating from master
The new MBTiles files are being hosted on Dory and have been included in the install script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments hehe. Good work though.
f.write(tile[0]) | ||
with gzip.open(directory + ".pbf", 'rb') as gzipped: | ||
with open(directory, 'wb') as tileout: | ||
shutil.copyfileobj(gzipped, tileout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm reading this code correctly, we're:
- Writing out the fetched tile from sqlite as a
.pbf
- Reading it back in through gzip.
- Copying the contents of that
.pbf
into the requested tile file.
Do I have this correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what's happening. If you have a nicer way off the top of your head I'm all ears
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering can we just write directly to the tile file and skip the pbf entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like gzip doesn't like bytesio objects for some reason. I'll create an issue and we can look at this later.
- Defined as a variable - Now using MAX_ZOOM[this.props.state.projection]
Minor changes / fixes
- Made mbt_imp a bit clearer
- code more likely to run now runs first
PR review merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 Nice work 👍
What is this PR doing?
Resolves #356
Resolves #357
Resolves #358
Implementing a way to display zoom levels past level 8 (currently levels up to 13 are working with this update). Next step is to add the coastal data to dory so this feature can be used efficiently.
This also resolves #4 (finally!) by changing the source of the tiles on zoom level 8.
Why have you chosen this approach?
The original idea in #356 was to use a vector layer with a single geojson file to display bathymetry and do something similar for #358. Turns out rendering a massive geojson file is very tough on performance, even with a simplified file.
VectorTile layers are easier on the client and don't have a single 500MB file associated with it that needs to be downloaded before anything can be displayed. The mbt format (mapbox tiles) is a compressed version of a geojson, so they're smaller and require even less resources.
The mbt data is stored in SQLite files with the extension ".mbtiles", if not for this each installation of the navigator would need to downloading and extracting an archive with 4^13 sub directories (this takes far too much time).
Should reviewers focus on anything specific?
Check the sanity of the API changes, since some old code (only slightly) was changed to this working.
npm run lint
and resolved all errors.