v0.2.1 QuPath extension to import very large GeoJSON files using a streaming parser, so memory usage stays bounded while features are loaded.
- Adds menu items under
Objects:Import large GeoJSON (streaming)...Clear existing objects before import(toggle)
- Supports
.geojson,.json,.geojson.gz,.json.gz - Imports features in chunks (
1000by default) - Converts supported GeoJSON geometry to QuPath ROI objects
- Creates:
- cell objects when both
geometryandnucleusGeometryare present - detection objects when
properties.objectType == "detection" - annotation objects otherwise
- cell objects when both
- Sets object name from
properties.namewhen present, otherwise fromproperties.cell_id
PolygonMultiPolygonPointMultiPointLineStringMultiLineString
- Java
21(recommended for QuPath0.6.0compatibility) - Gradle wrapper in this repo (
./gradlew)
./gradlew clean buildBuilt JAR:
build/libs/LoadBigGeoJSON-1.0.0.jar
- Build the project.
- Copy
build/libs/LoadBigGeoJSON-1.0.0.jarinto your QuPath extensions directory. - Restart QuPath.
- Open an image and go to
Objectsmenu.
- Open image in QuPath.
- Optional: enable
Clear existing objects before import. - Click
Import large GeoJSON (streaming).... - Choose your GeoJSON file.
- Check QuPath log for import summary.
Annotated script:
scripts/import_large_geojson_via_extension.groovy
This script:
- opens a file chooser safely on JavaFX thread
- calls the extension importer by reflection
- lets you control
chunkSizeandclearExisting
- Root must be a JSON object containing a
featuresarray. - Invalid/unsupported geometries are skipped.
- For polygons, rings are automatically closed if needed.
No image is open; import canceled:- Open an image first, then rerun import.
- Dependency/build issues:
- Use Java 21 and
./gradlew.
- Use Java 21 and
- Large files:
- Keep chunk size at
1000unless you have a reason to tune.
- Keep chunk size at