Skip to content

Instantly share code, notes, and snippets.

View devdattaT's full-sized avatar

Devdatta Tengshe devdattaT

  • Pune
View GitHub Profile
@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 October 26, 2024 19:51
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)
@devdattaT
devdattaT / nodeApp.js
Created April 23, 2018 10:29
Area Mismatch with PostGIS
var turf = require( "turf" );
let input='{"type":"Polygon","coordinates":[[[81.84447939698728,25.457757],[81.84430664903012,25.456003060556696],[81.84379504376571,25.45431652402258],[81.84296424189746,25.452762203050835],[81.84184617067527,25.45139982932473],[81.84048379694916,25.450281758102534],[81.83892947597742,25.449450956234294],[81.8372429394433,25.448939350969884],[81.835489,25.44876660301271],[81.83373506055669,25.448939350969884],[81.83204852402257,25.449450956234294],[81.83049420305083,25.450281758102534],[81.82913182932472,25.45139982932473],[81.82801375810253,25.452762203050835],[81.82718295623428,25.45431652402258],[81.82667135096987,25.456003060556696],[81.82649860301271,25.457757],[81.82667135096987,25.459510939443305],[81.82718295623428,25.46119747597742],[81.82801375810253,25.462751796949167],[81.82913182932472,25.464114170675273],[81.83049420305083,25.465232241897468],[81.83204852402257,25.466063043765708],[81.83373506055669,25.466574649030118],[81.835489,25.46674739698729],[81.8372429394