A prototype of Streamlit app for automated cleaning and geometry fixing of GeoJSON files and previewing on a leaflet map.
- Upload a GeoJSON file.
- Clean it by removing invalid features or properties.
- Explore logs with transparent, user-friendly error reporting.
- Preview the cleaned GeoJSON on a map.
- Download the cleaned version.
| dashboard.py | ❯ Main Streamlit app script, handles page layout, file upload, shows logs, attribute tables, map preview and download button |
| utils.py | ❯ Helper functions for fixing GeoJSON geometries, performing validation, removing duplicates and creating a folium map |
| Farm_file.geojson | ❯ Sample input GeoJSON file |
| sample_output.geojson | ❯ Sample of a cleaned GeoJSON file produced by the app |
| requirements.txt | ❯ List of all needed Python dependencies |
| Dockerfile | ❯ Instructions for building a Docker container image |
- Clone the repo
git clone https://github.com/viktor-ko/GeoJSON_Cleaner_Dashboard.git cd GeoJSON_Cleaner_Dashboard - 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 Streamlit app
Open http://localhost:8501 in your browser.
streamlit run dashboard.py
To containerize the Streamlit app using Docker on a Windows machine, follow these steps:
Download it here: https://www.docker.com/get-started
Run it after installation — you can skip the account creation if you don’t need Docker Hub.
List all required Python packages with versions. For this app:
folium==0.19.5
geopandas==1.0.1
shapely==2.0.7
streamlit==1.44.0
streamlit_folium==0.24.0This file contains instructions to build the Docker image.
Dockerfile
FROM python:3.13-slim
WORKDIR /dashboard
COPY dashboard.py utils.py requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8501
CMD ["bash", "-c", "echo 'Use this URL: http://localhost:8501' && streamlit run dashboard.py --server.port=8501 --server.address=0.0.0.0"]Explanation:
FROM— base image, use a smaller version of Python 3.13 to reduce the Docker image size.WORKDIR— container working directoryCOPY— copy app files and requirements.txt into container../refers to the current directoryRUN— install Python packages.--no-cache-dirignores packages cache, which reduces Docker image sizeEXPOSE— open port 8501 (Streamlit default)CMD— run the app and print access URL
If you're using PyCharm or other IDEs, exclude .idea or other unneeded folders:
.idea
Run in terminal where your Dockerfile is:
docker build -t geojson-dashboard .. at the end - current directory.
If it built successfully, you should see the messageFINISHEDin the terminal.
docker imagesList all Docker images on your machine. You should see geojson-dashboard in the list of images.
docker run -p 8501:8501 geojson-dashboardNow open http://localhost:8501 in your browser.
docker save -o geojson-dashboard.tar geojson-dashboardCopy the .tar file to the target machine, then run:
docker load -i geojson-dashboard.tarAnd start the container:
docker run -p 8501:8501 geojson-dashboardThat’s it — GeoJSON Cleaner Dashboard is containerized and portable!
