Minor fixes.

This commit is contained in:
Mikael Capelle 2021-10-07 14:39:06 +02:00
parent 68a82ccbc8
commit 7440596f69
2 changed files with 21 additions and 17 deletions

View File

@ -19,6 +19,7 @@ bash init.sh
If you do not plan on generating maps with coastline for mapsforge (see below), you can use the `--no-shapefile` option If you do not plan on generating maps with coastline for mapsforge (see below), you can use the `--no-shapefile` option
to avoid the download: to avoid the download:
```bash ```bash
bash init.sh --no-shapefile bash init.sh --no-shapefile
``` ```
@ -28,9 +29,10 @@ bash init.sh --no-shapefile
The two main folders are `inputs` and `outputs`: The two main folders are `inputs` and `outputs`:
- `inputs` mainly contains: - `inputs` mainly contains:
- a script `coastline-fix.sh` to merge land/sea polygon (see below) and PBF files;
- multiple polygon (`.poly`) and bounding-box (`.bbox`) files for specific regions; - a script `coastline-fix.sh` to merge land/sea polygon (see below) and PBF files;
- PBF files downloaded organized in folder `$REGION/$REGION.pbf`. - multiple polygon (`.poly`) and bounding-box (`.bbox`) files for specific regions;
- PBF files downloaded organized in folder `$REGION/$REGION.pbf`.
- `outputs` is the default folder for generated output. - `outputs` is the default folder for generated output.
@ -39,9 +41,9 @@ The two main folders are `inputs` and `outputs`:
This project can be used to generate two types of files: This project can be used to generate two types of files:
- Graph file (`.mapgr`) containing graph information (see - Graph file (`.mapgr`) containing graph information (see
[OSM2Graph](https://github.com/Holt59/OSM2Graph)); [OSM2Graph](https://github.com/Holt59/OSM2Graph));
- Mapsforge file (`.mapfg`) containing [mapsforge](https://github.com/mapsforge/mapsforge) - Mapsforge file (`.mapfg`) containing [mapsforge](https://github.com/mapsforge/mapsforge)
data to display graph in a more visual way. data to display graph in a more visual way.
The process to generate the Mapsforge file is more complex than the one to generate graph file, The process to generate the Mapsforge file is more complex than the one to generate graph file,
and it will often take much more time. Fortunately, it is often **not necessary** to generate and it will often take much more time. Fortunately, it is often **not necessary** to generate
@ -61,7 +63,7 @@ The first step is to a PBF files containining the region you want:
- Download a complete region from Geofabrik: [http://download.geofabrik.de/](http://download.geofabrik.de/) - Download a complete region from Geofabrik: [http://download.geofabrik.de/](http://download.geofabrik.de/)
- If necessary, chop a region previously downloaded: - If necessary, chop a region previously downloaded:
*Using a bounding box:* _Using a bounding box:_
```bash ```bash
bin/osmosis --rb inputs/europe/france/bretagne/bretagne.osm.pbf \ # Specify your input PBF bin/osmosis --rb inputs/europe/france/bretagne/bretagne.osm.pbf \ # Specify your input PBF
@ -69,7 +71,7 @@ bin/osmosis --rb inputs/europe/france/bretagne/bretagne.osm.pbf \ # Specify your
--write-pbf inputs/europe/france/bretagne/morbihan.pbf # Specify the output file --write-pbf inputs/europe/france/bretagne/morbihan.pbf # Specify the output file
``` ```
*Using a polygon:* _Using a polygon:_
```bash ```bash
bin/osmosis --rb inputs/europe/france/bretagne/bretagne.osm.pbf \ # Specify your input PBF bin/osmosis --rb inputs/europe/france/bretagne/bretagne.osm.pbf \ # Specify your input PBF
@ -92,8 +94,11 @@ You will need GDAL for this section, and the python bindings, you can usually in
using a package manager: using a package manager:
```bash ```bash
# pip (better with a venv!)
pip install GDAL>=3
# Debian # Debian
sudo apt install gdal python-gdal sudo apt install gdal python-gdal
# CentOS # CentOS
sudo yum install gdal gdal-python sudo yum install gdal gdal-python
@ -104,7 +109,7 @@ a script `coastline-fix.sh` is provided. Run it simply:
```bash ```bash
cd inputs cd inputs
./coastline-fix.sh inputs/europe/france/bretagne/morbihan.pbf ./coastline-fix.sh europe/france/bretagne/morbihan.pbf
``` ```
To apply the fix, you need a polygon file (`morbihan.poly` — not another name), in the To apply the fix, you need a polygon file (`morbihan.poly` — not another name), in the
@ -113,10 +118,9 @@ same directory as the PBF or in the `inputs/bbox` directory (recommended).
This script will generate multiple intermediate files, but only two are importants: This script will generate multiple intermediate files, but only two are importants:
- `inputs/europe/france/bretagne/morbihan.bbox`, actual bounding-box of the PBF file — - `inputs/europe/france/bretagne/morbihan.bbox`, actual bounding-box of the PBF file —
This will overwrite the old bounding-box if there was one. This will overwrite the old bounding-box if there was one.
- `inputs/europe/france/bretagne/morbihan_merge.pbf`, merged file that you should use as input - `inputs/europe/france/bretagne/morbihan_merge.pbf`, merged file that you should use as input
for mapsforge. for mapsforge.
#### Step 2 - Generate graph & Mapsforge files #### Step 2 - Generate graph & Mapsforge files
@ -144,8 +148,8 @@ bounding-box:
```bash ```bash
bash generate.sh inputs/europe/france/bretagne/morbihan_merge.pbf \ bash generate.sh inputs/europe/france/bretagne/morbihan_merge.pbf \
--bounding-box inputs/europe/france/bretagne/morbihan.bbox \ --bounding-box inputs/europe/france/bretagne/morbihan.bbox \
--id FR-E --name "Bretagne" \ --id FR-56 --name "Morbihan" \
--output outputs/bretagne --output outputs/morbihan
``` ```
The script will automatically find the original file (`morbihan.pbf`) and use it to generate The script will automatically find the original file (`morbihan.pbf`) and use it to generate
@ -158,8 +162,8 @@ the polygon or bounding-box used for the generation of the PBF:
bash generate.sh inputs/europe/france/bretagne/morbihan_merge.pbf \ bash generate.sh inputs/europe/france/bretagne/morbihan_merge.pbf \
--bounding-box inputs/europe/france/bretagne/morbihan.bbox \ --bounding-box inputs/europe/france/bretagne/morbihan.bbox \
--bounding-polygon inputs/europe/france/bretagne/morbihan.poly \ --bounding-polygon inputs/europe/france/bretagne/morbihan.poly \
--id FR-E --name "Bretagne" \ --id FR-56 --name "Morbihan" \
--output outputs/bretagne --output outputs/morbihan
``` ```
If both the `--bounding-box` and `--bounding-polygon` option are specified, the bounding-box If both the `--bounding-box` and `--bounding-polygon` option are specified, the bounding-box

@ -1 +1 @@
Subproject commit c0f669e55a6f2fd9412a39d8d9733f7567b54ea8 Subproject commit 9e36e4e04fb42d999a3bc3966d82d4c2666d0a5c