-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,259 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Overpass Queries | ||
|
||
### Populate `place.yaml` with branches | ||
|
||
You can obtain the query from the laravel.log | ||
|
||
```overpass | ||
[out:json][timeout:25]; | ||
area(3601707699)->.searchArea; | ||
nwr["amenity"="bank"]["name"~"commercial bank", i](area.searchArea); | ||
out center; | ||
``` | ||
|
||
-> pass trough xapiJson2yaml.php | ||
|
||
-> get a list of nodes for this bank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
function jsonToYaml($json) | ||
{ | ||
$data = json_decode($json, true); | ||
$yaml = "osmBranches:\n"; | ||
|
||
foreach ($data['elements'] as $element) { | ||
$yaml .= " - type: {$element['type']}\n"; | ||
$yaml .= " id: {$element['id']}\n"; | ||
} | ||
|
||
return $yaml; | ||
} | ||
|
||
// Read the JSON data from the file | ||
$json_data = file_get_contents('places.json'); | ||
|
||
// Convert the JSON to YAML format | ||
$yaml_output = jsonToYaml($json_data); | ||
|
||
// Print the YAML output | ||
echo $yaml_output; |
Oops, something went wrong.