GeoJSON manager for Brazilian maps metadata. This application allows manipulation of GeoJSON files and their properties, especially for maps representing Brazilian states and municipalities.
- Upload base GeoJSON files
- Add metadata from CSV files or other GeoJSON
- Edit and format metadata fields
- View metadata properties
- Download the processed GeoJSON
- Convert to MBTiles format (requires Tippecanoe)
- Python 3.9+
- Streamlit 1.44+
- Pandas 2.2+
- Numpy 2.2+
- Tippecanoe (for MBTiles conversion)
-
Clone the repository:
git clone https://github.com/OCA-UFCG/oca-metadata.git cd oca-metadata
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
streamlit run src/app.py
Or via Makefile:
make run-dev
-
Access in browser:
http://localhost:8501
-
Build the image:
docker build -t ocaufcg/oca-metadata .
Or via Makefile:
make docker-build
-
Run the container:
docker run --name oca-metadata -p 8501:8501 ocaufcg/oca-metadata
Or via Makefile:
make docker-run
-
Access in browser:
http://localhost:8501
-
File Upload:
- Upload the base GeoJSON (e.g., map of Brazilian states)
- Add metadata from CSV files or other GeoJSON
-
Manage Metadata:
- View and edit metadata properties
- Rename fields
- Format values (e.g., for percentages)
- Remove unwanted metadata
-
Download:
- Download the processed GeoJSON
- Optionally, convert to MBTiles for use in mapping applications
oca-metadata/
├── Dockerfile
├── Makefile
├── geojson2mbtiles.sh # Convert geojson to mbtiles
├── mapMetadata/ # Example data
│ ├── brazil-states-clean.geojson
│ ├── brazil-states.geojson
│ └── cities.min.json
├── requirements.txt
└── src/
├── app.py # Application entry point
├── constants.py # Constants and settings
├── data_processor.py # Data processing
├── pages/
│ ├── download_page.py
│ ├── metadata_page.py
│ └── upload_page.py
├── state.py # Application state management
└── utils.py # Utility functions
Contributions are welcome! Please open an issue to discuss important changes before creating a pull request.