├── .github ├── CONTRIBUTING.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── main.yml ├── .gitignore ├── .package ├── LICENSE ├── README.md ├── deps ├── .gitignore ├── .package ├── README.md ├── embed.sh ├── fp.c ├── fp.h ├── json.c └── json.h ├── docs ├── .gitignore ├── API.md ├── BENCHMARKS.md ├── GEOBIN.md ├── POLYGON_INDEXING.md ├── README.md ├── assets │ ├── API_foot.md │ ├── API_head.md │ ├── az-both.png │ ├── bc-both.png │ ├── br-both.png │ ├── circle-both.png │ ├── index-no-index-smaller.png │ ├── index-no-index.png │ ├── index-ri.png │ ├── logo.png │ ├── natural-animation.gif │ ├── natural-animation.html │ ├── random-both.png │ ├── random100-both.png │ ├── raycast-1.png │ ├── raycast-2.png │ ├── raycast-3.png │ ├── raycast-counting.png │ ├── raycast-inside.png │ ├── raycast-intersections.png │ ├── raycast-point.png │ ├── raycast-ray.png │ ├── raycast-us.gif │ ├── ri-both.png │ ├── rtree-us.png │ ├── simple-polygons.png │ ├── tx-both.png │ ├── ystripes-animation.gif │ └── ystripes-animation.html └── tools │ ├── README.md │ ├── build-api.sh │ └── doxygen-md │ ├── README.md │ ├── go.mod │ ├── go.sum │ └── main.go ├── examples └── intersects.c ├── tests ├── .gitignore ├── README.md ├── bench.c ├── bmalloc.c ├── bmalloc.cpp ├── genrelations.sh ├── geosbuild.sh ├── relate.c ├── relate.sh ├── relations │ ├── gcol.jsonc │ ├── line.jsonc │ ├── mline.jsonc │ ├── mpoint.jsonc │ ├── mpoly.jsonc │ ├── point.jsonc │ └── poly.jsonc ├── run.sh ├── shapes.h ├── test_geobin.c ├── test_geojson.c ├── test_geom.c ├── test_index.c ├── test_line.c ├── test_memory.c ├── test_nearest.c ├── test_parse.c ├── test_point.c ├── test_poly.c ├── test_rect.c ├── test_relations.c ├── test_ring.c ├── test_segment.c ├── test_various.c ├── test_wkb.c ├── test_wkt.c └── tests.h ├── tg.c └── tg.h /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/.github/CONTRIBUTING.md -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/.github/PULL_REQUEST_TEMPLATE.md -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/.github/workflows/main.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode 3 | a.out 4 | tg.o 5 | -------------------------------------------------------------------------------- /.package: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/.package -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/README.md -------------------------------------------------------------------------------- /deps/.gitignore: -------------------------------------------------------------------------------- 1 | tmp.* -------------------------------------------------------------------------------- /deps/.package: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/deps/.package -------------------------------------------------------------------------------- /deps/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/deps/README.md -------------------------------------------------------------------------------- /deps/embed.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/deps/embed.sh -------------------------------------------------------------------------------- /deps/fp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/deps/fp.c -------------------------------------------------------------------------------- /deps/fp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/deps/fp.h -------------------------------------------------------------------------------- /deps/json.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/deps/json.c -------------------------------------------------------------------------------- /deps/json.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/deps/json.h -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ -------------------------------------------------------------------------------- /docs/API.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/API.md -------------------------------------------------------------------------------- /docs/BENCHMARKS.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/BENCHMARKS.md -------------------------------------------------------------------------------- /docs/GEOBIN.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/GEOBIN.md -------------------------------------------------------------------------------- /docs/POLYGON_INDEXING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/POLYGON_INDEXING.md -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/README.md -------------------------------------------------------------------------------- /docs/assets/API_foot.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/API_foot.md -------------------------------------------------------------------------------- /docs/assets/API_head.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/API_head.md -------------------------------------------------------------------------------- /docs/assets/az-both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/az-both.png -------------------------------------------------------------------------------- /docs/assets/bc-both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/bc-both.png -------------------------------------------------------------------------------- /docs/assets/br-both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/br-both.png -------------------------------------------------------------------------------- /docs/assets/circle-both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/circle-both.png -------------------------------------------------------------------------------- /docs/assets/index-no-index-smaller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/index-no-index-smaller.png -------------------------------------------------------------------------------- /docs/assets/index-no-index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/index-no-index.png -------------------------------------------------------------------------------- /docs/assets/index-ri.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/index-ri.png -------------------------------------------------------------------------------- /docs/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/logo.png -------------------------------------------------------------------------------- /docs/assets/natural-animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/natural-animation.gif -------------------------------------------------------------------------------- /docs/assets/natural-animation.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/natural-animation.html -------------------------------------------------------------------------------- /docs/assets/random-both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/random-both.png -------------------------------------------------------------------------------- /docs/assets/random100-both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/random100-both.png -------------------------------------------------------------------------------- /docs/assets/raycast-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-1.png -------------------------------------------------------------------------------- /docs/assets/raycast-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-2.png -------------------------------------------------------------------------------- /docs/assets/raycast-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-3.png -------------------------------------------------------------------------------- /docs/assets/raycast-counting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-counting.png -------------------------------------------------------------------------------- /docs/assets/raycast-inside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-inside.png -------------------------------------------------------------------------------- /docs/assets/raycast-intersections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-intersections.png -------------------------------------------------------------------------------- /docs/assets/raycast-point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-point.png -------------------------------------------------------------------------------- /docs/assets/raycast-ray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-ray.png -------------------------------------------------------------------------------- /docs/assets/raycast-us.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/raycast-us.gif -------------------------------------------------------------------------------- /docs/assets/ri-both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/ri-both.png -------------------------------------------------------------------------------- /docs/assets/rtree-us.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/rtree-us.png -------------------------------------------------------------------------------- /docs/assets/simple-polygons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/simple-polygons.png -------------------------------------------------------------------------------- /docs/assets/tx-both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/tx-both.png -------------------------------------------------------------------------------- /docs/assets/ystripes-animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/ystripes-animation.gif -------------------------------------------------------------------------------- /docs/assets/ystripes-animation.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/assets/ystripes-animation.html -------------------------------------------------------------------------------- /docs/tools/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/tools/README.md -------------------------------------------------------------------------------- /docs/tools/build-api.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/tools/build-api.sh -------------------------------------------------------------------------------- /docs/tools/doxygen-md/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/tools/doxygen-md/README.md -------------------------------------------------------------------------------- /docs/tools/doxygen-md/go.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/tools/doxygen-md/go.mod -------------------------------------------------------------------------------- /docs/tools/doxygen-md/go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/tools/doxygen-md/go.sum -------------------------------------------------------------------------------- /docs/tools/doxygen-md/main.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/docs/tools/doxygen-md/main.go -------------------------------------------------------------------------------- /examples/intersects.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/examples/intersects.c -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/.gitignore -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/README.md -------------------------------------------------------------------------------- /tests/bench.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/bench.c -------------------------------------------------------------------------------- /tests/bmalloc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/bmalloc.c -------------------------------------------------------------------------------- /tests/bmalloc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/bmalloc.cpp -------------------------------------------------------------------------------- /tests/genrelations.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/genrelations.sh -------------------------------------------------------------------------------- /tests/geosbuild.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/geosbuild.sh -------------------------------------------------------------------------------- /tests/relate.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relate.c -------------------------------------------------------------------------------- /tests/relate.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relate.sh -------------------------------------------------------------------------------- /tests/relations/gcol.jsonc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relations/gcol.jsonc -------------------------------------------------------------------------------- /tests/relations/line.jsonc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relations/line.jsonc -------------------------------------------------------------------------------- /tests/relations/mline.jsonc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relations/mline.jsonc -------------------------------------------------------------------------------- /tests/relations/mpoint.jsonc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relations/mpoint.jsonc -------------------------------------------------------------------------------- /tests/relations/mpoly.jsonc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relations/mpoly.jsonc -------------------------------------------------------------------------------- /tests/relations/point.jsonc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relations/point.jsonc -------------------------------------------------------------------------------- /tests/relations/poly.jsonc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/relations/poly.jsonc -------------------------------------------------------------------------------- /tests/run.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/run.sh -------------------------------------------------------------------------------- /tests/shapes.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/shapes.h -------------------------------------------------------------------------------- /tests/test_geobin.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_geobin.c -------------------------------------------------------------------------------- /tests/test_geojson.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_geojson.c -------------------------------------------------------------------------------- /tests/test_geom.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_geom.c -------------------------------------------------------------------------------- /tests/test_index.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_index.c -------------------------------------------------------------------------------- /tests/test_line.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_line.c -------------------------------------------------------------------------------- /tests/test_memory.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_memory.c -------------------------------------------------------------------------------- /tests/test_nearest.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_nearest.c -------------------------------------------------------------------------------- /tests/test_parse.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_parse.c -------------------------------------------------------------------------------- /tests/test_point.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_point.c -------------------------------------------------------------------------------- /tests/test_poly.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_poly.c -------------------------------------------------------------------------------- /tests/test_rect.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_rect.c -------------------------------------------------------------------------------- /tests/test_relations.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_relations.c -------------------------------------------------------------------------------- /tests/test_ring.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_ring.c -------------------------------------------------------------------------------- /tests/test_segment.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_segment.c -------------------------------------------------------------------------------- /tests/test_various.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_various.c -------------------------------------------------------------------------------- /tests/test_wkb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_wkb.c -------------------------------------------------------------------------------- /tests/test_wkt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/test_wkt.c -------------------------------------------------------------------------------- /tests/tests.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tests/tests.h -------------------------------------------------------------------------------- /tg.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tg.c -------------------------------------------------------------------------------- /tg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tidwall/tg/HEAD/tg.h --------------------------------------------------------------------------------