plGeoJSEG - an implementation of JSEG (J-measure SEGmentation) for spatial categorical data.

netzel netzel Changes in README.md 261767d @ 2025-02-05 18:32:31
data Changes in README.md 2025-02-05 18:32:31
images Changes in README.md 2025-02-05 18:27:12
Makefile Initial commit 2025-01-30 14:52:39
Makefile.win Initial commit 2025-01-30 14:52:39
README.md Changes in README.md 2025-02-05 18:29:03
gpl-3.0.txt Initial commit 2025-01-30 14:52:39
imgutil.c Initial commit 2025-01-30 14:52:39
imgutil.h Initial commit 2025-01-30 14:52:39
ioutil.c Initial commit 2025-01-30 14:52:39
ioutil.h Initial commit 2025-01-30 14:52:39
jfunc.c Initial commit 2025-01-30 14:52:39
main.c Initial commit 2025-01-30 14:52:39
mathutil.c Initial commit 2025-01-30 14:52:39
mathutil.h Initial commit 2025-01-30 14:52:39
memutil.c Initial commit 2025-01-30 14:52:39
memutil.h Initial commit 2025-01-30 14:52:39
quan.c Initial commit 2025-01-30 14:52:39
quan.h Initial commit 2025-01-30 14:52:39
reggrow.c Initial commit 2025-01-30 14:52:39
segment.c Initial commit 2025-01-30 14:52:39
segment.h Initial commit 2025-01-30 14:52:39
README.md

plGeoJSEG

plGeoJSEG is an improved implementation of the JSEG (J-image SEGmentation) algorithm for use with categorized spatial data. The program can be compiled to run on Linux and Windows. The ready-to-use executable is part of the plTools binary package (http://gitlist.netzel.pl/plTools).

The plGeoJSEG program should be run from the command line. It requires the GDAL (https://gdal.org) and ezGDAL (http://gitlist.netzel.pl/ezGDAL) libraries. The program can use more than one processor thread.

The syntax for the execution of the program is the following:

Usage:
    plgeojseg [-qh] -i <file_name> -o <file_name> [-r <n>]... [-m <n>]... [-t <n>] [--threads=<n>]

  -i, --input=<file_name> Input file name (GeoTIFF)
  -o, --output=<file_name> output file name with segment IDs (GeoTIFF)
  -r, --radius=<n> radius(es) in CELLs defining scale(s) (default 4,8,16,32)
  -m, --minsize=<n> minimum seed size(es) in CELLs (default 2*r(i)2)
  -t, --threshold=<n> region merge threshold, 0-1.0 (default 0.4)
      --threads=<n> number of threads (default 1)
  -q, --quiet run in quiet mode (default: no)
  -h, --help print help and exit

Example usage

To generate segments for the landcover data contained in the landcover.tif file, the landcover.tif file should be a properly formatted GeoTIFF file. The GeoJSEG algorithm uses multiple scales. If three scales are used, the three minimum seed sizes must also be specified. If they are not specified, the program calculates them from the formula. Both scales and areas are given as the number of raster cells.

In the case of segmenting landcover.tif using four scales 5, 10, 50, 300, using a merge threshold of 0.01 and finally saving the segmentation results in the landcover_test1.tif file, the syntax will be as follows:

plgeojseg -i landcover.tif -r 5 -r 10 -r 50 -r 300 -t 0.01 -o lancover_test1.tif

The result of segmentation using this command is shown in the map below. The segment boundaries are plotted in black over the land cover.

landcover_test1

For segmenting landcover.tif using three scales 10, 100, 500 and minimum seed sizes 74, 7123, 178094, using a merge threshold of 0.005 and finally saving the segmentation results in the landcover_test2.tif file, the syntax will be as follows:

plgeojseg -i landcover.tif -r 10 -r 100 -r 500 -m 74 -m 7123 -m 178094 -t 0.005 -o lancover_test2.tif

The result of segmentation using this command is shown in the map below. The segment boundaries are plotted in black over the land cover.

landcover_test2