Geodog
pip install geodog
Geodog is a collection of Python scripts for processing, analysing, and manipulating images — particularly useful for converting visual data into geographic information system (GIS) formats. Built at Watchdog for the kind of satellite and map image work that comes up in investigative journalism.
What it does
image_to_points.py— converts an image to a CSV of geo-referenced points, one per pixel, with colour and assigned colour ID; configurable bounding box and sampling rateimage_to_polygon.py— converts an image to a GeoJSON file with a grid of polygons; uses a shapefile to define the geographic area of interest, with colour clustering for simplificationimage_to_shapefile.py— same as above with enhanced progress tracking via tqdmboxcutter.py— splits large images into smaller tiles; useful for processing or displaying very large images in chunksblueconverter.py— converts an image to a blue-white gradient using tile-based processing; adjustable contrast and scalecolor_remapper.py— remaps image colours to a set of visually distinct colours using K-means clustering; reduces unique colours to a specified maximumcolorchecker.py— identifies dominant colours in an image using K-means clustering; outputs results in RGB, HEX, and HSV formats
Requirements
Python 3.x, plus: opencv-python, numpy, pillow, geopandas, shapely, rasterio, scikit-learn, tqdm
License
MIT.