FeatureCollection. Each artifact becomes a Point feature carrying its full set of morphological attributes and cluster assignment as properties.
What gets exported
The exporter iterates over the rows of a_clustered.csv file. For each row it creates one GeoJSON Point feature whose coordinates come from centroid_x / centroid_y and whose properties include every other column in the CSV:
| Property | Source column | Type |
|---|---|---|
image_filename | detection output | string |
contour_index | detection output | integer |
area | extract_features | float |
perimeter | extract_features | float |
circularity | extract_features | float |
aspect_ratio | extract_features | float |
solidity | extract_features | float |
extent | extract_features | float |
cluster | K-Means label | integer |
centroid_x and centroid_y columns are consumed as coordinates and are not duplicated in the properties object.
GeoJSON file structure
crs name field is set to "Simple Cartesian / Pixel Space (Local Coordinates)" when no georeferencing is provided. When an ImageReference is supplied with a real CRS string, that string replaces it.
Exporting from the Python API
Useexport_clusters_to_geojson to go directly from a clustered CSV file:
export_to_geojson with a DataFrame if you have one already loaded:
Coordinate system considerations
By default, coordinates in the exported GeoJSON are pixel coordinates (origin at the top-left of the image, Y increases downward). This is fine for intra-site visualization but will not align with real-world map layers in QGIS without georeferencing.Georeferencing with ImageReference
If you have a world file or known ground control points for your image, supply an ImageReference to convert pixel coordinates to real-world ones:
ImageReference.pixel_to_geo is:
Importing into QGIS
Open the GeoJSON file
In QGIS, go to Layer → Add Layer → Add Vector Layer (or drag the
.geojson file directly into the Layers panel). QGIS auto-detects the GeoJSON format.Set the coordinate reference system
If you exported with an
ImageReference and a real CRS (e.g. EPSG:32616), QGIS should pick it up automatically. For pixel-space exports, the layer will load but will need a custom CRS or manual placement.Style by cluster
Open Layer Properties → Symbology. Set the renderer to Categorized and choose
cluster as the column. Click Classify to assign a distinct color to each cluster value. This gives you an immediate visual breakdown of artifact groupings across the excavation area.Using cluster information as attributes
Because every morphological feature is preserved as a GeoJSON property, you can use them all inside QGIS:- Graduated color by
areato visualize size distribution across the site - Label features with
clusterorcircularityusing the Label tab - Spatial joins between the artifact layer and a context polygon layer (e.g. excavation trenches)
- Heatmaps based on point density within each cluster using QGIS’s built-in heatmap renderer
