Skip to content

Instantly share code, notes, and snippets.

@pangoSE
pangoSE / omarsapi.py
Created May 7, 2021
Omars new gisdataapi for OpenStreetMap sample python code
View omarsapi.py
#!/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
@pangoSE
pangoSE / vin-april-2021.gpx
Created Apr 27, 2021
Vindskydd från VIN
View vin-april-2021.gpx
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">
View gist:f7ba0f1cecd2913eda4523e7d457cf9f
[adiff:"2018-01-01T00:00:00Z","2020-12-31T00:00:00Z"]
[out:xml][timeout:45];
//union
(
rel(4344);
);
// print results
out meta;
@pangoSE
pangoSE / relations.json
Created Apr 19, 2021
relations without current members in osm
View relations.json
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 / stats.sh
Last active Jan 13, 2020
Quick OSM statistics with bash and jq
View stats.sh
#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')
View 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