Comments (22)
from contextily.
+1 with sinc interpolation (you could always make this a kwarg)
from contextily.
This is cool. How could we integrate it in contextily
? My sense is that this comes more at the plotting level than at the download, right? Maybe in plot_map
? Incidentally, I've just realised that we have a calculate_zoom
that @choldgraf implemented and I hadn't realised. It'd be great to get it as default for bounds2img
and bounds2raster
. But that's for a different ticket so will move that discussion over there :-)
from contextily.
sure, but i'm just the messenger. the credit goes to @ljwolf :)
so the quickest way to use it is to install from his fork until this gets merged
from contextily.
I won't speak for @darribas & am not a project maintainer, but I think that #21 may have stalled because of the auto-zoom request in #5, mentioned in #20.
Personally, I don't know if I'll have time to take a look at this until SciPy, but I'll try to un-stick #21 by then.
from contextily.
Quick update. @ljwolf and I are at SciPy and the idea is to cut a release that includes the interpolation, as well as some streamlining of the API (hopefully not back-breaking :) ). More to come soon!
from contextily.
This is now addressed in #32, so it's ready in master
, should be getting out as a new release soon. If you need it urgently, you can pip install
against master
.
from contextily.
cc @lwasser as I know she was curious about this too
from contextily.
ahhh yes @choldgraf @darribas i played around with the zoom and that didn't fix the issue which is when i create a larger figure, the map is then pixelated. Is this user error on my end?
from contextily.
Mmm... not directly, the way contextily
works, every tile has the same size (248x248 if memory serves well) and the zoom controls how many tiles are used for a given extent. I'm not sure how you'd fix that or if it relates to contextily
or the tile provider. Have you seen a different library working, for instance ggmap
in R?
from contextily.
I was looking into this a bit, and I think doing interpolation in imshow
is the best we can get to somewhat solve the pixelated view (it does not solve that you actually might want a higher resolution at a given zoom level ..).
Small example, for Berlin at zoom level 10, the original version (if you only do plt.imshow(basemap, extent=extent)
):
And with interpolation='bilinear'
:
Which gives a bit better result I think (but as I said, does not give a higher resolution image, only makes the current one a bit nicer).
I think this is also what ggmap
does, from a quick view on their source code (but no expert on that)
from contextily.
Nice - that would make sense to me as well...I was wondering how ggmap would get a smoother result from the same underlying data
from contextily.
@choldgraf see also https://github.com/darribas/contextily/issues/20, if you have an opinion on that
from contextily.
playing around with all the methods, I think sinc
interpolation gives a marginally sharper image, over bilinear
, since it appears to strongly preserve contrast better:
But, this is messing at the margins, since interpolation='none'
looks pixelated regardless of setting axes=equal
.
from contextily.
Wow!! This is visually a lot nicer with the interpolation ! Happy to see this is being revisited. I still haven't looked closely at ggmap to understand how to works. Will this be implemented in contextily? If so I'll try it again for my course! Thank you all!
from contextily.
I think this would be what we set as defaults for #20
from contextily.
hi all! i'm revisiting this again as i'm working on my class - again. just curious how or whether this might become the default behaviour for contextily plotting. For now i'm happy with using imshow to interpolate. Look at the difference!
it would be a nice default plotting behavior if not already implemented. But i do appreciate and thank you all for demonstrating how the maps can be cleaned up using the imshow args.
If this has been implemented please let me know and we can also close this issue :)
from contextily.
the interpolation is included as default in 4850849 but hasn't been merged/released
from contextily.
ok so install from github in the meantime as an alternative? Thank you @knaaptime ! This is a really nice fix.
from contextily.
got it! ok thank you @ljwolf i can also just teach them to use the interpolation arg for the time being as well. i really appreciate everyone's work on this!
from contextily.
oh wonderful. thank you for the update @darribas :) yay!
from contextily.
i know this is closed but just writing to thank you again @darribas :)
from contextily.
Related Issues (20)
- BUG: HTTPError for points close together
- CI failing HOT 3
- Force basemap to be greyscale HOT 3
- Caching and terms of service? HOT 2
- Wrong lat and lon from contextily bbox HOT 3
- No Gaode provider? HOT 2
- attributions severely wrapped upon savefig HOT 1
- Mistake in matching basemap through contextily HOT 2
- Reset_extent is not behaving as expected with local file when raster extents is smaller than the shape extents. HOT 2
- Add the ability to fetch tiles in parallel HOT 8
- Add timeout parameter to add_basemap HOT 1
- Save as editable object HOT 2
- Change the default basemap from Stamen HOT 2
- ValueError: could not broadcast input array from shape (256,256,4) into shape (512,512,4) HOT 18
- Input array error when loading contextily basemap HOT 1
- SSLError HOT 1
- speed up download for "infinite" basemap HOT 9
- How to clip background image to circle? HOT 1
- Stamen not available as a valid provider HOT 2
- `TypeError` raised in `add_basemap()` as shown in Geopandas contextily docs HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contextily.