From acdc4d79e4583a84d31494a67af03ca7db893eb1 Mon Sep 17 00:00:00 2001 From: lub Date: Fri, 12 Jan 2024 23:47:34 +0100 Subject: [PATCH] init --- README.md | 1 + asef.ps1 | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 README.md create mode 100644 asef.ps1 diff --git a/README.md b/README.md new file mode 100644 index 0000000..5612372 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Takes a list of addresses, looks them up via Nominatim and creates a umap file for usage with https://umap.openstreetmap.fr/en/ diff --git a/asef.ps1 b/asef.ps1 new file mode 100644 index 0000000..4a36055 --- /dev/null +++ b/asef.ps1 @@ -0,0 +1,9 @@ +$a = Get-Content ./input | Sort-Object {Get-Random} | ForEach-Object -ThrottleLimit 3 -Parallel { + (Invoke-RestMethod ('https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&q='+$_))[0] +} +$b = $a | ForEach-Object { + ,@([Decimal]$_.lon,[Decimal]$_.lat) +} +$o = [pscustomobject]@{type = 'FeatureCollection'; features = @([pscustomobject]@{type = 'Feature'; properties = [pscustomobject]@{}; geometry = [pscustomobject]@{type = 'Polygon'; coordinates = ,$b}})} + +$o | ConvertTo-Json -Depth 99 | Out-File output.geojson