https://github.com/cca-2024/osm-split-shapefile
This project was developed by Distribuidora Brasileira de Asfalto (Disbral) and is free to use, through the Automation Control Center (CCA) department, to address memory overflow issues in Docker containers when deploying PGRouter with OSM data for the entire country. The adopted approach enables incremental and partitioned loading by federative un
https://github.com/cca-2024/osm-split-shapefile
docker docker-compose osm pgrouting protobuf
Last synced: 3 months ago
JSON representation
This project was developed by Distribuidora Brasileira de Asfalto (Disbral) and is free to use, through the Automation Control Center (CCA) department, to address memory overflow issues in Docker containers when deploying PGRouter with OSM data for the entire country. The adopted approach enables incremental and partitioned loading by federative un
- Host: GitHub
- URL: https://github.com/cca-2024/osm-split-shapefile
- Owner: CCA-2024
- Created: 2025-01-08T13:21:16.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-09T20:51:58.000Z (5 months ago)
- Last Synced: 2025-01-09T21:21:33.267Z (5 months ago)
- Topics: docker, docker-compose, osm, pgrouting, protobuf
- Language: Python
- Homepage: https://www.grupodisbral.com.br/
- Size: 26.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OSM Split Shapefile
![]()
![]()
![]()
**Note:** This project was developed by Distribuidora Brasileira de Asfalto (Disbral) and is free to use, through the Automation Control Center (CCA) department, to address memory overflow issues in Docker containers when deploying PGRouter with OSM data for the entire country. The adopted approach enables incremental and partitioned loading by federative unit (UF), ensuring lower memory consumption and making it feasible to obtain a router with the complete road network of the country. [Disbral WebSite](https://www.grupodisbral.com.br/).
## 0° Step - ( Optional )
- If you want to save the `*.osm` files in a different folder than the current project, update the `PATHSAVE` environment variable in the .env file.
- Edit var in .env `TYPE_MAP_OSM` for type by use [`mapconfig.xml`, `mapconfig_for_bicycles.xml`, `mapconfig_for_cars.xml`, `mapconfig_for_pedestrian.xml`] default is `mapconfig.xml`## 1° Step
- Download your country osm grahp in [Geofabrik](https://download.geofabrik.de/)
- Save Your file downloaded *.pbf in `PROTOBUF\PROTOBUF\.pbf`## 2° Step
- Download your shapefile with state boundaries from your country's organization website in zip format, for the Brasil [here](https://www.ibge.gov.br/geociencias/organizacao-do-territorio/malhas-territoriais/15774-malhas.html).
- Check if your zip file contains files with the following extensions: `*.cpg, *.dbf, *.prj, *.shp, *.shx`
- Save Your zip file in `Modules\UFs\ZipFile\.zip`## 3° Step
- Open cmd and acess `src\`
- Run `Docker compose up --build -d`
- Finish Your have `*.pbf` files by UF's !!
**Obs:** Note that the project includes a .env file with the `SIZELIMIT` variable, which sets the maximum size allowed for processed files. The default value is set to avoid memory issues, but can be adjusted as needed. Keep in mind that a `130 MB *.pbf` file generates approximately `1.3 GB` in `*.osm` format, consuming about `8 GB of RAM` when processed in the container.
* Cropping files based on the value set in `SIZELIMIT` is not exact, but the final sizes will be close to the specified limit and will be significantly reduced.
* The system may generate cropped files with inaccurate final sizes because it assumes that the road network is homogeneous, making equal divisions. Although this does not reflect reality, the method remains functional.