isosweep Evaluate
What you get
  • Finished curves, not segments. Ordered polylines, closed where the field closes them. Each closed curve carries a hill/hole class computed from the field itself, and rings can come with their nesting tree: ready for filling, labelling, hit-testing and export.
  • Filled contours. Bands between consecutive levels and the regions above each level, as polygons with holes. Every polygon is OGC-valid, also where a band meets the grid edge or a NoData void.
  • All levels in one pass. The sweep discovers every level's contours in a single traversal, and its cost follows the contour length it emits. Fine contour intervals stay cheap.
  • Three ways in. A C library and header with no third-party dependencies, a numpy-native Python package, and the isosweep-contour command-line tool (GeoTIFF or any GDAL raster in, GeoPackage or GeoJSON out). Rasters larger than RAM are streamed.
  • Production details handled. NoData and NaN voids, georeferencing (rectilinear axes, affine and rotated geotransforms, curvilinear grids), float32 or float64 output coordinates, multi-threading with the same geometry for any thread count, and your own allocator and thread pool if you need them.
Benchmarked per use case

Each use case has its own head-to-head on representative data; all results and the methodology are on one page.

Minimal API
import isocurves                      # Python: numpy in, numpy out

res = isocurves.contour(z, levels=range(400, 4500, 20))
for c in res:
    c.x, c.y            # ordered float32 vertices
    c.level_value       # the contour value
    c.is_closed         # closed ring vs. leaves the grid / NoData
    c.is_hill           # higher values inside?

bands = isocurves.filled(z, levels=range(400, 4500, 100))   # filled contours
geojson = bands.to_geojson()

The same engine is available as a C library (isosweep.h) and as a command-line tool. Documentation →

Questions

How can I compute contour lines from a large 2D grid quickly?

Use an engine that finds all levels in one pass. In head-to-head tests on identical data, isosweep extracted contour lines 3.8–12× faster than the fastest single-threaded open-source engine (GDAL, VTK Flying Edges, ContourPy, scikit-image); for example, a real 30 m DEM contoured every 20 m took 727 ms on one core, against 3.79 s for GDAL.

Does isosweep return closed, ordered contours?

Yes. Curves are ordered polylines, closed where the field closes them, and every closed curve is classified from the field as enclosing higher (hill) or lower (hole) values, with an optional nesting tree. No stitching or ring-assembly post-process is needed.

Can isosweep produce filled contours (polygons between levels)?

Yes. It returns filled contour bands between consecutive levels, including below the first and above the last level, and the regions above each level, as polygons with holes. Every polygon is OGC-valid: exteriors counter-clockwise, holes clockwise. Available in C (ISOSWEEP_BANDS), Python (isocurves.filled) and the command-line tool (-p, like gdal_contour -p).

Is isosweep open source?

No. isosweep is commercial, closed-source software from Parmond AB, delivered as binaries: a C library and header, a Python package and the isosweep-contour command-line tool. A 30-day evaluation under NDA is available.

Which platforms does isosweep support?

Linux (x86-64 and ARM64) and macOS. The library is written in C11 with no third-party dependencies; other platforms are available on request.