|
|
@ -2,17 +2,24 @@ $searchResults = Get-Content ./input | Sort-Object {Get-Random} | ForEach-Object
|
|
|
|
(Invoke-RestMethod ('https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&q='+$_))[0]
|
|
|
|
(Invoke-RestMethod ('https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&q='+$_))[0]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$coordinateList = $searchResults | ForEach-Object {
|
|
|
|
$coordinateList = $searchResults
|
|
|
|
|
|
|
|
| ForEach-Object {
|
|
|
|
,@([Decimal]$_.lon,[Decimal]$_.lat)
|
|
|
|
,@([Decimal]$_.lon,[Decimal]$_.lat)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
| Sort-Object {$_[0][0]}
|
|
|
|
|
|
|
|
|
|
|
|
$output = [pscustomobject]@{
|
|
|
|
$output = [PSCustomObject]@{
|
|
|
|
type = 'FeatureCollection'
|
|
|
|
type = 'FeatureCollection'
|
|
|
|
features = @(
|
|
|
|
features = @(
|
|
|
|
[pscustomobject]@{
|
|
|
|
[PSCustomObject]@{
|
|
|
|
type = 'Feature'
|
|
|
|
type = 'Feature'
|
|
|
|
properties = [pscustomobject]@{}
|
|
|
|
properties = [PSCustomObject]@{
|
|
|
|
geometry = [pscustomobject]@{
|
|
|
|
_umap_options = [PSCustomObject]@{
|
|
|
|
|
|
|
|
color = 'LimeGreen'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
name = 'turnhalle'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
geometry = [PSCustomObject]@{
|
|
|
|
type = 'Polygon'
|
|
|
|
type = 'Polygon'
|
|
|
|
coordinates = ,$coordinateList
|
|
|
|
coordinates = ,$coordinateList
|
|
|
|
}
|
|
|
|
}
|
|
|
|