Coder Social home page Coder Social logo

njanakiev / openstreetmap-heatmap Goto Github PK

View Code? Open in Web Editor NEW
373.0 26.0 54.0 4.57 MB

Visualization of OpenStreetMap Data with Blender and Python

License: Apache License 2.0

Python 100.00%
blender python blender-scripts data-visualization dataviz openstreetmap

openstreetmap-heatmap's Introduction

Openstreetmap Heatmap

This project is a visualization of OpenStreetMap data with Blender and Python as a 3D barplot. It creates an occurence heatmap of all points that are collected within a country with a certain tag.

OpenStreetMap (OSM) has a vast geospatial data set containing various tags and attributes besides the geometry. By using the Overpass API we can query for specific tags, filter specific areas and various other kinds of queries. In this case we want to query for tags within the boundary of a country. We are using the two-letter country codes and filter for a single OSM tag across all available OSM elements. You can see the various Map Features to get a grasp of the variety.

DE_biergarten_animation

Requirements

In order to run this script you need to run

blender -b -P run_script.py

which runs the rendering in the background. You can also load run_script.py into Blender as a script and execute the program from there. You need to have the overpy package available in your Python distribution which is accessed by Blender. I described in this article how to use Anaconda in Blender, which is handy for installing and using additional python packages.

You can edit the settings within the render_osm_data.py under the # Settings part. The script can do both render frames of an animation (rotation around the barplot) or render a single frame. You can also load and save the points as a GeoJSON with the utils_osm.py script.

Gallery

All Biergarten in Germany

DE_biergarten

All Swiss Banks

CH_bank

All Pubs in Great Britain

GB_pub

openstreetmap-heatmap's People

Contributors

njanakiev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openstreetmap-heatmap's Issues

So nice!

So nice! could you write a tutorial? :)

feature request: UI

Hi there! This script is really great! i would like to ask if someone would be able to write a small UI for this addon? Thank you very much.

ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 3

here's my full issue:

D:\Github\openstreetmap-heatmap>blender -b -P run_script.py
Blender 2.80 (sub 75) (hash f6cb5f54494e built 2019-07-29 09:44 AM)
Read prefs: C:\Users\HP\AppData\Roaming\Blender Foundation\Blender\2.80\config\u
serpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.80\python
Info: Deleted 3 object(s)
Info: Deleted 3 object(s)
Number of points : 177
C:\Program Files\Blender Foundation\Blender\2.80\python\lib\site-packages\pyproj
\crs\crs.py:53: FutureWarning: '+init=:' syntax is deprecated.
':' is the preferred initialization method. When making the cha
nge, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/g
otchas.html#axis-order-changes-in-proj-6
return _prepare_from_string(" ".join(pjargs))
C:\Program Files\Blender Foundation\Blender\2.80\python\lib\site-packages\pyproj
\crs\crs.py:294: FutureWarning: '+init=:' syntax is deprecated.
':' is the preferred initialization method. When making the ch
ange, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/
gotchas.html#axis-order-changes-in-proj-6
projstring = _prepare_from_string(" ".join((projstring, projkwargs)))
Traceback (most recent call last):
File "", line 1, in
File "D:\Github\openstreetmap-heatmap\run_script.py", line 30, in
exec(compile(open(file).read(), scriptFile, 'exec'))
File "render_osm_data.py", line 179, in
heatmap_barplot(hist, colormap=cm.viridis)
File "render_osm_data.py", line 105, in heatmap_barplot
mat = utils.simple_material(color[:3])
File "D:\Github\openstreetmap-heatmap\utils.py", line 11, in simple_material
mat.diffuse_intensity = 0.9
AttributeError: 'Material' object has no attribute 'diffuse_intensity'

Blender quit

D:\Github\openstreetmap-heatmap>blender -b -P run_script.py
Blender 2.80 (sub 75) (hash f6cb5f54494e built 2019-07-29 09:44 AM)
Read prefs: C:\Users\HP\AppData\Roaming\Blender Foundation\Blender\2.80\config\u
serpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.80\python
Info: Deleted 3 object(s)
Info: Deleted 3 object(s)
Number of points : 177
C:\Program Files\Blender Foundation\Blender\2.80\python\lib\site-packages\pyproj
\crs\crs.py:53: FutureWarning: '+init=:' syntax is deprecated.
':' is the preferred initialization method. When making the cha
nge, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/g
otchas.html#axis-order-changes-in-proj-6
return _prepare_from_string(" ".join(pjargs))
C:\Program Files\Blender Foundation\Blender\2.80\python\lib\site-packages\pyproj
\crs\crs.py:294: FutureWarning: '+init=:' syntax is deprecated.
':' is the preferred initialization method. When making the ch
ange, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/
gotchas.html#axis-order-changes-in-proj-6
projstring = _prepare_from_string(" ".join((projstring, projkwargs)))
Traceback (most recent call last):
File "", line 1, in
File "D:\Github\openstreetmap-heatmap\run_script.py", line 30, in
exec(compile(open(file).read(), scriptFile, 'exec'))
File "render_osm_data.py", line 179, in
heatmap_barplot(hist, colormap=cm.viridis)
File "render_osm_data.py", line 105, in heatmap_barplot
mat = utils.simple_material(color[:3])
File "D:\Github\openstreetmap-heatmap\utils.py", line 12, in simple_material
mat.diffuse_color = diffuse_color
ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain
4 items, not 3

Blender quit

style of the art?

Hi,

Is that a style-of-the-art repo? Then i would really like to see how you processed dataset .

Cheers !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.