aboutsummaryrefslogtreecommitdiff
path: root/content/blog/road_network
diff options
context:
space:
mode:
authorKaran Jayachandra <mail@karanjayachandra.com>2024-06-13 15:54:24 +0200
committerKaran Jayachandra <mail@karanjayachandra.com>2024-06-13 15:54:24 +0200
commite978c5de11d644543e678e38f33671b1b9724fac (patch)
treef4d69956e654369dbeaf0c24a322f5a1613cd4e0 /content/blog/road_network
parent5ab8a6cc8e7bd839d212a234d5c49252da75eac3 (diff)
Removed the blog content
Diffstat (limited to 'content/blog/road_network')
-rw-r--r--content/blog/road_network/index.md33
-rw-r--r--content/blog/road_network/road_network.png3
2 files changed, 0 insertions, 36 deletions
diff --git a/content/blog/road_network/index.md b/content/blog/road_network/index.md
deleted file mode 100644
index fda7616..0000000
--- a/content/blog/road_network/index.md
+++ /dev/null
@@ -1,33 +0,0 @@
-+++
-title = "Road Network"
-date = 2021-10-06T09:38:45+02:00
-+++
-
-**The Gist:** I was inspired to create a poster that was based on a reddit post. I document the process here.
-
-![Road Network](road_network.png)
-
-Some time ago, I came across a [post](https://www.reddit.com/r/dataisbeautiful/comments/lnlkp5/mapping_the_main_roads_of_the_world_oc/) on the subreddt r/dataisbeautiful and liked the aesthetics of the visualization. I thought this would make for a very good poster especially if the location meant something to the owner. Therefore, I started digging into how I could make one for myself. Using data sets form governmental agencies seemed too time consuming. However while I was mindlessly searching the internet, I came across the python library called [OSMNX](https://osmnx.readthedocs.io/en/stable/) that directly accesses data from OpenStreetMap and can fetch the data without much hassle. However installing this package took me quite sometime to figure out mainly because of dependencies. I am not used to working with such libraries. Luckily this [blog](https://geoffboeing.com/2016/11/osmnx-python-street-networks/) post helped me quite a bit.
-
-```python {linenos=table}
-import osmnx as ox
-
-centerPoint = (12.964398125325351, 77.57567696953713)
-
-place = ox.graph_from_point(centerPoint, dist=20000,
- network_type='drive')
-ox.plot_graph(
- place,
- figsize=(17, 24),
- dpi=400,
- edge_linewidth=0.2,
- bgcolor='#FFFFFF',
- node_color='none',
- edge_color='#FF0000',
- save=True,
- filepath='roadNetwork.png',
- close=True,
- )
-```
-
-With this and very few lines of code, I was able to make my own road network image of my favourite city Bengaluru. The first line imports the library. Based on the *centerPoint* and the *dist* variable that decides the radius from the center, the roads that allow for driving are fetched. This is then plotted with a specification of color, quality and size. I then used Canva to add the title and frame and voila. Although the original image was of much higher quality, I compressed it before adding it to the blog so that you can have faster loading time. Please note that the code takes some time to run because of the huge amount of data it needs to fetch. I am sure there is a better way to accomplish what I wanted to do. Please do reach out to me using the links in the footer if you have any constructive criticism. Thanks!
diff --git a/content/blog/road_network/road_network.png b/content/blog/road_network/road_network.png
deleted file mode 100644
index 6f4be1f..0000000
--- a/content/blog/road_network/road_network.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8439d2cbbf36bdd944f5ab630868a3c68b1f1f705781e1e142f8a33783f68a72
-size 2385072