To start off with a few general comments. Being someone who almost only plots GIS/Remote sensing data, i don’t like mixing GIS and plotting at all, or any data processing and plotting for that manner. Both subjects are difficult enough as it is, i rather see good specialized libraries instead of these monolithic packages which try to solve it all.
You mention D3, which has amazing support for ‘on-the-fly’ reprojections, but i see it mostly (mis)used for static plots, meaning every client reprojects the data on its machine, instead of the designer doing it only once. Think of the waste of resources if you have a million views on your graphic. Almost all valid examples are used for ‘educating’ about the differences between projections, which is cool but a bit of a niche. In my opinion it would (currently) be a waste of effort to integrate all this fancy GIS functionality.
So in your case my advice would be, if the data you want to plot is in the “wrong” projection, reproject it before plotting. There are many ways on how to do this in Python, i prefer pyproj and/or OGR. Both of those libraries have a bit of a learning curve, so maybe you can start by looking at something else like GeoPandas. GeoPandas can easily read shapefiles or other geographic formats. It allows some Panda-style manipulation, and also reprojection for example, see:
Furthermore, it integrates nicely with Bokeh by using the “GeoJSONDataSource” as an interface. I recently posted an example of this on Stackoverflow:
The biggest question is what projection to use, i cant answer that without guessing. Maybe there are some Indiana specific ones if you want to be very precise, or otherwise some ‘default’ CONUS projection might already be sufficient.
Let me know if you can get it working. I wouldn’t mind modifying the GeoPandas example to include a reprojection and centering on Indiana if you cant get it right. It would literally be adding one line specifying the EPSG (see the GeoPandas docs linked above).
On Tuesday, November 7, 2017 at 11:05:33 PM UTC+1, Tom Gregory wrote:
I’ve been playing with choropleths in Bokeh, and have several questions.
- Consider the Texas choropleth in the Gallery 1. When switching to a different state (in my case, Indiana), the projection is badly skewed because Bokeh “helpfully” tries to auto-calculate axis ranges. (I’ve seen older posts to this list indicate there may also be (was?) a bug with non-contiguous patches, but that’s likely not the case here.) What should the proper projection/aspect ratio be, and is it built in to Bokeh?
match_aspect=True to the figure constructor, but things still look off; Indiana still looks squished compared to formal maps. I’ve gone a bit down the rabbit hole and barely scratched the surface of how complicated mapping actually is. This leads to my next question:
- Are multiple projections built in to Bokeh? If not, are there plans to add them, or is this best left to other libraries. As someone new to both GIS and Python, which ones? (Pyproj?) I’ve seen several in various stages of seemingly abandoned alpha. In an ideal world, multiple projections, such as described at d3-geo would be available. Of particular use to me as someone in the U.S. would be the Albers
- Would adding (arbitrary) projections in any way be similar to #657, “Plotting polar coordinates”? I can envision a solution with a projection function that maps values to (x,y) space.
- Not a question, but another link of interest shows what ggplot, etc., are capable of projection-wise: