Skip to content

viktor-ko/GeoJSON_Cleaner_Dashboard

Repository files navigation

Screenshot 2025-06-11 174638

GeoJSON Cleaner Dashboard

A prototype of Streamlit app for automated cleaning and geometry fixing of GeoJSON files and previewing on a leaflet map.


Features

  • 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.

Project Index

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

🚀 Installation & Running

  1. Clone the repo
    git clone https://github.com/viktor-ko/GeoJSON_Cleaner_Dashboard.git
    cd GeoJSON_Cleaner_Dashboard
  2. Create and activate a virtual environment
    python -m venv venv
    source venv/bin/activate   # On Windows: venv\Scripts\activate
  3. Install dependencies
    pip install -r requirements.txt
  4. Run the Streamlit app
    streamlit run dashboard.py
    Open http://localhost:8501 in your browser.

🐳Docker Containerization📦

To containerize the Streamlit app using Docker on a Windows machine, follow these steps:

1️⃣ Install Docker Desktop

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.


2️⃣ Create a requirements.txt file

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.0

3️⃣ Create a Dockerfile

This 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 directory
  • COPY — copy app files and requirements.txt into container. ./ refers to the current directory
  • RUN — install Python packages. --no-cache-dir ignores packages cache, which reduces Docker image size
  • EXPOSE — open port 8501 (Streamlit default)
  • CMD — run the app and print access URL

4️⃣ Create a .dockerignore file (optional)

If you're using PyCharm or other IDEs, exclude .idea or other unneeded folders:

.idea

5️⃣ Build the Docker image

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.


6️⃣ Verify the Docker image

docker images

List all Docker images on your machine. You should see geojson-dashboard in the list of images.


7️⃣ Run the Docker container

docker run -p 8501:8501 geojson-dashboard

Now open http://localhost:8501 in your browser.


8️⃣ Save the Docker image to a .tar file

docker save -o geojson-dashboard.tar geojson-dashboard

📦 Load the image on another machine

Copy the .tar file to the target machine, then run:

docker load -i geojson-dashboard.tar

And start the container:

docker run -p 8501:8501 geojson-dashboard

✅ Done

That’s it — GeoJSON Cleaner Dashboard is containerized and portable!

About

Pre-processing and visualization of GeoJSON data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors