Skip to content
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

Deploy on Heroku #30

Merged
merged 11 commits into from Dec 6, 2021
Merged

Deploy on Heroku #30

merged 11 commits into from Dec 6, 2021

Conversation

banesullivan
Copy link
Owner

@banesullivan banesullivan commented Dec 6, 2021

Its live at https://localtileserver-demo.herokuapp.com

I'm using a free dyno so if this gets any traffic at all, it will probably crash

The changes in this PR make it so that any URL file can be passed as a query param at that URL for viewing. For example:

https://localtileserver-demo.herokuapp.com?filename=https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif

And another file hosted on S3: https://localtileserver-demo.herokuapp.com/?filename=s3://sentinel-cogs/sentinel-s2-l2a-cogs/2020/S2A_31QHU_20200714_0_L2A/B01.tif

@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2021

Codecov Report

Merging #30 (7d18c47) into main (fd3436d) will increase coverage by 0.64%.
The diff coverage is 82.03%.

@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   80.06%   80.70%   +0.64%     
==========================================
  Files          14       16       +2     
  Lines         647      705      +58     
==========================================
+ Hits          518      569      +51     
- Misses        129      136       +7     

@giswqs
Copy link

giswqs commented Dec 6, 2021

Wow, this is exciting! BTW, Is the sample dataset used in the demo a low-resolution image?

image

@banesullivan
Copy link
Owner Author

Yep, that sample image is super low resolution

@banesullivan
Copy link
Owner Author

banesullivan commented Dec 6, 2021

Here is a demo with the changes on this branch:

from localtileserver import get_leaflet_tile_layer
from localtileserver import RemoteTileClient
from ipyleaflet import Map

# Connect to a remote instance of localtileserver
tile_client = RemoteTileClient(
    'https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif',
    #'https://localtileserver-demo.herokuapp.com/',
)

# Create folium tile layer from that server
t = get_leaflet_tile_layer(tile_client)

m = Map(center=tile_client.center())
m.add_layer(t)
m

RemoteTileClient will use my demo production server by default but it throws a warning about the fact that this server will not be able to handle that many requests

@banesullivan
Copy link
Owner Author

Another demo:

from localtileserver import get_leaflet_tile_layer
from localtileserver import RemoteTileClient
from ipyleaflet import Map

# Connect to a remote instance of localtileserver
tile_client = RemoteTileClient(
    's3://sentinel-cogs/sentinel-s2-l2a-cogs/2020/S2A_31QHU_20200714_0_L2A/B01.tif',
)

# Create folium tile layer from that server
t = get_leaflet_tile_layer(tile_client)

m = Map(center=tile_client.center())
m.add_layer(t)
m

Screen Shot 2021-12-05 at 10 47 17 PM

@banesullivan
Copy link
Owner Author

I'm not going to document this in the README to avoid people overloading my demo server.

I will however try to add some instructions on how to deploy this to heroku on your own and perhaps make a cookiecutter to make this super easy

@banesullivan banesullivan merged commit f41ca8c into main Dec 6, 2021
@banesullivan banesullivan deleted the prod branch December 6, 2021 06:02
@banesullivan
Copy link
Owner Author

I just added a template for deploying your own here: https://github.com/banesullivan/remotetileserver

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

Successfully merging this pull request may close these issues.

None yet

3 participants