Skip to content

Instantly share code, notes, and snippets.

View devdattaT's full-sized avatar

Devdatta Tengshe devdattaT

  • Pune
View GitHub Profile
@devdattaT
devdattaT / gist:1856ba4a49e1ba5f3f00e7fdd37064f6
Last active January 13, 2025 04:12 — forked from bharathkumar-gopalan/gist:494c7aa1126ef1ac131a2ca328f3d5a1
How to Create a Tileset with correct India Boundaries. Shared on the OSM India Telegram group on 2025-01-13

Disclaimer :

This gist is provided solely for educational and informational purposes. The content shared here is intended to demonstrate technical concepts and does not imply any legally binding commitments or opinions of the author.

Users are responsible for ensuring compliance with applicable laws, regulations, and standards in their respective jurisdictions. This material is shared in good faith for learning purposes only, and any misuse or misrepresentation of this information is strictly discouraged.

Stage 1 (extract the boundaries)

Step 1: Get the geojson file To begin with we need a Geojson representing the boundaries - For this example I am using the one present at https://github.com/datameet/maps/blob/b3fbbde595310b397a55d718e0958ce249a4fa1f/Country/india-soi.geojson- Download this file (Note : This file may possibly not be accurate - Please do thorough research before putting this in prod) - Replace the propertie

@devdattaT
devdattaT / kaveri.geojson
Created August 23, 2022 04:00
Polygon boundary of Kaveri Basin
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@devdattaT
devdattaT / merge.py
Created October 21, 2021 10:21
Merging OSM files
import os
#get List of files
def getFiles(fldr):
files = os.listdir(fldr)
return [os.path.join(fldr, f) for f in files]
def getFileContents(file):
lines = []
with open(file, 'r') as inpFile:
@devdattaT
devdattaT / vaccination.csv
Created April 28, 2021 04:19
vaccination Centers
We can't make this file beautiful and searchable because it's too large.
nin_pmjay,type,address,latitude,longitude,contact,mobile,categoryno,name,pincode,district,state,categoryname,block,city
HOSP24P04978,Paid,"Zanzada Chokdi, Junagadh","21.520954599675065","70.45339999991012",Dr Nirav Satasiya,"7622868893","2",satasia surgical hospital,"362001",JUNAGADH,GUJARAT,Private PMJAY,,
,,PHC CHEETHWARI,"27.14396860027074","75.80109620042936",,,"3",PHC CHEETHWARI,"303806",JAIPUR,RAJASTHAN,Health Facilities All States,Govindgarh,
,,Dabaycha PHC,"23.89449530011808","73.43864659956097",,,"3",Dabaycha PHC,"313804",UDAIPUR,RAJASTHAN,Health Facilities All States,Kherwara,
,,B K SARERI,"25.620528900088743","74.4438872996592",,,"3",B K Sareri PHC,"311026",BHILWARA,RAJASTHAN,Health Facilities All States,Asind,
,,CHC NOKHRA HCW,"25.478365300418318","71.61838520031682",,,"3",CHC NOKHRA,"344702",BARMER,RAJASTHAN,Health Facilities All States,Sindhari,
,,BUHANA,"28.205316599881257","75.87573540036851",,,"3",CHC BUHANA 2,"333502",JHUNJHUNUN,RAJASTHAN,Health Facilities All States,Buhana,
We can't make this file beautiful and searchable because it's too large.
Longitude,Latitude,objectid,dm_name,strucode,nrld_no,dm_lat,dm_long,dm_ncity,dtcode,stcode,rivcode,bacode,dm_type,dm_cmp_yr,dm_length,dm_height,dm_flod_des,dm_spil_type,dm_spil_leng,dm_spil_lev,dm_spil_cap,dm_gate_type,dm_gate_no,dm_gate_sz,dam_vol,dm_coment,uname,dm_cmn_yr,dm_name_al,dm_status,dm_ses_zone,dm_no_river_sluice,dm_sluice_purpose,dm_sluice_sz,dm_mod_oper,dm_inst_inter_ager,dm_inst_inter,dm_perliament,dm_ener_dissp,dm_instru_embed,class,dm_oper_main_age,dm_gt_ungtd,dm_lat_1,dm_long_1,created_user,created_date,last_edited_user,last_edited_date,ltype
86.2955202501893,25.0331853491585,"1",Ajan Dam,D00105,BR02HH0020,25.033076,86.295052,Jamui,Jamui,BR,Ajan,2A,TE,"1989","518.3","39.02",,CH,"76.25","123.32","878.5",UG,,,,,Vineeta,,"Anjan, Azan",Completed,Seismic Zone-IV,,,,,,,Jamui,,,Class 2,"Water Resources Department, Govt.of Bihar",UG,25.03318596,86.29551697,,,,,dam
@devdattaT
devdattaT / LocationHistory.md
Last active April 13, 2025 12:58
How to Visualize your Google Location History

Google is extremely transparent about the Location History it has on you. You can check it out on the timeline feature in the Google Maps application on the phone, or on https://www.google.com/maps/timeline It is possible that you have that turned off, and in that case, consider yourself lucky.

If there is data there, you can view it online, or Download and Analyze it yourself.

Note: The conversion script has been updated on 2024-06-24, to match the updated format which is now generated by Google Takeout

import json
import csv
import sys
from datetime import datetime
import os
def has_keys(dictionary, keys):
return all(key in dictionary for key in keys)
def make_reader(in_json):
@devdattaT
devdattaT / HawkerCenters.csv
Created January 22, 2019 12:48
Location information for Hawker Centres
Name Latitude Longitude
Maxwell Food Center 1.2804887 103.8446716
Chomp Chomp Food Centre 1.3641944 103.8663601
Lau Pa Sat 1.2806279 103.8502290
Tiong Bahru Market 1.2847589 103.8326789
@devdattaT
devdattaT / MRT.qml
Created January 22, 2019 12:38
Style for MRT subway routes
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis simplifyMaxScale="1" labelsEnabled="0" hasScaleBasedVisibilityFlag="0" simplifyAlgorithm="0" readOnly="0" simplifyDrawingTol="1" simplifyLocal="1" minScale="1e+8" simplifyDrawingHints="1" version="3.2.0-Bonn" maxScale="0">
<renderer-v2 symbollevels="0" enableorderby="0" attr="name" forceraster="0" type="categorizedSymbol">
<categories>
<category symbol="0" render="true" label="Circle Line" value="Circle Line"/>
<category symbol="1" render="true" label="Circle Line Extension" value="Circle Line Extension"/>
<category symbol="2" render="true" label="Circle Line MRT" value="Circle Line MRT"/>
<category symbol="3" render="true" label="Downtown Line" value="Downtown Line"/>
<category symbol="4" render="true" label="Downtown Line MRT" value="Downtown Line MRT"/>
<category symbol="5" render="true" label="MRT East West Line (EW)" value="MRT East West Line (EW)"/>
@devdattaT
devdattaT / Upgrading Postgresql Client to 10.x on Ubuntu
Last active June 5, 2018 07:31
Upgrading Postgresql Client to 10.x on Ubuntu
Upgrading Postgresql Client to 10.x on Ubuntu
==
We need to first check which Postgresql components are currently installed. This can be done by running a command like:
`dpkg -l | grep postgres`
This returned:
`
ii postgresql-client 9.5+173ubuntu0.1 all front-end programs for PostgreSQL (supported version)