Overlay a figure on top of Openstreet map using Bokeh? - python

How do I overlay a figure over a map(not google maps but OpenStreet maps) using Bokeh?
Figure 1: Austin city watershed to be plotted over map
currently my code generates figure 1 which is poor and needs to be overlaid over a map to make better sense.
Pandas DataFrame which is converted into figure shown in figure 1

Convert the shapefile coordinates of lat and long to web mercator coordinates and use any available WMTS tile source to overlay the data on the map. Also provide the x and y range of the city you are interested in mercator coordinates.

Related

Replotting result of find_contours onto a different grid

I have used the skimage find_contours on some velocity data but I am struggling to work out how to replot the contour outline onto a longitude latitude grid ?
I think it is some sort of transform in coordinates but I am struggling to work out how.

Layering a heatmap onto a map from a data array

I am trying to generate a heatmap (if possible layered on top of a map of my area of interest). I have an array of data (Sea surface temperatures) for the Mediterranean Sea and I would like to generate a heatmap (red for hotter, blue for colder regions) and if possible layer this onto a map (such as google maps or similar) in order to make my data more readable. Are there any packages that can help me with this/does anyone know where I could look to find some sample scripts? Thanks for you help!
I have tried using plotly and matplotlib, however these do not give the desired heatmap (it is all one colour).

Plotting netCDF data with folium - python

I have a netCDF file which contains only x_orig and y_orig in LCC format(i.e. no latitudes, longitudes for each data value). I was able to correctly convert it to (lat, long) pair to plot them over Google Maps - where the projection I used is wgs84 (outProj = Proj(init='epsg:4326')).
Next I wrote functions to find out every lat and long for the grid. But even, that seems to a bit skewed.
The idea is:
I could produce the correct concentration plot using Basemap's contourf where the image created is in LCC projection. I save this image on my device.
And then use folium's feature of ImageOverlay; where I mention the boundaries i.e.(max_lat, max_lon, min_lat, min_lon). But the image is incorrectly aligned. Is this because folium uses epsg:3857?
How do I overcome this challenge?
(i.e. producing an interactive map which correctly displays my data in LCC projection)

Change the canvas's shape when using Lambert Conformal Projection

With the supporting of matplotlib basemap, I can draw my netCDF files in different kind of projection type.
We always see the figure is in rectangular showing like this:
But I also see some figures showing like:
For now, I have some weather simulation data and I want to represent it on the map with Lambert projection.
The temperature of on time slice shows like:
So, here is my question:
How to generate the figure which the borders of the canvas fit the lcc projection like the previous one using Basemap?

How to place country boarders as background for a plot with matplotlib?

I have some data made of coordinates and the count of each coordinate which I plot in a heatmap like this:
pyplot.subplot(211)
pyplot.scatter(longitudes, latitudes, c=counts)
pyplot.colorbar()
which is inspired by this great answer here in SO.
If you look closely you can see, that the dots shape the worldmap somehow. To underline this effect I'd like to put the real country boarders (simply drawn would be enough) as background to my plot. Is this possible with matplotlib? Maybe there is some (hidden) builtin in matplotlib?
You can likely achieve this if you have some image of the world map that you want as a background. You can read this into a numpy array and plot the image. Then you should be able to add your scatter plot overtop of the image. This matplotlib cookbook example shows how to insert images and such. There is also the matplotlib image tutorial that may be of use.
I've not used it, but you may also be interested in the basemap toolkit for matplotlib. In particular, the section on drawing a map background mentions specifically a drawcountries() method.

Categories

Resources