Skip to content

Instantly share code, notes, and snippets.

@pangoSE
pangoSE / msmtprc
Last active August 29, 2015 14:16 — forked from mashdot/msmtprc
#Time-stamp: <2012-05-06 Sun 16:07 msmtprc>
# This file must have no more than user read/write permissions.
account work
host mail.work.net
user someone.something@work.net
password password
auto_from off
from someone.something@work.net
maildomain work.net
@pangoSE
pangoSE / stats.sh
Last active January 13, 2020 06:56
Quick OSM statistics with bash and jq
#Script to calculate some quick stats on OSM data
#License: GPLv3 or later.
#Author: pangoSE
#invoke like this $ stats.sh x.geojson
#download the geojson from Overpass Turbo -> export or save as from JOSM.
#example query: access!=private and (tourism=alpine_hut or tourism=wilderness_hut or (amenity=shelter and shelter_type!=public_transport)) in sweden
#you can run this query from inside JOSM - see the JOSM wiki.
shelters=$(cat $1 |grep 'shelter",' |wc -l)
lean=$(cat $1 |jq '.features[] .properties | select(.amenity == "shelter") | select(.shelter_type == "lean_to")' | jq -s 'length')
@pangoSE
pangoSE / relations.json
Created April 19, 2021 10:45
relations without current members in osm
This file has been truncated, but you can view the full file.
{
"version": 0.6,
"generator": "Overpass API 0.7.56.9 76e5016d",
"osm3s": {
"timestamp_osm_base": "2021-04-19T10:42:03Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [
{
@pangoSE
pangoSE / gist:f7ba0f1cecd2913eda4523e7d457cf9f
Created April 19, 2021 11:30
investigating relation 4344
[adiff:"2018-01-01T00:00:00Z","2020-12-31T00:00:00Z"]
[out:xml][timeout:45];
//union
(
rel(4344);
);
// print results
out meta;
@pangoSE
pangoSE / vin-april-2021.gpx
Created April 27, 2021 14:01
Vindskydd från VIN
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<gpx version="1.1" creator="Locus Map, Android"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
xmlns:gpxtrkx="http://www.garmin.com/xmlschemas/TrackStatsExtension/v1"
xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v2"
xmlns:locus="http://www.locusmap.eu">
<metadata>
@pangoSE
pangoSE / omarsapi.py
Created May 7, 2021 07:28
Omars new gisdataapi for OpenStreetMap sample python code
#!/usr/bin/python3
# source https://forum.openstreetmap.org/viewtopic.php?pid=828538#p828538
# author: Wulf4096
import requests
from dataclasses import dataclass
@dataclass
class POI:
poiName: str