From 62455426c026d8029688bdd4380af8e9bea92d31 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 11:44:58 -0700 Subject: [PATCH 01/31] WIP: initial setup of bindgen workflow --- sys/Cargo.toml | 19 +++-- sys/README.md | 39 +++++++-- sys/build.rs | 191 ++++++++++++++++++++++++++++++++++++++++---- sys/geos-src/source | 2 +- sys/src/lib.rs | 29 ++++--- sys/wrapper.h | 1 + 6 files changed, 237 insertions(+), 44 deletions(-) create mode 100644 sys/wrapper.h diff --git a/sys/Cargo.toml b/sys/Cargo.toml index 3918189..694892c 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "geos-sys" -version = "2.0.4" +version = "2.1.0" # TODO: set correct version authors = ["Guillaume Gomez "] description = "GEOS C API bindings" @@ -11,23 +11,28 @@ keywords = ["geos", "libgeos", "geometry", "geography", "gis"] categories = ["external-ffi-bindings", "algorithms"] license = "MIT" +edition = "2021" + build = "build.rs" [dependencies] -libc = "~0.2" +# libc = "~0.2" # do we want this? link-cplusplus = { version = "1.0", optional = true } geos-src = { path = "./geos-src", version = "0.2.1", optional = true } [build-dependencies] -pkg-config = "0.3" +bindgen = "0.60.1" +pkg-config = "0.3.25" +semver = "1.0" [lib] name = "geos_sys" -crate-type = ["dylib", "rlib"] [features] default = [] -v3_6_0 = [] -v3_7_0 = ["v3_6_0"] -v3_8_0 = ["v3_7_0"] +bindgen = [] static = ["geos-src", "link-cplusplus"] + +v3_6_0 = [] # Deprecated: does nothing +v3_7_0 = [] # Deprecated: does nothing +v3_8_0 = [] # Deprecated: does nothing diff --git a/sys/README.md b/sys/README.md index a1fab2c..c7d6eb5 100644 --- a/sys/README.md +++ b/sys/README.md @@ -1,26 +1,51 @@ # geos-sys -[GEOS](https://trac.osgeo.org/geos/) C API bindings. +Low level [GEOS](https://libgeos.org/) C API bindings for GEOS >= 3.7.0. It provides C-interface as is. If you want to use a more Rust-friendly crate, -prefer to use the [georust/geos](https://github.com/georust/geos) crate. +use the [georust/geos](https://github.com/georust/geos) crate. You can also find it on [crates.io](https://crates.io/crates/geos). -## Static build -If you want to link statically to libgeos, then use the `static` feature. It will build `libgeos` so you need to have `cmake` and a C++ compiler. +## Build + +By default, the build will use system-installed GEOS if available. + +If using system-installed GEOS, the build can be configured with a few +environment variables: +* If `GEOS_INCLUDE_DIR`, `GEOS_LIB_DIR`, and `GEOS_VERSION` are set, they will + be used +* otherwise, `pkg-config` (Linux / macOS) is queried to determine these values + +You can build the included version of GEOS using the `static` feature, which +will also statically link libgeos to this crate. In order to build GEOS, you +need to have `cmake` and a C++ compiler. + + +## Bindings + +By default, prebuilt bindings are used if they match your version of GEOS. + +If a prebuilt binding is not available, you can generate your own bindings using +the `bindgen` feature. + ## Add more functions This binding is written manually. -A little script is available to check what functions aren't available yet. You can run it as follows: +A little script is available to check what functions aren't available yet. You +can run it as follows: ```bash > python3 check_missing/check_missing.py ``` -It simply reads `geos` C header file and compare it with the `geos-sys`'s `src/functions.rs` file. Normally, you should never have more functions in the Rust code than the C code (deprecated functions aren't reexported in Rust). +It simply reads `geos` C header file and compare it with the `geos-sys`'s +`src/functions.rs` file. Normally, you should never have more functions in the +Rust code than the C code (deprecated functions aren't reexported in Rust). -If you want to support a newer GEOS version, please update the `check_missing/geos_c.h` file and then run the `check_missing.py` script to see what was added/removed. +If you want to support a newer GEOS version, please update the +`check_missing/geos_c.h` file and then run the `check_missing.py` script to see +what was added/removed. diff --git a/sys/build.rs b/sys/build.rs index 2a3c5e0..728afc1 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,31 +1,188 @@ -extern crate pkg_config; +use semver::Version; +use std::env; +use std::path::{Path, PathBuf}; + +const MINIMUM_GEOS_VERSION: &str = "3.7.0"; +const BUNDLED_GEOS_VERSION: &str = "3.11.0"; // TODO: 3.10.0 + +/// Hardcode a prebuilt binding version while generating docs. +/// Otherwise docs.rs will explode due to not actually having libgeos installed. +fn set_bindings_for_docs(out_path: &PathBuf) { + let version = Version::parse(BUNDLED_GEOS_VERSION).expect("invalid version for docs.rs"); + println!( + "cargo:rustc-cfg=geos_sys_{}_{}_{}", + version.major, version.minor, version.patch + ); + + let binding_path = PathBuf::from(format!( + "prebuilt-bindings/geos_{}.{}.rs", + version.major, version.minor + )); + + if !binding_path.exists() { + panic!("Missing bindings for docs.rs (version {})", version); + } + + std::fs::copy(&binding_path, &out_path).expect("Can't copy bindings to output directory"); +} + + +fn write_bindings(include_paths: Vec, out_path: &Path) { + let mut builder = bindgen::Builder::default() + .size_t_is_usize(true) + .header("wrapper.h"); + + for path in include_paths { + builder = builder.clang_arg("-I"); + builder = builder.clang_arg(path); + } + + builder + .generate() + .expect("Unable to generate bindings") + .write_to_file(out_path) + .expect("Unable to write bindings to file"); +} fn main() { - let lib = "geos_c"; + println!("cargo:rerun-if-env-changed=GEOS_INCLUDE_DIR"); + println!("cargo:rerun-if-env-changed=GEOS_LIB_DIR"); + println!("cargo:rerun-if-env-changed=GEOS_VERSION"); - if std::env::var("CARGO_FEATURE_STATIC").is_ok() { + let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs"); + let mut version = Version::new(0, 0, 0); + let mut include_paths = Vec::new(); + + if env::var("DOCS_RS").is_ok() { + set_bindings_for_docs(&out_path); + return; + } + + // static feature includes building the included GEOS prior to this build step + if cfg!(feature = "static"){ let geos_path = std::env::var("DEP_GEOSSRC_SEARCH").unwrap(); println!("cargo:rustc-link-lib=static=geos_c"); println!("cargo:rustc-link-lib=static=geos"); println!("cargo:rustc-link-search=native={}", geos_path); - println!("cargo:includedir={}/include", geos_path) + println!("cargo:includedir={}/include", geos_path); + + include_paths.push(geos_path + "/include"); + + version = Version::parse(BUNDLED_GEOS_VERSION).unwrap(); } else { - match pkg_config::Config::new().probe(lib) { - Ok(_) => {} - Err(_) => { - println!("cargo:rustc-link-lib=dylib={}", lib); + use pkg_config::Config; + + let include_dir_env = env::var_os("GEOS_INCLUDE_DIR"); + let lib_dir_env = env::var_os("GEOS_LIB_DIR"); + let version_env = env::var_os("GEOS_VERSION"); + + if include_dir_env.is_some() || lib_dir_env.is_some() || version_env.is_some() { + // if any env vars are set, all must be set + println!("cargo:rustc-link-lib=dylib=geos_c"); + + // GEOS_INCLUDE_DIR + match include_dir_env { + Some(path) => { + let include_dir = PathBuf::from(path).as_path().to_str().unwrap().to_string(); + include_paths.push(include_dir); + } + None => { + panic!("GEOS_INCLUDE_DIR must be set"); + } + } + + // GEOS_LIB_DIR + match lib_dir_env { + Some(path) => { + let lib_dir = PathBuf::from(path).as_path().to_str().unwrap().to_string(); + println!("cargo:rustc-link-search={}", lib_dir); + } + None => { + panic!("GEOS_LIB_DIR must be set"); + } + } + + // GEOS_VERSION + match version_env { + Some(raw_version) => { + match Version::parse(raw_version.to_string_lossy().to_string().trim()) { + Ok(parsed_version) => { + version = parsed_version; + } + Err(_) => panic!("Could not parse version: {:?}", raw_version), + } + } + None => { + panic!("GEOS_VERSION must be set"); + } + } + } else { + let geos_pkg_config = Config::new() + // .cargo_metadata(need_metadata) + .probe("geos"); + + if let Ok(geos) = &geos_pkg_config { + for dir in &geos.include_paths { + include_paths.push(dir.to_str().unwrap().to_string()); + } + + // standardize GEOS alpha / beta versions to match semver format: + let raw_version = geos + .version + .trim() + .replace("alpha", "-alpha") + .replace("beta", "-beta"); + + if let Ok(pkg_version) = Version::parse(&raw_version) { + version = pkg_version; + } + } else if let Err(pkg_config_err) = &geos_pkg_config { + // Special case output for this common error + if matches!(pkg_config_err, pkg_config::Error::Command { cause, .. } if cause.kind() == std::io::ErrorKind::NotFound) + { + panic!("Could not find `pkg-config` in your path. Please install it before building geos-sys."); + } else { + panic!("Error while running `pkg-config`: {}", pkg_config_err); + } + } else { + panic!("No GEOS version detected"); } } + + let min_geos_version = Version::parse(MINIMUM_GEOS_VERSION).unwrap(); + if version < min_geos_version { + panic!( + "GEOS version {}.{}.{} is older than the minimum supported version {}.{}.{}", + version.major, + version.minor, + version.patch, + min_geos_version.major, + min_geos_version.minor, + min_geos_version.patch + ); + } } - // TODO: handle library versions like this! - // - // pkg_config::probe_library("geos_c") - // .map(|lib| { - // if lib.version.starts_with("2.") { - // println!(r#"cargo:rustc-cfg=feature="v2""#); - // } - // }) - // .expect("GEOS library not found"); + if cfg!(feature = "bindgen") { + write_bindings(include_paths, &out_path); + } else { + { + println!( + "cargo:rustc-cfg=geos_sys_{}_{}_{}", + version.major, version.minor, version.patch + ); + + let binding_path = PathBuf::from(format!( + "prebuilt-bindings/geos_{}.{}.rs", + version.major, version.minor + )); + if !binding_path.exists() { + panic!("No pre-built bindings available for GEOS version {}.{}. Use `--features bindgen` to generate your own bindings.", version.major, version.minor); + } + + std::fs::copy(&binding_path, &out_path) + .expect("Can't copy bindings to output directory"); + } + } } diff --git a/sys/geos-src/source b/sys/geos-src/source index 804abff..89168f1 160000 --- a/sys/geos-src/source +++ b/sys/geos-src/source @@ -1 +1 @@ -Subproject commit 804abffe76c4e3fbc32399b82835d6b97cda7714 +Subproject commit 89168f10170175379ded3f2e6bda514c575a9b6a diff --git a/sys/src/lib.rs b/sys/src/lib.rs index 8daa871..2f68ec6 100644 --- a/sys/src/lib.rs +++ b/sys/src/lib.rs @@ -1,22 +1,27 @@ -//! [GEOS](https://trac.osgeo.org/geos/) C API bindings. +//! Low level [GEOS](https://libgeos.org/) C API bindings for GEOS >= 3.7.0. //! //! It provides C-interface as is. If you want to use a more Rust-friendly crate, -//! prefer to use the [georust/geos](https://github.com/georust/geos) crate. -//! +//! use the [georust/geos](https://github.com/georust/geos) crate. + //! You can also find it on [crates.io](https://crates.io/crates/geos). //! -//! ## Static build +//! By default, the build will use system-installed GEOS if available. //! -//! If you want to link statically to libgeos, then use the `static` feature. It will build -//!`libgeos` so you need to have `cmake` and a C++ compiler. +//! You can build the included version of GEOS using the `static` feature, which +//! will also statically link libgeos to this crate. In order to build GEOS, you +//! need to have `cmake` and a C++ compiler. + -extern crate libc; +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![doc(html_logo_url = "https://raw.githubusercontent.com/georust/meta/master/logo/logo.png")] + + +// extern crate libc; // TODO: is this needed #[cfg(feature = "static")] extern crate link_cplusplus; -pub use functions::*; -pub use types::*; - -mod functions; -mod types; +// TODO: look at what GDAL does +include!(concat!(env!("OUT_DIR"), "/bindings.rs")); diff --git a/sys/wrapper.h b/sys/wrapper.h new file mode 100644 index 0000000..9f1ddb4 --- /dev/null +++ b/sys/wrapper.h @@ -0,0 +1 @@ +#include \ No newline at end of file From baad1ab71f74253675f6c8b20aef2a9ee9b19cd4 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 15:44:00 -0700 Subject: [PATCH 02/31] Fix bugs in building static version and build of geos-src --- Cargo.toml | 1 + sys/Cargo.toml | 2 +- sys/README.md | 31 ++++++++++++++++++------------- sys/build.rs | 39 ++++++++++++++++----------------------- sys/geos-src/build.rs | 5 ++++- 5 files changed, 40 insertions(+), 38 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2cf6182..6030176 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ v3_7_0 = ["geos-sys/v3_7_0", "v3_6_0"] v3_8_0 = ["geos-sys/v3_8_0", "v3_7_0"] dox = ["geo-types", "wkt", "json"] static = ["geos-sys/static"] +bindgen = ["geos-sys/bindgen"] [dependencies] libc = "0.2" diff --git a/sys/Cargo.toml b/sys/Cargo.toml index 694892c..2d1a5a1 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -16,7 +16,7 @@ edition = "2021" build = "build.rs" [dependencies] -# libc = "~0.2" # do we want this? +libc = "~0.2" link-cplusplus = { version = "1.0", optional = true } geos-src = { path = "./geos-src", version = "0.2.1", optional = true } diff --git a/sys/README.md b/sys/README.md index c7d6eb5..6890426 100644 --- a/sys/README.md +++ b/sys/README.md @@ -20,7 +20,7 @@ environment variables: You can build the included version of GEOS using the `static` feature, which will also statically link libgeos to this crate. In order to build GEOS, you -need to have `cmake` and a C++ compiler. +need to have `cmake` and a C++ compiler. Building GEOS may take several minutes. ## Bindings @@ -30,22 +30,27 @@ By default, prebuilt bindings are used if they match your version of GEOS. If a prebuilt binding is not available, you can generate your own bindings using the `bindgen` feature. +### Adding a new GEOS version -## Add more functions +Install the desired GEOS version on your system and then run -This binding is written manually. +```bash +cargo build --features bindgen +``` + +This will produce a new binding in `target/debug/build/geos-sys-/out/bindings.rs`. -A little script is available to check what functions aren't available yet. You -can run it as follows: +Copy this to `prebuilt-bindings/geos_..rs`. + + +Alternatively, you can check the GEOS submodule in out `geos-src/source` out +to a particular version, and then use the `static` feature: ```bash -> python3 check_missing/check_missing.py +cargo build --features bindgen,static ``` -It simply reads `geos` C header file and compare it with the `geos-sys`'s -`src/functions.rs` file. Normally, you should never have more functions in the -Rust code than the C code (deprecated functions aren't reexported in Rust). - -If you want to support a newer GEOS version, please update the -`check_missing/geos_c.h` file and then run the `check_missing.py` script to see -what was added/removed. +Note that this may encounter build errors depending on the version of GEOS due +to CMake configuration issues. You may need to switch +`.define("BUILD_TESTING", "OFF")` in `geos-src/src/build.rs` to `"ON"` in order +to successfully build using CMake. \ No newline at end of file diff --git a/sys/build.rs b/sys/build.rs index 728afc1..8931e40 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -2,7 +2,7 @@ use semver::Version; use std::env; use std::path::{Path, PathBuf}; -const MINIMUM_GEOS_VERSION: &str = "3.7.0"; +const MINIMUM_GEOS_VERSION: &str = "3.6.0"; const BUNDLED_GEOS_VERSION: &str = "3.11.0"; // TODO: 3.10.0 /// Hardcode a prebuilt binding version while generating docs. @@ -26,18 +26,14 @@ fn set_bindings_for_docs(out_path: &PathBuf) { std::fs::copy(&binding_path, &out_path).expect("Can't copy bindings to output directory"); } +fn write_bindings(include_path: &Path, out_path: &Path) { + let geos_header = include_path.join("geos_c.h").to_str().unwrap().to_string(); -fn write_bindings(include_paths: Vec, out_path: &Path) { - let mut builder = bindgen::Builder::default() + bindgen::Builder::default() .size_t_is_usize(true) - .header("wrapper.h"); - - for path in include_paths { - builder = builder.clang_arg("-I"); - builder = builder.clang_arg(path); - } - - builder + .header(geos_header) + .clang_arg("-I") + .clang_arg(include_path.to_str().unwrap()) .generate() .expect("Unable to generate bindings") .write_to_file(out_path) @@ -45,13 +41,14 @@ fn write_bindings(include_paths: Vec, out_path: &Path) { } fn main() { + println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-env-changed=GEOS_INCLUDE_DIR"); println!("cargo:rerun-if-env-changed=GEOS_LIB_DIR"); println!("cargo:rerun-if-env-changed=GEOS_VERSION"); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs"); let mut version = Version::new(0, 0, 0); - let mut include_paths = Vec::new(); + let include_path: PathBuf; if env::var("DOCS_RS").is_ok() { set_bindings_for_docs(&out_path); @@ -59,7 +56,7 @@ fn main() { } // static feature includes building the included GEOS prior to this build step - if cfg!(feature = "static"){ + if cfg!(feature = "static") { let geos_path = std::env::var("DEP_GEOSSRC_SEARCH").unwrap(); println!("cargo:rustc-link-lib=static=geos_c"); @@ -67,7 +64,7 @@ fn main() { println!("cargo:rustc-link-search=native={}", geos_path); println!("cargo:includedir={}/include", geos_path); - include_paths.push(geos_path + "/include"); + include_path = Path::join(Path::parent(&PathBuf::from(geos_path).as_path()).unwrap(), "include"); version = Version::parse(BUNDLED_GEOS_VERSION).unwrap(); } else { @@ -84,8 +81,7 @@ fn main() { // GEOS_INCLUDE_DIR match include_dir_env { Some(path) => { - let include_dir = PathBuf::from(path).as_path().to_str().unwrap().to_string(); - include_paths.push(include_dir); + include_path = PathBuf::from(path); } None => { panic!("GEOS_INCLUDE_DIR must be set"); @@ -118,14 +114,11 @@ fn main() { } } } else { - let geos_pkg_config = Config::new() - // .cargo_metadata(need_metadata) - .probe("geos"); + let geos_pkg_config = Config::new().probe("geos"); if let Ok(geos) = &geos_pkg_config { - for dir in &geos.include_paths { - include_paths.push(dir.to_str().unwrap().to_string()); - } + // GEOS should only have one include path for geos_c.h header + include_path = PathBuf::from(geos.include_paths.first().unwrap()); // standardize GEOS alpha / beta versions to match semver format: let raw_version = geos @@ -165,7 +158,7 @@ fn main() { } if cfg!(feature = "bindgen") { - write_bindings(include_paths, &out_path); + write_bindings(&include_path, &out_path); } else { { println!( diff --git a/sys/geos-src/build.rs b/sys/geos-src/build.rs index 329a4f0..19d4805 100644 --- a/sys/geos-src/build.rs +++ b/sys/geos-src/build.rs @@ -4,10 +4,13 @@ fn main() { let mut libgeos_config = cmake::Config::new("source"); libgeos_config .define("BUILD_BENCHMARKS", "OFF") + // BUILD_TESTING may need to be set ON for GEOS 3.8.x / 3.9.x due to CMake issues .define("BUILD_TESTING", "OFF") .define("BUILD_DOCUMENTATION", "OFF") - .define("BUILD_SHARED_LIBS", "OFF") .define("CMAKE_INSTALL_LIBDIR", "lib") + .define("BUILD_SHARED_LIBS", "OFF") // GEOS >= 3.8 + .define("GEOS_BUILD_STATIC", "ON") // GEOS <= 3.7 + .define("GEOS_BUILD_SHARED", "OFF") // GEOS <= 3.7 .profile("Release"); let libgeos = libgeos_config.build(); From b475439ccc276df26cd74f15e8a03e91358f840f Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 17:28:31 -0700 Subject: [PATCH 03/31] Add bindings for GEOS 3.7 - 3.11beta2, fix build script --- sys/build.rs | 36 +- sys/check_missing/check_missing.py | 205 - sys/check_missing/geos_c.h | 2171 ------- sys/geos-src/build.rs | 1 + sys/prebuilt-bindings/geos_3.10.rs | 4555 +++++++++++++++ sys/prebuilt-bindings/geos_3.11.rs | 4971 +++++++++++++++++ .../geos_3.7.rs} | 3233 +++++++---- sys/prebuilt-bindings/geos_3.8.rs | 2407 ++++++++ sys/prebuilt-bindings/geos_3.9.rs | 2528 +++++++++ sys/src/types.rs | 63 - sys/wrapper.h | 1 - 11 files changed, 16602 insertions(+), 3569 deletions(-) delete mode 100644 sys/check_missing/check_missing.py delete mode 100644 sys/check_missing/geos_c.h create mode 100644 sys/prebuilt-bindings/geos_3.10.rs create mode 100644 sys/prebuilt-bindings/geos_3.11.rs rename sys/{src/functions.rs => prebuilt-bindings/geos_3.7.rs} (51%) create mode 100644 sys/prebuilt-bindings/geos_3.8.rs create mode 100644 sys/prebuilt-bindings/geos_3.9.rs delete mode 100644 sys/src/types.rs delete mode 100644 sys/wrapper.h diff --git a/sys/build.rs b/sys/build.rs index 8931e40..8c8d8b2 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -34,6 +34,36 @@ fn write_bindings(include_path: &Path, out_path: &Path) { .header(geos_header) .clang_arg("-I") .clang_arg(include_path.to_str().unwrap()) + // use libc instead of default std::os::raw + .ctypes_prefix("libc") + // block deprecated APIs (both plain and "_r" variants) + .blocklist_function("initGEOS") + .blocklist_function("initGEOS_r") + .blocklist_function("finishGEOS") + .blocklist_function("finishGEOS_r") + .blocklist_function("GEOSGeomFromWKT") + .blocklist_function("GEOSGeomFromWKT_r") + .blocklist_function("GEOSGeomToWKT") + .blocklist_function("GEOSGeomToWKT_r") + .blocklist_function("GEOSSingleSidedBuffer") + .blocklist_function("GEOSSingleSidedBuffer_r") + .blocklist_function("GEOSUnionCascaded") + .blocklist_function("GEOSUnionCascaded_r") + // TODO: remove; these were deprecated a long time ago but are still used here + // .blocklist_function("GEOS_getWKBOutputDims") + // .blocklist_function("GEOS_getWKBOutputDims_r") + // .blocklist_function("GEOS_setWKBOutputDims") + // .blocklist_function("GEOS_setWKBOutputDims_r") + // .blocklist_function("GEOS_getWKBByteOrder") + // .blocklist_function("GEOS_getWKBByteOrder_r") + // .blocklist_function("GEOS_setWKBByteOrder") + // .blocklist_function("GEOS_setWKBByteOrder_r") + // .blocklist_function("GEOSGeomFromWKB_buf") + // .blocklist_function("GEOSGeomFromWKB_buf_r") + // .blocklist_function("GEOSGeomToWKB_buf") + // .blocklist_function("GEOSGeomToWKB_buf_r") + // .blocklist_function("GEOSGeomFromHEX_buf") + // .blocklist_function("GEOSGeomFromHEX_buf_r") .generate() .expect("Unable to generate bindings") .write_to_file(out_path) @@ -59,6 +89,7 @@ fn main() { if cfg!(feature = "static") { let geos_path = std::env::var("DEP_GEOSSRC_SEARCH").unwrap(); + // Note: static lib "geos_c" isn't available for GEOS 3.7.x println!("cargo:rustc-link-lib=static=geos_c"); println!("cargo:rustc-link-lib=static=geos"); println!("cargo:rustc-link-search=native={}", geos_path); @@ -120,12 +151,13 @@ fn main() { // GEOS should only have one include path for geos_c.h header include_path = PathBuf::from(geos.include_paths.first().unwrap()); - // standardize GEOS alpha / beta versions to match semver format: + // standardize GEOS prerelease versions to match semver format: let raw_version = geos .version .trim() .replace("alpha", "-alpha") - .replace("beta", "-beta"); + .replace("beta", "-beta") + .replace("dev", "-dev"); if let Ok(pkg_version) = Version::parse(&raw_version) { version = pkg_version; diff --git a/sys/check_missing/check_missing.py b/sys/check_missing/check_missing.py deleted file mode 100644 index a991b61..0000000 --- a/sys/check_missing/check_missing.py +++ /dev/null @@ -1,205 +0,0 @@ -import sys - - -TO_IGNORE = [ - 'initGEOS_r', # deprecated in 3.5 - 'finishGEOS_r', # deprecated in 3.5 - 'GEOSGeomFromWKT', # deprecated - 'GEOSGeomFromWKT_r', # deprecated - 'GEOSGeomToWKT', # deprecated - 'GEOSGeomToWKT_r', # deprecated - 'GEOSSingleSidedBuffer', # deprecated in 3.3 - 'GEOSSingleSidedBuffer_r', # deprecated in 3.3 - 'GEOSUnionCascaded', # deprecated in 3.3 - 'GEOSUnionCascaded_r', # deprecated in 3.3 -] - - -def get_c_args(text, args): - for part in text.split(','): - part = part.strip() - if len(part) == 0: - continue - params = part.split(' ') - ty_name = params.pop() - params = ' '.join(params) - while ty_name.endswith('[]'): - params += ' *const' - ty_name = ty_name[:-2].strip() - if len(ty_name) == 0: - ty_name = params.pop() - while ty_name.startswith('*'): - params += '*' - ty_name = ty_name[1:] - args.append(params.replace(' * const', ' *const').strip()) - - -def get_rust_args(text, args): - for part in text.split(','): - part = part.strip() - if len(part) == 0: - continue - params = part.split(':') - params.pop(0) - args.append(' '.join([x.strip() for x in params if len(x.strip()) > 0])) - - -def get_c_functions(filename): - content = None - functions = {} - with open(filename) as f: - content = f.read().splitlines() - if content is None: - return functions - pos = 0 - while pos < len(content): - line = content[pos] - if ' GEOS_DLL ' not in line: - pos += 1 - continue - parts = line.split(' GEOS_DLL ') - ret_type = parts[0].split('extern ')[1].strip() - name_and_args = parts[1].split('(') - func_name = name_and_args[0] - while func_name.startswith('*'): - ret_type += '*' - func_name = func_name[1:] - args = [] - get_c_args(name_and_args[1], args) - if not name_and_args[1].endswith(');'): - pos += 1 - while pos < len(content): - get_c_args(content[pos].strip().split(');')[0], args) - if content[pos].endswith(');'): - break - pos += 1 - func_name = func_name.strip() - if len(func_name) > 0 and func_name not in TO_IGNORE: - functions[func_name] = (args, ret_type) - pos += 1 - return functions - - -def get_rust_ret_type(text): - if ') -> ' not in text: - return '' - return text.split(') -> ')[1].split(';')[0] - - -def convert_c_to_rust(c_type): - inline_conv = { - 'int': 'c_int', - 'char': 'c_char', - 'void': 'c_void', - 'double': 'c_double', - 'float': 'c_float' - } - unsigned_inline_conv = { - 'int': 'c_uint', - 'char': 'c_uchar', - 'c_int': 'c_uint', - 'c_char': 'c_uchar' - } - parts = c_type.strip().split(' ') - is_const = False - pos = 0 - complete_type = [] - while pos < len(parts): - if parts[pos] == 'const': - if pos == 0: - is_const = True - else: - complete_type.append(parts[pos]) - pos += 1 - while complete_type[len(complete_type) - 1].endswith('*'): - complete_type[len(complete_type) - 1] = complete_type[len(complete_type) - 1][:-1].strip() - complete_type.insert(0, '*const' if is_const else '*mut') - while complete_type[-1].endswith('*const'): - complete_type[-1] = complete_type[-1][:-6].strip() - if len(complete_type[-1]) == 0: - complete_type.pop() - complete_type.insert(0, '*const') - pos = 0 - while pos < len(complete_type): - if complete_type[pos] == 'unsigned': - complete_type.pop(pos) - complete_type[pos] = unsigned_inline_conv[complete_type[pos]] - else: - complete_type[pos] = inline_conv.get(complete_type[pos], complete_type[pos]) - pos += 1 - return ' '.join([x.strip() for x in complete_type if len(x.strip()) > 0]) - - -def compare_rust_and_c_funcs(name, c_func, rust_args, ret_type): - errors = 0 - c_func_args = ','.join([convert_c_to_rust(x) for x in c_func[0]]) - c_func_ret = convert_c_to_rust(c_func[1]) - if c_func_ret == 'c_void': - c_func_ret = '' - if c_func_ret != ret_type: - print('[{}]: ret types differ: `{}` != `{}`'.format(name, c_func_ret, ret_type)) - errors += 1 - if c_func_args != ','.join(rust_args): - print('[{}]: params differ:\n=> `{}`\n-> `{}`'.format(name, c_func_args, ','.join(rust_args))) - errors += 1 - return errors == 0 - - -def get_rust_functions(filename, c_func): - errors = 0 - content = None - functions = set() - with open(filename) as f: - content = f.read().splitlines() - if content is None: - return - pos = 0 - while pos < len(content): - line = content[pos] - if ' fn ' not in line: - pos += 1 - continue - parts = line.split(' fn ')[1].split('(') - func_name = parts[0].strip() - if func_name in c_func: - args = [] - get_rust_args(parts[1].split(')')[0].strip(), args) - if not line.endswith(');') and not ') -> ' in line: - pos += 1 - while pos < len(content): - get_rust_args(content[pos].strip().split(')')[0], args) - if content[pos].endswith(');') or ') -> ' in content[pos]: - break - pos += 1 - ret_type = get_rust_ret_type(content[pos]) - if not compare_rust_and_c_funcs(func_name, c_func[func_name], args, ret_type): - errors += 1 - del c_func[func_name] - elif len(func_name) > 0: - functions.add(func_name) - pos += 1 - return (functions, errors != 0) - - -c_func = get_c_functions('check_missing/geos_c.h') -r_func, errored = get_rust_functions('src/functions.rs', c_func) - - -x = [] -print('==> Not bound functions:') -for f in c_func: - x.append(f) -x.sort() -for f in x: - print(f) -print('') -print('==> Extra (???) rust functions:') -x = [] -for f in r_func: - x.append(f) -x.sort() -for f in x: - print(f) - -if errored or len(c_func) > 0 or len(r_func) > 0: - sys.exit(1) diff --git a/sys/check_missing/geos_c.h b/sys/check_missing/geos_c.h deleted file mode 100644 index 3818c7e..0000000 --- a/sys/check_missing/geos_c.h +++ /dev/null @@ -1,2171 +0,0 @@ -/************************************************************************ - * - * - * C-Wrapper for GEOS library - * - * Copyright (C) 2010 2011 Sandro Santilli - * Copyright (C) 2005 Refractions Research Inc. - * - * This is free software; you can redistribute and/or modify it under - * the terms of the GNU Lesser General Public Licence as published - * by the Free Software Foundation. - * See the COPYING file for more information. - * - * Author: Sandro Santilli - * - *********************************************************************** - * - * GENERAL NOTES: - * - * - Remember to call initGEOS() before any use of this library's - * functions, and call finishGEOS() when done. - * - * - Currently you have to explicitly GEOSGeom_destroy() all - * GEOSGeom objects to avoid memory leaks, and GEOSFree() - * all returned char * (unless const). - * - * - Functions ending with _r are thread safe; see details in RFC 3 - * http://trac.osgeo.org/geos/wiki/RFC3. - * To avoid using by accident non _r functions, - * define GEOS_USE_ONLY_R_API before including geos_c.h - * - ***********************************************************************/ - -#ifndef GEOS_C_H_INCLUDED -#define GEOS_C_H_INCLUDED - -#ifndef __cplusplus -# include /* for size_t definition */ -#else -# include -using std::size_t; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************ - * - * Version - * - ***********************************************************************/ - -#ifndef GEOS_VERSION_MAJOR -#define GEOS_VERSION_MAJOR @VERSION_MAJOR@ -#endif -#ifndef GEOS_VERSION_MINOR -#define GEOS_VERSION_MINOR @VERSION_MINOR@ -#endif -#ifndef GEOS_VERSION_PATCH -#define GEOS_VERSION_PATCH @VERSION_PATCH@ -#endif -#ifndef GEOS_VERSION -#define GEOS_VERSION "@VERSION@" -#endif -#ifndef GEOS_JTS_PORT -#define GEOS_JTS_PORT "@JTS_PORT@" -#endif - -#define GEOS_CAPI_VERSION_MAJOR @CAPI_VERSION_MAJOR@ -#define GEOS_CAPI_VERSION_MINOR @CAPI_VERSION_MINOR@ -#define GEOS_CAPI_VERSION_PATCH @CAPI_VERSION_PATCH@ -#define GEOS_CAPI_VERSION "@VERSION@-CAPI-@CAPI_VERSION@" - -#define GEOS_CAPI_FIRST_INTERFACE GEOS_CAPI_VERSION_MAJOR -#define GEOS_CAPI_LAST_INTERFACE (GEOS_CAPI_VERSION_MAJOR+GEOS_CAPI_VERSION_MINOR) - -/************************************************************************ - * - * (Abstract) type definitions - * - ************************************************************************/ - -typedef struct GEOSContextHandle_HS *GEOSContextHandle_t; - -typedef void (*GEOSMessageHandler)(const char *fmt, ...); - -/* - * A GEOS message handler function. - * - * @param message the message contents - * @param userdata the user data pointer that was passed to GEOS when registering this message handler. - * - * - * @see GEOSContext_setErrorMessageHandler - * @see GEOSContext_setNoticeMessageHandler - */ -typedef void (*GEOSMessageHandler_r)(const char *message, void *userdata); - -/* When we're included by geos_c.cpp, those are #defined to the original - * JTS definitions via preprocessor. We don't touch them to allow the - * compiler to cross-check the declarations. However, for all "normal" - * C-API users, we need to define them as "opaque" struct pointers, as - * those clients don't have access to the original C++ headers, by design. - */ -#ifndef GEOSGeometry -typedef struct GEOSGeom_t GEOSGeometry; -typedef struct GEOSPrepGeom_t GEOSPreparedGeometry; -typedef struct GEOSCoordSeq_t GEOSCoordSequence; -typedef struct GEOSSTRtree_t GEOSSTRtree; -typedef struct GEOSBufParams_t GEOSBufferParams; -#endif - -/* Those are compatibility definitions for source compatibility - * with GEOS 2.X clients relying on that type. - */ -typedef GEOSGeometry* GEOSGeom; -typedef GEOSCoordSequence* GEOSCoordSeq; - -/* Supported geometry types - * This was renamed from GEOSGeomTypeId in GEOS 2.2.X, which might - * break compatibility, this issue is still under investigation. - */ - -enum GEOSGeomTypes { - GEOS_POINT, - GEOS_LINESTRING, - GEOS_LINEARRING, - GEOS_POLYGON, - GEOS_MULTIPOINT, - GEOS_MULTILINESTRING, - GEOS_MULTIPOLYGON, - GEOS_GEOMETRYCOLLECTION -}; - -/* Byte orders exposed via the C API */ -enum GEOSByteOrders { - GEOS_WKB_XDR = 0, /* Big Endian */ - GEOS_WKB_NDR = 1 /* Little Endian */ -}; - -typedef void (*GEOSQueryCallback)(void *item, void *userdata); -typedef int (*GEOSDistanceCallback)(const void *item1, const void* item2, double* distance, void* userdata); - -/************************************************************************ - * - * Initialization, cleanup, version - * - ***********************************************************************/ - -#include - -/* - * Register an interruption checking callback - * - * The callback will be invoked _before_ checking for - * interruption, so can be used to request it. - */ -typedef void (GEOSInterruptCallback)(); -extern GEOSInterruptCallback GEOS_DLL *GEOS_interruptRegisterCallback(GEOSInterruptCallback* cb); -/* Request safe interruption of operations */ -extern void GEOS_DLL GEOS_interruptRequest(); -/* Cancel a pending interruption request */ -extern void GEOS_DLL GEOS_interruptCancel(); - -/* - * @deprecated in 3.5.0 - * initialize using GEOS_init_r() and set the message handlers using - * GEOSContext_setNoticeHandler_r and/or GEOSContext_setErrorHandler_r - */ -extern GEOSContextHandle_t GEOS_DLL initGEOS_r( - GEOSMessageHandler notice_function, - GEOSMessageHandler error_function); -/* - * @deprecated in 3.5.0 replaced by GEOS_finish_r. - */ -extern void GEOS_DLL finishGEOS_r(GEOSContextHandle_t handle); - -extern GEOSContextHandle_t GEOS_DLL GEOS_init_r(); -extern void GEOS_DLL GEOS_finish_r(GEOSContextHandle_t handle); - - -extern GEOSMessageHandler GEOS_DLL GEOSContext_setNoticeHandler_r(GEOSContextHandle_t extHandle, - GEOSMessageHandler nf); -extern GEOSMessageHandler GEOS_DLL GEOSContext_setErrorHandler_r(GEOSContextHandle_t extHandle, - GEOSMessageHandler ef); - -/* - * Sets a notice message handler on the given GEOS context. - * - * @param extHandle the GEOS context - * @param nf the message handler - * @param userData optional user data pointer that will be passed to the message handler - * - * @return the previously configured message handler or NULL if no message handler was configured - */ -extern GEOSMessageHandler_r GEOS_DLL GEOSContext_setNoticeMessageHandler_r(GEOSContextHandle_t extHandle, - GEOSMessageHandler_r nf, - void *userData); - -/* - * Sets an error message handler on the given GEOS context. - * - * @param extHandle the GEOS context - * @param ef the message handler - * @param userData optional user data pointer that will be passed to the message handler - * - * @return the previously configured message handler or NULL if no message handler was configured - */ -extern GEOSMessageHandler_r GEOS_DLL GEOSContext_setErrorMessageHandler_r(GEOSContextHandle_t extHandle, - GEOSMessageHandler_r ef, - void *userData); - -extern const char GEOS_DLL *GEOSversion(); - - -/************************************************************************ - * - * NOTE - These functions are DEPRECATED. Please use the new Reader and - * writer APIS! - * - ***********************************************************************/ - -extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKT_r(GEOSContextHandle_t handle, - const char *wkt); -extern char GEOS_DLL *GEOSGeomToWKT_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* - * Specify whether output WKB should be 2d or 3d. - * Return previously set number of dimensions. - */ - -extern int GEOS_DLL GEOS_getWKBOutputDims_r(GEOSContextHandle_t handle); -extern int GEOS_DLL GEOS_setWKBOutputDims_r(GEOSContextHandle_t handle, - int newDims); - -/* - * Specify whether the WKB byte order is big or little endian. - * The return value is the previous byte order. - */ - -extern int GEOS_DLL GEOS_getWKBByteOrder_r(GEOSContextHandle_t handle); -extern int GEOS_DLL GEOS_setWKBByteOrder_r(GEOSContextHandle_t handle, - int byteOrder); - -extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKB_buf_r(GEOSContextHandle_t handle, - const unsigned char *wkb, - size_t size); -extern unsigned char GEOS_DLL *GEOSGeomToWKB_buf_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, - size_t *size); - -extern GEOSGeometry GEOS_DLL *GEOSGeomFromHEX_buf_r(GEOSContextHandle_t handle, - const unsigned char *hex, - size_t size); -extern unsigned char GEOS_DLL *GEOSGeomToHEX_buf_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, - size_t *size); - -/************************************************************************ - * - * Coordinate Sequence functions - * - ***********************************************************************/ - -/* - * Create a Coordinate sequence with ``size'' coordinates - * of ``dims'' dimensions. - * Return NULL on exception. - */ -extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_create_r( - GEOSContextHandle_t handle, - unsigned int size, - unsigned int dims); - -/* - * Clone a Coordinate Sequence. - * Return NULL on exception. - */ -extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_clone_r( - GEOSContextHandle_t handle, - const GEOSCoordSequence* s); - -/* - * Destroy a Coordinate Sequence. - */ -extern void GEOS_DLL GEOSCoordSeq_destroy_r(GEOSContextHandle_t handle, - GEOSCoordSequence* s); - -/* - * Set ordinate values in a Coordinate Sequence. - * Return 0 on exception. - */ -extern int GEOS_DLL GEOSCoordSeq_setX_r(GEOSContextHandle_t handle, - GEOSCoordSequence* s, unsigned int idx, - double val); -extern int GEOS_DLL GEOSCoordSeq_setY_r(GEOSContextHandle_t handle, - GEOSCoordSequence* s, unsigned int idx, - double val); -extern int GEOS_DLL GEOSCoordSeq_setZ_r(GEOSContextHandle_t handle, - GEOSCoordSequence* s, unsigned int idx, - double val); -extern int GEOS_DLL GEOSCoordSeq_setOrdinate_r(GEOSContextHandle_t handle, - GEOSCoordSequence* s, - unsigned int idx, - unsigned int dim, double val); - -/* - * Get ordinate values from a Coordinate Sequence. - * Return 0 on exception. - */ -extern int GEOS_DLL GEOSCoordSeq_getX_r(GEOSContextHandle_t handle, - const GEOSCoordSequence* s, - unsigned int idx, double *val); -extern int GEOS_DLL GEOSCoordSeq_getY_r(GEOSContextHandle_t handle, - const GEOSCoordSequence* s, - unsigned int idx, double *val); -extern int GEOS_DLL GEOSCoordSeq_getZ_r(GEOSContextHandle_t handle, - const GEOSCoordSequence* s, - unsigned int idx, double *val); -extern int GEOS_DLL GEOSCoordSeq_getOrdinate_r(GEOSContextHandle_t handle, - const GEOSCoordSequence* s, - unsigned int idx, - unsigned int dim, double *val); -/* - * Get size and dimensions info from a Coordinate Sequence. - * Return 0 on exception. - */ -extern int GEOS_DLL GEOSCoordSeq_getSize_r(GEOSContextHandle_t handle, - const GEOSCoordSequence* s, - unsigned int *size); -extern int GEOS_DLL GEOSCoordSeq_getDimensions_r(GEOSContextHandle_t handle, - const GEOSCoordSequence* s, - unsigned int *dims); -/* - * Check orientation of a CoordinateSequence and set 'is_ccw' to 1 - * if it has counter-clockwise orientation, 0 otherwise. - * Return 0 on exception, 1 on success. - */ -extern int GEOS_DLL GEOSCoordSeq_isCCW_r(GEOSContextHandle_t handle, - const GEOSCoordSequence* s, - char* is_ccw); - -/************************************************************************ - * - * Linear referencing functions -- there are more, but these are - * probably sufficient for most purposes - * - ***********************************************************************/ - -/* - * GEOSGeometry ownership is retained by caller - */ - - -/* Return distance of point 'p' projected on 'g' from origin - * of 'g'. Geometry 'g' must be a lineal geometry */ -extern double GEOS_DLL GEOSProject_r(GEOSContextHandle_t handle, - const GEOSGeometry *g, - const GEOSGeometry *p); - -/* Return closest point to given distance within geometry - * Geometry must be a LineString */ -extern GEOSGeometry GEOS_DLL *GEOSInterpolate_r(GEOSContextHandle_t handle, - const GEOSGeometry *g, - double d); - -extern double GEOS_DLL GEOSProjectNormalized_r(GEOSContextHandle_t handle, - const GEOSGeometry *g, - const GEOSGeometry *p); - -extern GEOSGeometry GEOS_DLL *GEOSInterpolateNormalized_r( - GEOSContextHandle_t handle, - const GEOSGeometry *g, - double d); - -/************************************************************************ - * - * Buffer related functions - * - ***********************************************************************/ - - -/* @return NULL on exception */ -extern GEOSGeometry GEOS_DLL *GEOSBuffer_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, - double width, int quadsegs); - -enum GEOSBufCapStyles { - GEOSBUF_CAP_ROUND=1, - GEOSBUF_CAP_FLAT=2, - GEOSBUF_CAP_SQUARE=3 -}; - -enum GEOSBufJoinStyles { - GEOSBUF_JOIN_ROUND=1, - GEOSBUF_JOIN_MITRE=2, - GEOSBUF_JOIN_BEVEL=3 -}; - -/* @return 0 on exception */ -extern GEOSBufferParams GEOS_DLL *GEOSBufferParams_create_r( - GEOSContextHandle_t handle); -extern void GEOS_DLL GEOSBufferParams_destroy_r( - GEOSContextHandle_t handle, - GEOSBufferParams* parms); - -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setEndCapStyle_r( - GEOSContextHandle_t handle, - GEOSBufferParams* p, - int style); - -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setJoinStyle_r( - GEOSContextHandle_t handle, - GEOSBufferParams* p, - int joinStyle); - -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setMitreLimit_r( - GEOSContextHandle_t handle, - GEOSBufferParams* p, - double mitreLimit); - -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setQuadrantSegments_r( - GEOSContextHandle_t handle, - GEOSBufferParams* p, - int quadSegs); - -/* @param singleSided: 1 for single sided, 0 otherwise */ -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setSingleSided_r( - GEOSContextHandle_t handle, - GEOSBufferParams* p, - int singleSided); - -/* @return NULL on exception */ -extern GEOSGeometry GEOS_DLL *GEOSBufferWithParams_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g, - const GEOSBufferParams* p, - double width); - -/* These functions return NULL on exception. */ -extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, double width, int quadsegs, int endCapStyle, - int joinStyle, double mitreLimit); - -/* These functions return NULL on exception. Only LINESTRINGs are accepted. */ -/* @deprecated in 3.3.0: use GEOSOffsetCurve instead */ -extern GEOSGeometry GEOS_DLL *GEOSSingleSidedBuffer_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g, double width, int quadsegs, - int joinStyle, double mitreLimit, int leftSide); - -/* - * Only LINESTRINGs are accepted. - * @param width : offset distance. - * negative for right side offset. - * positive for left side offset. - * @return NULL on exception - */ -extern GEOSGeometry GEOS_DLL *GEOSOffsetCurve_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, double width, int quadsegs, - int joinStyle, double mitreLimit); - - -/************************************************************************ - * - * Geometry Constructors. - * GEOSCoordSequence* arguments will become ownership of the returned object. - * All functions return NULL on exception. - * - ***********************************************************************/ - -extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint_r( - GEOSContextHandle_t handle, - GEOSCoordSequence* s); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPoint_r( - GEOSContextHandle_t handle); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createLinearRing_r( - GEOSContextHandle_t handle, - GEOSCoordSequence* s); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createLineString_r( - GEOSContextHandle_t handle, - GEOSCoordSequence* s); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyLineString_r( - GEOSContextHandle_t handle); - -/* - * Second argument is an array of GEOSGeometry* objects. - * The caller remains owner of the array, but pointed-to - * objects become ownership of the returned GEOSGeometry. - */ -extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPolygon_r( - GEOSContextHandle_t handle); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon_r( - GEOSContextHandle_t handle, - GEOSGeometry* shell, - GEOSGeometry** holes, - unsigned int nholes); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createCollection_r( - GEOSContextHandle_t handle, int type, - GEOSGeometry* *geoms, - unsigned int ngeoms); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyCollection_r( - GEOSContextHandle_t handle, int type); - -extern GEOSGeometry GEOS_DLL *GEOSGeom_clone_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/************************************************************************ - * - * Memory management - * - ***********************************************************************/ - -extern void GEOS_DLL GEOSGeom_destroy_r(GEOSContextHandle_t handle, - GEOSGeometry* g); - -/************************************************************************ - * - * Topology operations - return NULL on exception. - * - ***********************************************************************/ - -extern GEOSGeometry GEOS_DLL *GEOSEnvelope_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSIntersection_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern GEOSGeometry GEOS_DLL *GEOSConvexHull_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* Returns the minimum rotated rectangular POLYGON which encloses the input geometry. The rectangle - * has width equal to the minimum diameter, and a longer length. If the convex hill of the input is - * degenerate (a line or point) a LINESTRING or POINT is returned. The minimum rotated rectangle can - * be used as an extremely generalized representation for the given geometry. - */ -extern GEOSGeometry GEOS_DLL *GEOSMinimumRotatedRectangle_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* Returns a LINESTRING geometry which represents the minimum diameter of the geometry. - * The minimum diameter is defined to be the width of the smallest band that - * contains the geometry, where a band is a strip of the plane defined - * by two parallel lines. This can be thought of as the smallest hole that the geometry - * can be moved through, with a single rotation. - */ -extern GEOSGeometry GEOS_DLL *GEOSMinimumWidth_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -extern GEOSGeometry GEOS_DLL *GEOSMinimumClearanceLine_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -extern int GEOS_DLL GEOSMinimumClearance_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, - double* distance); - -extern GEOSGeometry GEOS_DLL *GEOSDifference_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern GEOSGeometry GEOS_DLL *GEOSSymDifference_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern GEOSGeometry GEOS_DLL *GEOSBoundary_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSUnion_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern GEOSGeometry GEOS_DLL *GEOSUnaryUnion_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -/* @deprecated in 3.3.0: use GEOSUnaryUnion_r instead */ -extern GEOSGeometry GEOS_DLL *GEOSUnionCascaded_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSPointOnSurface_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSGetCentroid_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSNode_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -/* Fast, non-robust intersection between an arbitrary geometry and - * a rectangle. The returned geometry may be invalid. */ -extern GEOSGeometry GEOS_DLL *GEOSClipByRect_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, - double xmin, double ymin, - double xmax, double ymax); - -/* - * all arguments remain ownership of the caller - * (both Geometries and pointers) - */ -/* - * Polygonizes a set of Geometries which contain linework that - * represents the edges of a planar graph. - * - * Any dimension of Geometry is handled - the constituent linework - * is extracted to form the edges. - * - * The edges must be correctly noded; that is, they must only meet - * at their endpoints. - * The Polygonizer will still run on incorrectly noded input - * but will not form polygons from incorrectly noded edges. - * - * The Polygonizer reports the follow kinds of errors: - * - * - Dangles - edges which have one or both ends which are - * not incident on another edge endpoint - * - Cut Edges - edges which are connected at both ends but - * which do not form part of polygon - * - Invalid Ring Lines - edges which form rings which are invalid - * (e.g. the component lines contain a self-intersection) - * - * Errors are reported to output parameters "cuts", "dangles" and - * "invalid" (if not-null). Formed polygons are returned as a - * collection. NULL is returned on exception. All returned - * geometries must be destroyed by caller. - * - */ - -extern GEOSGeometry GEOS_DLL *GEOSPolygonize_r(GEOSContextHandle_t handle, - const GEOSGeometry *const geoms[], - unsigned int ngeoms); -extern GEOSGeometry GEOS_DLL *GEOSPolygonizer_getCutEdges_r( - GEOSContextHandle_t handle, - const GEOSGeometry * const geoms[], - unsigned int ngeoms); -extern GEOSGeometry GEOS_DLL *GEOSPolygonize_full_r(GEOSContextHandle_t handle, - const GEOSGeometry* input, GEOSGeometry** cuts, - GEOSGeometry** dangles, GEOSGeometry** invalidRings); - -extern GEOSGeometry GEOS_DLL *GEOSBuildArea_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g); - -extern GEOSGeometry GEOS_DLL *GEOSLineMerge_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSReverse_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSSimplify_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, - double tolerance); -extern GEOSGeometry GEOS_DLL *GEOSTopologyPreserveSimplify_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g, double tolerance); - -/* - * Return all distinct vertices of input geometry as a MULTIPOINT. - * Note that only 2 dimensions of the vertices are considered when - * testing for equality. - */ -extern GEOSGeometry GEOS_DLL *GEOSGeom_extractUniquePoints_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* - * Find paths shared between the two given lineal geometries. - * - * Returns a GEOMETRYCOLLECTION having two elements: - * - first element is a MULTILINESTRING containing shared paths - * having the _same_ direction on both inputs - * - second element is a MULTILINESTRING containing shared paths - * having the _opposite_ direction on the two inputs - * - * Returns NULL on exception - */ -extern GEOSGeometry GEOS_DLL *GEOSSharedPaths_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, const GEOSGeometry* g2); - -/* - * Snap first geometry on to second with given tolerance - * Returns a newly allocated geometry, or NULL on exception - */ -extern GEOSGeometry GEOS_DLL *GEOSSnap_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, const GEOSGeometry* g2, double tolerance); - -/* - * Return a Delaunay triangulation of the vertex of the given geometry - * - * @param g the input geometry whose vertex will be used as "sites" - * @param tolerance optional snapping tolerance to use for improved robustness - * @param onlyEdges if non-zero will return a MULTILINESTRING, otherwise it will - * return a GEOMETRYCOLLECTION containing triangular POLYGONs. - * - * @return a newly allocated geometry, or NULL on exception - */ -extern GEOSGeometry GEOS_DLL * GEOSDelaunayTriangulation_r( - GEOSContextHandle_t handle, - const GEOSGeometry *g, - double tolerance, - int onlyEdges); - -/* - * Returns the Voronoi polygons of a set of Vertices given as input - * - * @param g the input geometry whose vertex will be used as sites. - * @param tolerance snapping tolerance to use for improved robustness - * @param onlyEdges whether to return only edges of the Voronoi cells - * @param env clipping envelope for the returned diagram, automatically - * determined if NULL. - * The diagram will be clipped to the larger - * of this envelope or an envelope surrounding the sites. - * - * @return a newly allocated geometry, or NULL on exception. - */ -extern GEOSGeometry GEOS_DLL * GEOSVoronoiDiagram_r( - GEOSContextHandle_t extHandle, - const GEOSGeometry *g, - const GEOSGeometry *env, - double tolerance, - int onlyEdges); - -/* - * Computes the coordinate where two line segments intersect, if any - * - * @param ax0 x-coordinate of first point in first segment - * @param ay0 y-coordinate of first point in first segment - * @param ax1 x-coordinate of second point in first segment - * @param ay1 y-coordinate of second point in first segment - * @param bx0 x-coordinate of first point in second segment - * @param by0 y-coordinate of first point in second segment - * @param bx1 x-coordinate of second point in second segment - * @param by1 y-coordinate of second point in second segment - * @param cx x-coordinate of intersection point - * @param cy y-coordinate of intersection point - * - * @return 0 on error, 1 on success, -1 if segments do not intersect - */ - -extern int GEOS_DLL GEOSSegmentIntersection_r( - GEOSContextHandle_t extHandle, - double ax0, double ay0, - double ax1, double ay1, - double bx0, double by0, - double bx1, double by1, - double* cx, double* cy); - -/************************************************************************ - * - * Binary predicates - return 2 on exception, 1 on true, 0 on false - * - ***********************************************************************/ - -extern char GEOS_DLL GEOSDisjoint_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSTouches_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSIntersects_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSCrosses_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSWithin_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSContains_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSOverlaps_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSEquals_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSEqualsExact_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2, - double tolerance); -extern char GEOS_DLL GEOSCovers_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSCoveredBy_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); - -/************************************************************************ - * - * Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false - * - ***********************************************************************/ - -/* - * GEOSGeometry ownership is retained by caller - */ -extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g); - -extern void GEOS_DLL GEOSPreparedGeom_destroy_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* g); - -extern char GEOS_DLL GEOSPreparedContains_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedContainsProperly_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedCoveredBy_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedCovers_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedCrosses_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedDisjoint_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedIntersects_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedOverlaps_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedTouches_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedWithin_r(GEOSContextHandle_t handle, - const GEOSPreparedGeometry* pg1, - const GEOSGeometry* g2); - -/************************************************************************ - * - * STRtree functions - * - ***********************************************************************/ - -/* - * GEOSGeometry ownership is retained by caller - */ - -extern GEOSSTRtree GEOS_DLL *GEOSSTRtree_create_r( - GEOSContextHandle_t handle, - size_t nodeCapacity); -extern void GEOS_DLL GEOSSTRtree_insert_r(GEOSContextHandle_t handle, - GEOSSTRtree *tree, - const GEOSGeometry *g, - void *item); -extern void GEOS_DLL GEOSSTRtree_query_r(GEOSContextHandle_t handle, - GEOSSTRtree *tree, - const GEOSGeometry *g, - GEOSQueryCallback callback, - void *userdata); - -extern const GEOSGeometry GEOS_DLL *GEOSSTRtree_nearest_r(GEOSContextHandle_t handle, - GEOSSTRtree *tree, - const GEOSGeometry* geom); - - -extern const void GEOS_DLL *GEOSSTRtree_nearest_generic_r(GEOSContextHandle_t handle, - GEOSSTRtree *tree, - const void* item, - const GEOSGeometry* itemEnvelope, - GEOSDistanceCallback distancefn, - void* userdata); - -extern void GEOS_DLL GEOSSTRtree_iterate_r(GEOSContextHandle_t handle, - GEOSSTRtree *tree, - GEOSQueryCallback callback, - void *userdata); -extern char GEOS_DLL GEOSSTRtree_remove_r(GEOSContextHandle_t handle, - GEOSSTRtree *tree, - const GEOSGeometry *g, - void *item); -extern void GEOS_DLL GEOSSTRtree_destroy_r(GEOSContextHandle_t handle, - GEOSSTRtree *tree); - - -/************************************************************************ - * - * Unary predicate - return 2 on exception, 1 on true, 0 on false - * - ***********************************************************************/ - -extern char GEOS_DLL GEOSisEmpty_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern char GEOS_DLL GEOSisSimple_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern char GEOS_DLL GEOSisRing_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern char GEOS_DLL GEOSHasZ_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -extern char GEOS_DLL GEOSisClosed_r(GEOSContextHandle_t handle, - const GEOSGeometry *g); - -/************************************************************************ - * - * Dimensionally Extended 9 Intersection Model related - * - ***********************************************************************/ - -/* These are for use with GEOSRelateBoundaryNodeRule (flags param) */ -enum GEOSRelateBoundaryNodeRules { - /* MOD2 and OGC are the same rule, and is the default - * used by GEOSRelatePattern - */ - GEOSRELATE_BNR_MOD2=1, - GEOSRELATE_BNR_OGC=1, - GEOSRELATE_BNR_ENDPOINT=2, - GEOSRELATE_BNR_MULTIVALENT_ENDPOINT=3, - GEOSRELATE_BNR_MONOVALENT_ENDPOINT=4 -}; - -/* return 2 on exception, 1 on true, 0 on false */ -extern char GEOS_DLL GEOSRelatePattern_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2, - const char *pat); - -/* return NULL on exception, a string to GEOSFree otherwise */ -extern char GEOS_DLL *GEOSRelate_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2); - -/* return 2 on exception, 1 on true, 0 on false */ -extern char GEOS_DLL GEOSRelatePatternMatch_r(GEOSContextHandle_t handle, - const char *mat, - const char *pat); - -/* return NULL on exception, a string to GEOSFree otherwise */ -extern char GEOS_DLL *GEOSRelateBoundaryNodeRule_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2, - int bnr); - -/************************************************************************ - * - * Validity checking - * - ***********************************************************************/ - -/* These are for use with GEOSisValidDetail (flags param) */ -enum GEOSValidFlags { - GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE=1 -}; - -/* return 2 on exception, 1 on true, 0 on false */ -extern char GEOS_DLL GEOSisValid_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* return NULL on exception, a string to GEOSFree otherwise */ -extern char GEOS_DLL *GEOSisValidReason_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* - * Caller has the responsibility to destroy 'reason' (GEOSFree) - * and 'location' (GEOSGeom_destroy) params - * return 2 on exception, 1 when valid, 0 when invalid - */ -extern char GEOS_DLL GEOSisValidDetail_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, - int flags, - char** reason, - GEOSGeometry** location); - -extern GEOSGeometry GEOS_DLL *GEOSMakeValid_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/************************************************************************ - * - * Geometry info - * - ***********************************************************************/ - -/* Return NULL on exception, result must be freed by caller. */ -extern char GEOS_DLL *GEOSGeomType_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* Return -1 on exception */ -extern int GEOS_DLL GEOSGeomTypeId_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* Return 0 on exception */ -extern int GEOS_DLL GEOSGetSRID_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -extern void GEOS_DLL GEOSSetSRID_r(GEOSContextHandle_t handle, - GEOSGeometry* g, int SRID); - -extern void GEOS_DLL *GEOSGeom_getUserData_r(GEOSContextHandle_t handle, -const GEOSGeometry* g); - -extern void GEOS_DLL GEOSGeom_setUserData_r(GEOSContextHandle_t handle, - GEOSGeometry* g, void* userData); - -/* May be called on all geometries in GEOS 3.x, returns -1 on error and 1 - * for non-multi geometries. Older GEOS versions only accept - * GeometryCollections or Multi* geometries here, and are likely to crash - * when fed simple geometries, so beware if you need compatibility with - * old GEOS versions. - */ -extern int GEOS_DLL GEOSGetNumGeometries_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* - * Return NULL on exception. - * Returned object is a pointer to internal storage: - * it must NOT be destroyed directly. - * Up to GEOS 3.2.0 the input geometry must be a Collection, in - * later version it doesn't matter (getGeometryN(0) for a single will - * return the input). - */ -extern const GEOSGeometry GEOS_DLL *GEOSGetGeometryN_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g, int n); - -/* Return -1 on exception */ -extern int GEOS_DLL GEOSNormalize_r(GEOSContextHandle_t handle, - GEOSGeometry* g); - -/** This option causes #GEOSGeom_setPrecision_r() - * to not attempt at preserving the topology */ -#define GEOS_PREC_NO_TOPO (1<<0) - -/** This option causes #GEOSGeom_setPrecision_r() - * to retain collapsed elements */ -#define GEOS_PREC_KEEP_COLLAPSED (1<<1) - -/** - * Set the geometry's precision, optionally rounding all its - * coordinates to the precision grid (if it changes). - * - * Note that operations will always be performed in the precision - * of the geometry with higher precision (smaller "gridSize"). - * That same precision will be attached to the operation outputs. - * - * @param gridSize size of the precision grid, or 0 for FLOATING - * precision. - * @param flags The bitwise OR of one of more of the - * @ref GEOS_PREC_NO_TOPO "precision options" - * @retuns NULL on exception or a new GEOSGeometry object - * - */ -extern GEOSGeometry GEOS_DLL *GEOSGeom_setPrecision_r( - GEOSContextHandle_t handle, - const GEOSGeometry *g, - double gridSize, int flags); - -/** - * Get a geometry's precision - * - * @return the size of the geometry's precision grid, 0 for FLOATING - * precision or -1 on exception - */ -extern double GEOS_DLL GEOSGeom_getPrecision_r( - GEOSContextHandle_t handle, - const GEOSGeometry *g); - -/* Return -1 on exception */ -extern int GEOS_DLL GEOSGetNumInteriorRings_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* Return -1 on exception, Geometry must be a LineString. */ -extern int GEOS_DLL GEOSGeomGetNumPoints_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* Return 0 on exception, otherwise 1, Geometry must be a Point. */ -extern int GEOS_DLL GEOSGeomGetX_r(GEOSContextHandle_t handle, const GEOSGeometry *g, double *x); -extern int GEOS_DLL GEOSGeomGetY_r(GEOSContextHandle_t handle, const GEOSGeometry *g, double *y); -extern int GEOS_DLL GEOSGeomGetZ_r(GEOSContextHandle_t handle, const GEOSGeometry *g, double *z); - -/* - * Return NULL on exception, Geometry must be a Polygon. - * Returned object is a pointer to internal storage: - * it must NOT be destroyed directly. - */ -extern const GEOSGeometry GEOS_DLL *GEOSGetInteriorRingN_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g, int n); - -/* - * Return NULL on exception, Geometry must be a Polygon. - * Returned object is a pointer to internal storage: - * it must NOT be destroyed directly. - */ -extern const GEOSGeometry GEOS_DLL *GEOSGetExteriorRing_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* Return -1 on exception */ -extern int GEOS_DLL GEOSGetNumCoordinates_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* - * Return NULL on exception. - * Geometry must be a LineString, LinearRing or Point. - */ -extern const GEOSCoordSequence GEOS_DLL *GEOSGeom_getCoordSeq_r( - GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* - * Return 0 on exception (or empty geometry) - */ -extern int GEOS_DLL GEOSGeom_getDimensions_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); - -/* - * Return 2 or 3. - */ -extern int GEOS_DLL GEOSGeom_getCoordinateDimension_r(GEOSContextHandle_t handle, - const GEOSGeometry* g); -/* - * Return 0 on exception - */ -extern int GEOS_DLL GEOSGeom_getXMin_r(GEOSContextHandle_t handle, const GEOSGeometry* g, double* value); -extern int GEOS_DLL GEOSGeom_getYMin_r(GEOSContextHandle_t handle, const GEOSGeometry* g, double* value); -extern int GEOS_DLL GEOSGeom_getXMax_r(GEOSContextHandle_t handle, const GEOSGeometry* g, double* value); -extern int GEOS_DLL GEOSGeom_getYMax_r(GEOSContextHandle_t handle, const GEOSGeometry* g, double* value); - -/* - * Return NULL on exception. - * Must be LineString and must be freed by called. - */ -extern GEOSGeometry GEOS_DLL *GEOSGeomGetPointN_r(GEOSContextHandle_t handle, const GEOSGeometry *g, int n); -extern GEOSGeometry GEOS_DLL *GEOSGeomGetStartPoint_r(GEOSContextHandle_t handle, const GEOSGeometry *g); -extern GEOSGeometry GEOS_DLL *GEOSGeomGetEndPoint_r(GEOSContextHandle_t handle, const GEOSGeometry *g); - -/************************************************************************ - * - * Misc functions - * - ***********************************************************************/ - -/* Return 0 on exception, 1 otherwise */ -extern int GEOS_DLL GEOSArea_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, double *area); -extern int GEOS_DLL GEOSLength_r(GEOSContextHandle_t handle, - const GEOSGeometry* g, double *length); -extern int GEOS_DLL GEOSDistance_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2, double *dist); -extern int GEOS_DLL GEOSDistanceIndexed_r(GEOSContextHandle_t handle, - const GEOSGeometry* g1, - const GEOSGeometry* g2, double *dist); -extern int GEOS_DLL GEOSHausdorffDistance_r(GEOSContextHandle_t handle, - const GEOSGeometry *g1, - const GEOSGeometry *g2, - double *dist); -extern int GEOS_DLL GEOSHausdorffDistanceDensify_r(GEOSContextHandle_t handle, - const GEOSGeometry *g1, - const GEOSGeometry *g2, - double densifyFrac, double *dist); -extern int GEOS_DLL GEOSFrechetDistance_r(GEOSContextHandle_t handle, - const GEOSGeometry *g1, - const GEOSGeometry *g2, - double *dist); -extern int GEOS_DLL GEOSFrechetDistanceDensify_r(GEOSContextHandle_t handle, - const GEOSGeometry *g1, - const GEOSGeometry *g2, - double densifyFrac, double *dist); -extern int GEOS_DLL GEOSGeomGetLength_r(GEOSContextHandle_t handle, - const GEOSGeometry *g, double *length); - -/* Return 0 on exception, the closest points of the two geometries otherwise. - * The first point comes from g1 geometry and the second point comes from g2. - */ -extern GEOSCoordSequence GEOS_DLL *GEOSNearestPoints_r( - GEOSContextHandle_t handle, const GEOSGeometry* g1, const GEOSGeometry* g2); - - -/************************************************************************ - * - * Algorithms - * - ***********************************************************************/ - -/* Walking from A to B: - * return -1 if reaching P takes a counter-clockwise (left) turn - * return 1 if reaching P takes a clockwise (right) turn - * return 0 if P is collinear with A-B - * - * On exceptions, return 2. - * - */ -extern int GEOS_DLL GEOSOrientationIndex_r(GEOSContextHandle_t handle, - double Ax, double Ay, double Bx, double By, double Px, double Py); - - -/************************************************************************ - * - * Reader and Writer APIs - * - ***********************************************************************/ - -typedef struct GEOSWKTReader_t GEOSWKTReader; -typedef struct GEOSWKTWriter_t GEOSWKTWriter; -typedef struct GEOSWKBReader_t GEOSWKBReader; -typedef struct GEOSWKBWriter_t GEOSWKBWriter; - - -/* WKT Reader */ -extern GEOSWKTReader GEOS_DLL *GEOSWKTReader_create_r( - GEOSContextHandle_t handle); -extern void GEOS_DLL GEOSWKTReader_destroy_r(GEOSContextHandle_t handle, - GEOSWKTReader* reader); -extern GEOSGeometry GEOS_DLL *GEOSWKTReader_read_r(GEOSContextHandle_t handle, - GEOSWKTReader* reader, - const char *wkt); - -/* WKT Writer */ -extern GEOSWKTWriter GEOS_DLL *GEOSWKTWriter_create_r( - GEOSContextHandle_t handle); -extern void GEOS_DLL GEOSWKTWriter_destroy_r(GEOSContextHandle_t handle, - GEOSWKTWriter* writer); -extern char GEOS_DLL *GEOSWKTWriter_write_r(GEOSContextHandle_t handle, - GEOSWKTWriter* writer, - const GEOSGeometry* g); -extern void GEOS_DLL GEOSWKTWriter_setTrim_r(GEOSContextHandle_t handle, - GEOSWKTWriter *writer, - char trim); -extern void GEOS_DLL GEOSWKTWriter_setRoundingPrecision_r(GEOSContextHandle_t handle, - GEOSWKTWriter *writer, - int precision); -extern void GEOS_DLL GEOSWKTWriter_setOutputDimension_r(GEOSContextHandle_t handle, - GEOSWKTWriter *writer, - int dim); -extern int GEOS_DLL GEOSWKTWriter_getOutputDimension_r(GEOSContextHandle_t handle, - GEOSWKTWriter *writer); -extern void GEOS_DLL GEOSWKTWriter_setOld3D_r(GEOSContextHandle_t handle, - GEOSWKTWriter *writer, - int useOld3D); - -/* WKB Reader */ -extern GEOSWKBReader GEOS_DLL *GEOSWKBReader_create_r( - GEOSContextHandle_t handle); -extern void GEOS_DLL GEOSWKBReader_destroy_r(GEOSContextHandle_t handle, - GEOSWKBReader* reader); -extern GEOSGeometry GEOS_DLL *GEOSWKBReader_read_r(GEOSContextHandle_t handle, - GEOSWKBReader* reader, - const unsigned char *wkb, - size_t size); -extern GEOSGeometry GEOS_DLL *GEOSWKBReader_readHEX_r( - GEOSContextHandle_t handle, - GEOSWKBReader* reader, - const unsigned char *hex, - size_t size); - -/* WKB Writer */ -extern GEOSWKBWriter GEOS_DLL *GEOSWKBWriter_create_r( - GEOSContextHandle_t handle); -extern void GEOS_DLL GEOSWKBWriter_destroy_r(GEOSContextHandle_t handle, - GEOSWKBWriter* writer); - -/* The caller owns the results for these two methods! */ -extern unsigned char GEOS_DLL *GEOSWKBWriter_write_r( - GEOSContextHandle_t handle, - GEOSWKBWriter* writer, - const GEOSGeometry* g, - size_t *size); -extern unsigned char GEOS_DLL *GEOSWKBWriter_writeHEX_r( - GEOSContextHandle_t handle, - GEOSWKBWriter* writer, - const GEOSGeometry* g, - size_t *size); - -/* - * Specify whether output WKB should be 2d or 3d. - * Return previously set number of dimensions. - */ -extern int GEOS_DLL GEOSWKBWriter_getOutputDimension_r( - GEOSContextHandle_t handle, - const GEOSWKBWriter* writer); -extern void GEOS_DLL GEOSWKBWriter_setOutputDimension_r( - GEOSContextHandle_t handle, - GEOSWKBWriter* writer, int newDimension); - -/* - * Specify whether the WKB byte order is big or little endian. - * The return value is the previous byte order. - */ -extern int GEOS_DLL GEOSWKBWriter_getByteOrder_r(GEOSContextHandle_t handle, - const GEOSWKBWriter* writer); -extern void GEOS_DLL GEOSWKBWriter_setByteOrder_r(GEOSContextHandle_t handle, - GEOSWKBWriter* writer, - int byteOrder); - -/* - * Specify whether SRID values should be output. - */ -extern char GEOS_DLL GEOSWKBWriter_getIncludeSRID_r(GEOSContextHandle_t handle, - const GEOSWKBWriter* writer); -extern void GEOS_DLL GEOSWKBWriter_setIncludeSRID_r(GEOSContextHandle_t handle, - GEOSWKBWriter* writer, const char writeSRID); - - -/* - * Free buffers returned by stuff like GEOSWKBWriter_write(), - * GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(). - */ -extern void GEOS_DLL GEOSFree_r(GEOSContextHandle_t handle, void *buffer); - - -/* External code to GEOS can define GEOS_USE_ONLY_R_API to avoid the */ -/* non _r API to be available */ -#ifndef GEOS_USE_ONLY_R_API - -/************************************************************************ - * - * Initialization, cleanup, version - * - ***********************************************************************/ - -extern void GEOS_DLL initGEOS(GEOSMessageHandler notice_function, - GEOSMessageHandler error_function); -extern void GEOS_DLL finishGEOS(void); - -/************************************************************************ - * - * NOTE - These functions are DEPRECATED. Please use the new Reader and - * writer APIS! - * - ***********************************************************************/ - -extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKT(const char *wkt); -extern char GEOS_DLL *GEOSGeomToWKT(const GEOSGeometry* g); - -/* - * Specify whether output WKB should be 2d or 3d. - * Return previously set number of dimensions. - */ -extern int GEOS_DLL GEOS_getWKBOutputDims(); -extern int GEOS_DLL GEOS_setWKBOutputDims(int newDims); - -/* - * Specify whether the WKB byte order is big or little endian. - * The return value is the previous byte order. - */ -extern int GEOS_DLL GEOS_getWKBByteOrder(); -extern int GEOS_DLL GEOS_setWKBByteOrder(int byteOrder); - -extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKB_buf(const unsigned char *wkb, size_t size); -extern unsigned char GEOS_DLL *GEOSGeomToWKB_buf(const GEOSGeometry* g, size_t *size); - -extern GEOSGeometry GEOS_DLL *GEOSGeomFromHEX_buf(const unsigned char *hex, size_t size); -extern unsigned char GEOS_DLL *GEOSGeomToHEX_buf(const GEOSGeometry* g, size_t *size); - -/************************************************************************ - * - * Coordinate Sequence functions - * - ***********************************************************************/ - -/* - * Create a Coordinate sequence with ``size'' coordinates - * of ``dims'' dimensions. - * Return NULL on exception. - */ -extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_create(unsigned int size, unsigned int dims); - -/* - * Clone a Coordinate Sequence. - * Return NULL on exception. - */ -extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_clone(const GEOSCoordSequence* s); - -/* - * Destroy a Coordinate Sequence. - */ -extern void GEOS_DLL GEOSCoordSeq_destroy(GEOSCoordSequence* s); - -/* - * Set ordinate values in a Coordinate Sequence. - * Return 0 on exception. - */ -extern int GEOS_DLL GEOSCoordSeq_setX(GEOSCoordSequence* s, - unsigned int idx, double val); -extern int GEOS_DLL GEOSCoordSeq_setY(GEOSCoordSequence* s, - unsigned int idx, double val); -extern int GEOS_DLL GEOSCoordSeq_setZ(GEOSCoordSequence* s, - unsigned int idx, double val); -extern int GEOS_DLL GEOSCoordSeq_setOrdinate(GEOSCoordSequence* s, - unsigned int idx, unsigned int dim, double val); - -/* - * Get ordinate values from a Coordinate Sequence. - * Return 0 on exception. - */ -extern int GEOS_DLL GEOSCoordSeq_getX(const GEOSCoordSequence* s, - unsigned int idx, double *val); -extern int GEOS_DLL GEOSCoordSeq_getY(const GEOSCoordSequence* s, - unsigned int idx, double *val); -extern int GEOS_DLL GEOSCoordSeq_getZ(const GEOSCoordSequence* s, - unsigned int idx, double *val); -extern int GEOS_DLL GEOSCoordSeq_getOrdinate(const GEOSCoordSequence* s, - unsigned int idx, unsigned int dim, double *val); -/* - * Get size and dimensions info from a Coordinate Sequence. - * Return 0 on exception. - */ -extern int GEOS_DLL GEOSCoordSeq_getSize(const GEOSCoordSequence* s, - unsigned int *size); -extern int GEOS_DLL GEOSCoordSeq_getDimensions(const GEOSCoordSequence* s, - unsigned int *dims); - -/* - * Check orientation of a CoordinateSequence and set 'is_ccw' to 1 - * if it has counter-clockwise orientation, 0 otherwise. - * Return 0 on exception, 1 on success. - */ -extern int GEOS_DLL GEOSCoordSeq_isCCW(const GEOSCoordSequence* s, char* is_ccw); - -/************************************************************************ - * - * Linear referencing functions -- there are more, but these are - * probably sufficient for most purposes - * - ***********************************************************************/ - -/* - * GEOSGeometry ownership is retained by caller - */ - - -/* Return distance of point 'p' projected on 'g' from origin - * of 'g'. Geometry 'g' must be a lineal geometry */ -extern double GEOS_DLL GEOSProject(const GEOSGeometry *g, - const GEOSGeometry* p); - -/* Return closest point to given distance within geometry - * Geometry must be a LineString */ -extern GEOSGeometry GEOS_DLL *GEOSInterpolate(const GEOSGeometry *g, - double d); - -extern double GEOS_DLL GEOSProjectNormalized(const GEOSGeometry *g, - const GEOSGeometry* p); - -extern GEOSGeometry GEOS_DLL *GEOSInterpolateNormalized(const GEOSGeometry *g, - double d); - -/************************************************************************ - * - * Buffer related functions - * - ***********************************************************************/ - - -/* @return NULL on exception */ -extern GEOSGeometry GEOS_DLL *GEOSBuffer(const GEOSGeometry* g, - double width, int quadsegs); - -/* @return 0 on exception */ -extern GEOSBufferParams GEOS_DLL *GEOSBufferParams_create(); -extern void GEOS_DLL GEOSBufferParams_destroy(GEOSBufferParams* parms); - -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setEndCapStyle( - GEOSBufferParams* p, - int style); - -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setJoinStyle( - GEOSBufferParams* p, - int joinStyle); - -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setMitreLimit( - GEOSBufferParams* p, - double mitreLimit); - -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setQuadrantSegments( - GEOSBufferParams* p, - int quadSegs); - -/* @param singleSided: 1 for single sided, 0 otherwise */ -/* @return 0 on exception */ -extern int GEOS_DLL GEOSBufferParams_setSingleSided( - GEOSBufferParams* p, - int singleSided); - -/* @return NULL on exception */ -extern GEOSGeometry GEOS_DLL *GEOSBufferWithParams( - const GEOSGeometry* g, - const GEOSBufferParams* p, - double width); - -/* These functions return NULL on exception. */ -extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle(const GEOSGeometry* g, - double width, int quadsegs, int endCapStyle, int joinStyle, - double mitreLimit); - -/* These functions return NULL on exception. Only LINESTRINGs are accepted. */ -/* @deprecated in 3.3.0: use GEOSOffsetCurve instead */ -extern GEOSGeometry GEOS_DLL *GEOSSingleSidedBuffer(const GEOSGeometry* g, - double width, int quadsegs, int joinStyle, double mitreLimit, - int leftSide); - -/* - * Only LINESTRINGs are accepted. - * @param width : offset distance. - * negative for right side offset. - * positive for left side offset. - * @return NULL on exception - */ -extern GEOSGeometry GEOS_DLL *GEOSOffsetCurve(const GEOSGeometry* g, - double width, int quadsegs, int joinStyle, double mitreLimit); - -/************************************************************************ - * - * Geometry Constructors. - * GEOSCoordSequence* arguments will become ownership of the returned object. - * All functions return NULL on exception. - * - ***********************************************************************/ - -extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint(GEOSCoordSequence* s); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPoint(); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createLinearRing(GEOSCoordSequence* s); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createLineString(GEOSCoordSequence* s); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyLineString(); - -/* - * Second argument is an array of GEOSGeometry* objects. - * The caller remains owner of the array, but pointed-to - * objects become ownership of the returned GEOSGeometry. - */ -extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPolygon(); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon(GEOSGeometry* shell, - GEOSGeometry** holes, unsigned int nholes); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createCollection(int type, - GEOSGeometry* *geoms, unsigned int ngeoms); -extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyCollection(int type); - -extern GEOSGeometry GEOS_DLL *GEOSGeom_clone(const GEOSGeometry* g); - -/************************************************************************ - * - * Memory management - * - ***********************************************************************/ - -extern void GEOS_DLL GEOSGeom_destroy(GEOSGeometry* g); - -/************************************************************************ - * - * Topology operations - return NULL on exception. - * - ***********************************************************************/ - -extern GEOSGeometry GEOS_DLL *GEOSEnvelope(const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSIntersection(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern GEOSGeometry GEOS_DLL *GEOSConvexHull(const GEOSGeometry* g); - -/* Returns the minimum rotated rectangular POLYGON which encloses the input geometry. The rectangle - * has width equal to the minimum diameter, and a longer length. If the convex hill of the input is - * degenerate (a line or point) a LINESTRING or POINT is returned. The minimum rotated rectangle can - * be used as an extremely generalized representation for the given geometry. - */ -extern GEOSGeometry GEOS_DLL *GEOSMinimumRotatedRectangle(const GEOSGeometry* g); - -/* Returns a LINESTRING geometry which represents the minimum diameter of the geometry. - * The minimum diameter is defined to be the width of the smallest band that - * contains the geometry, where a band is a strip of the plane defined - * by two parallel lines. This can be thought of as the smallest hole that the geometry - * can be moved through, with a single rotation. - */ -extern GEOSGeometry GEOS_DLL *GEOSMinimumWidth(const GEOSGeometry* g); - -/* Computes the minimum clearance of a geometry. The minimum clearance is the smallest amount by which - * a vertex could be move to produce an invalid polygon, a non-simple linestring, or a multipoint with - * repeated points. If a geometry has a minimum clearance of 'eps', it can be said that: - * - * - No two distinct vertices in the geometry are separated by less than 'eps' - * - No vertex is closer than 'eps' to a line segment of which it is not an endpoint. - * - * If the minimum clearance cannot be defined for a geometry (such as with a single point, or a multipoint - * whose points are identical, a value of Infinity will be calculated. - * - * @param g the input geometry - * @param d a double to which the result can be stored - * - * @return 0 if no exception occurred - * 2 if an exception occurred - */ -extern int GEOS_DLL GEOSMinimumClearance(const GEOSGeometry* g, double* d); - -/* Returns a LineString whose endpoints define the minimum clearance of a geometry. - * If the geometry has no minimum clearance, an empty LineString will be returned. - * - * @param g the input geometry - * @return a LineString, or NULL if an exception occurred. - */ -extern GEOSGeometry GEOS_DLL *GEOSMinimumClearanceLine(const GEOSGeometry* g); - -extern GEOSGeometry GEOS_DLL *GEOSDifference(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern GEOSGeometry GEOS_DLL *GEOSSymDifference(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern GEOSGeometry GEOS_DLL *GEOSBoundary(const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSUnion(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern GEOSGeometry GEOS_DLL *GEOSUnaryUnion(const GEOSGeometry* g); - -/* @deprecated in 3.3.0: use GEOSUnaryUnion instead */ -extern GEOSGeometry GEOS_DLL *GEOSUnionCascaded(const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSPointOnSurface(const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSGetCentroid(const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSNode(const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSClipByRect(const GEOSGeometry* g, double xmin, double ymin, double xmax, double ymax); - -/* - * all arguments remain ownership of the caller - * (both Geometries and pointers) - */ -extern GEOSGeometry GEOS_DLL *GEOSPolygonize(const GEOSGeometry * const geoms[], unsigned int ngeoms); -extern GEOSGeometry GEOS_DLL *GEOSPolygonizer_getCutEdges(const GEOSGeometry * const geoms[], unsigned int ngeoms); -/* - * Polygonizes a set of Geometries which contain linework that - * represents the edges of a planar graph. - * - * Any dimension of Geometry is handled - the constituent linework - * is extracted to form the edges. - * - * The edges must be correctly noded; that is, they must only meet - * at their endpoints. - * The Polygonizer will still run on incorrectly noded input - * but will not form polygons from incorrectly noded edges. - * - * The Polygonizer reports the follow kinds of errors: - * - * - Dangles - edges which have one or both ends which are - * not incident on another edge endpoint - * - Cut Edges - edges which are connected at both ends but - * which do not form part of polygon - * - Invalid Ring Lines - edges which form rings which are invalid - * (e.g. the component lines contain a self-intersection) - * - * Errors are reported to output parameters "cuts", "dangles" and - * "invalid" (if not-null). Formed polygons are returned as a - * collection. NULL is returned on exception. All returned - * geometries must be destroyed by caller. - * - */ -extern GEOSGeometry GEOS_DLL *GEOSPolygonize_full(const GEOSGeometry* input, - GEOSGeometry** cuts, GEOSGeometry** dangles, GEOSGeometry** invalid); - -extern GEOSGeometry GEOS_DLL *GEOSBuildArea(const GEOSGeometry* g); - -extern GEOSGeometry GEOS_DLL *GEOSLineMerge(const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSReverse(const GEOSGeometry* g); -extern GEOSGeometry GEOS_DLL *GEOSSimplify(const GEOSGeometry* g, double tolerance); -extern GEOSGeometry GEOS_DLL *GEOSTopologyPreserveSimplify(const GEOSGeometry* g, - double tolerance); - -/* - * Return all distinct vertices of input geometry as a MULTIPOINT. - * Note that only 2 dimensions of the vertices are considered when - * testing for equality. - */ -extern GEOSGeometry GEOS_DLL *GEOSGeom_extractUniquePoints( - const GEOSGeometry* g); - -/* - * Find paths shared between the two given lineal geometries. - * - * Returns a GEOMETRYCOLLECTION having two elements: - * - first element is a MULTILINESTRING containing shared paths - * having the _same_ direction on both inputs - * - second element is a MULTILINESTRING containing shared paths - * having the _opposite_ direction on the two inputs - * - * Returns NULL on exception - */ -extern GEOSGeometry GEOS_DLL *GEOSSharedPaths(const GEOSGeometry* g1, - const GEOSGeometry* g2); - -/* - * Snap first geometry on to second with given tolerance - * Returns a newly allocated geometry, or NULL on exception - */ -extern GEOSGeometry GEOS_DLL *GEOSSnap(const GEOSGeometry* g1, - const GEOSGeometry* g2, double tolerance); - -/* - * Return a Delaunay triangulation of the vertex of the given geometry - * - * @param g the input geometry whose vertex will be used as "sites" - * @param tolerance optional snapping tolerance to use for improved robustness - * @param onlyEdges if non-zero will return a MULTILINESTRING, otherwise it will - * return a GEOMETRYCOLLECTION containing triangular POLYGONs. - * - * @return a newly allocated geometry, or NULL on exception - */ -extern GEOSGeometry GEOS_DLL * GEOSDelaunayTriangulation( - const GEOSGeometry *g, - double tolerance, - int onlyEdges); - -/* - * Returns the Voronoi polygons of a set of Vertices given as input - * - * @param g the input geometry whose vertex will be used as sites. - * @param tolerance snapping tolerance to use for improved robustness - * @param onlyEdges whether to return only edges of the voronoi cells - * @param env clipping envelope for the returned diagram, automatically - * determined if NULL. - * The diagram will be clipped to the larger - * of this envelope or an envelope surrounding the sites. - * - * @return a newly allocated geometry, or NULL on exception. - */ -extern GEOSGeometry GEOS_DLL * GEOSVoronoiDiagram( - const GEOSGeometry *g, - const GEOSGeometry *env, - double tolerance, - int onlyEdges); -/* - * Computes the coordinate where two line segments intersect, if any - * - * @param ax0 x-coordinate of first point in first segment - * @param ay0 y-coordinate of first point in first segment - * @param ax1 x-coordinate of second point in first segment - * @param ay1 y-coordinate of second point in first segment - * @param bx0 x-coordinate of first point in second segment - * @param by0 y-coordinate of first point in second segment - * @param bx1 x-coordinate of second point in second segment - * @param by1 y-coordinate of second point in second segment - * @param cx x-coordinate of intersection point - * @param cy y-coordinate of intersection point - * - * @return 0 on error, 1 on success, -1 if segments do not intersect - */ - -extern int GEOS_DLL GEOSSegmentIntersection( - double ax0, double ay0, - double ax1, double ay1, - double bx0, double by0, - double bx1, double by1, - double* cx, double* cy); - -/************************************************************************ - * - * Binary predicates - return 2 on exception, 1 on true, 0 on false - * - ***********************************************************************/ - -extern char GEOS_DLL GEOSDisjoint(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSTouches(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSIntersects(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSCrosses(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSWithin(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSContains(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSOverlaps(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSEquals(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSCovers(const GEOSGeometry* g1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSCoveredBy(const GEOSGeometry* g1, const GEOSGeometry* g2); - -/** - * Determine pointwise equivalence of two geometries, by checking if each vertex of g2 is - * within tolerance of the corresponding vertex in g1. - * Unlike GEOSEquals, geometries that are topologically equivalent but have different - * representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not - * considered equivalent by GEOSEqualsExact. - * returns 2 on exception, 1 on true, 0 on false - */ -extern char GEOS_DLL GEOSEqualsExact(const GEOSGeometry* g1, const GEOSGeometry* g2, double tolerance); - -/************************************************************************ - * - * Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false - * - ***********************************************************************/ - -/* - * GEOSGeometry ownership is retained by caller - */ -extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare(const GEOSGeometry* g); - -extern void GEOS_DLL GEOSPreparedGeom_destroy(const GEOSPreparedGeometry* g); - -extern char GEOS_DLL GEOSPreparedContains(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedContainsProperly(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedCoveredBy(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedCovers(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedCrosses(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedDisjoint(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedIntersects(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedOverlaps(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedTouches(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); -extern char GEOS_DLL GEOSPreparedWithin(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2); - -/************************************************************************ - * - * STRtree functions - * - ***********************************************************************/ - -/* - * GEOSGeometry ownership is retained by caller - */ - -/* - * Create a new R-tree using the Sort-Tile-Recursive algorithm (STRtree) for two-dimensional - * spatial data. - * - * @param nodeCapacity the maximum number of child nodes that a node may have. The minimum - * recommended capacity value is 4. If unsure, use a default node capacity of 10. - * @return a pointer to the created tree - */ -extern GEOSSTRtree GEOS_DLL *GEOSSTRtree_create(size_t nodeCapacity); - -/* - * Insert an item into an STRtree - * - * @param tree the STRtree in which the item should be inserted - * @param g a GEOSGeometry whose envelope corresponds to the extent of 'item' - * @param item the item to insert into the tree - */ -extern void GEOS_DLL GEOSSTRtree_insert(GEOSSTRtree *tree, - const GEOSGeometry *g, - void *item); - -/* - * Query an STRtree for items intersecting a specified envelope - * - * @param tree the STRtree to search - * @param g a GEOSGeomety from which a query envelope will be extracted - * @param callback a function to be executed for each item in the tree whose envelope intersects - * the envelope of 'g'. The callback function should take two parameters: a void - * pointer representing the located item in the tree, and a void userdata pointer. - * @param userdata an optional pointer to pe passed to 'callback' as an argument - */ -extern void GEOS_DLL GEOSSTRtree_query(GEOSSTRtree *tree, - const GEOSGeometry *g, - GEOSQueryCallback callback, - void *userdata); -/* - * Returns the nearest item in the STRtree to the supplied GEOSGeometry. - * All items in the tree MUST be of type GEOSGeometry. If this is not the case, use - * GEOSSTRtree_nearest_generic instead. -* - * @param tree the STRtree to search - * @param geom the geometry with which the tree should be queried - * @return a const pointer to the nearest GEOSGeometry in the tree to 'geom', or NULL in - * case of exception - */ -extern const GEOSGeometry GEOS_DLL *GEOSSTRtree_nearest(GEOSSTRtree *tree, const GEOSGeometry* geom); - -/* - * Returns the nearest item in the STRtree to the supplied item - * - * @param tree the STRtree to search - * @param item the item with which the tree should be queried - * @param itemEnvelope a GEOSGeometry having the bounding box of 'item' - * @param distancefn a function that can compute the distance between two items - * in the STRtree. The function should return zero in case of error, - * and should store the computed distance to the location pointed to by - * the 'distance' argument. The computed distance between two items - * must not exceed the Cartesian distance between their envelopes. - * @param userdata optional pointer to arbitrary data; will be passed to distancefn - * each time it is called. - * @return a const pointer to the nearest item in the tree to 'item', or NULL in - * case of exception - */ -extern const void GEOS_DLL *GEOSSTRtree_nearest_generic(GEOSSTRtree *tree, - const void* item, - const GEOSGeometry* itemEnvelope, - GEOSDistanceCallback distancefn, - void* userdata); -/* - * Iterates over all items in the STRtree - * - * @param tree the STRtree over which to iterate - * @param callback a function to be executed for each item in the tree. - */ -extern void GEOS_DLL GEOSSTRtree_iterate(GEOSSTRtree *tree, - GEOSQueryCallback callback, - void *userdata); - -/* - * Removes an item from the STRtree - * - * @param tree the STRtree from which to remove an item - * @param g the envelope of the item to remove - * @param the item to remove - * @return 0 if the item was not removed; - * 1 if the item was removed; - * 2 if an exception occurred - */ -extern char GEOS_DLL GEOSSTRtree_remove(GEOSSTRtree *tree, - const GEOSGeometry *g, - void *item); -extern void GEOS_DLL GEOSSTRtree_destroy(GEOSSTRtree *tree); - - -/************************************************************************ - * - * Unary predicate - return 2 on exception, 1 on true, 0 on false - * - ***********************************************************************/ - -extern char GEOS_DLL GEOSisEmpty(const GEOSGeometry* g); -extern char GEOS_DLL GEOSisSimple(const GEOSGeometry* g); -extern char GEOS_DLL GEOSisRing(const GEOSGeometry* g); -extern char GEOS_DLL GEOSHasZ(const GEOSGeometry* g); -extern char GEOS_DLL GEOSisClosed(const GEOSGeometry *g); - -/************************************************************************ - * - * Dimensionally Extended 9 Intersection Model related - * - ***********************************************************************/ - -/* return 2 on exception, 1 on true, 0 on false */ -extern char GEOS_DLL GEOSRelatePattern(const GEOSGeometry* g1, const GEOSGeometry* g2, const char *pat); - -/* return NULL on exception, a string to GEOSFree otherwise */ -extern char GEOS_DLL *GEOSRelate(const GEOSGeometry* g1, const GEOSGeometry* g2); - -/* return 2 on exception, 1 on true, 0 on false */ -extern char GEOS_DLL GEOSRelatePatternMatch(const char *mat, const char *pat); - -/* return NULL on exception, a string to GEOSFree otherwise */ -extern char GEOS_DLL *GEOSRelateBoundaryNodeRule(const GEOSGeometry* g1, - const GEOSGeometry* g2, - int bnr); - -/************************************************************************ - * - * Validity checking - * - ***********************************************************************/ - -/* return 2 on exception, 1 on true, 0 on false */ -extern char GEOS_DLL GEOSisValid(const GEOSGeometry* g); - -/* return NULL on exception, a string to GEOSFree otherwise */ -extern char GEOS_DLL *GEOSisValidReason(const GEOSGeometry *g); -/* - * Caller has the responsibility to destroy 'reason' (GEOSFree) - * and 'location' (GEOSGeom_destroy) params - * return 2 on exception, 1 when valid, 0 when invalid - * Use enum GEOSValidFlags values for the flags param. - */ -extern char GEOS_DLL GEOSisValidDetail(const GEOSGeometry* g, - int flags, - char** reason, GEOSGeometry** location); - -extern GEOSGeometry GEOS_DLL *GEOSMakeValid(const GEOSGeometry* g); - -/************************************************************************ - * - * Geometry info - * - ***********************************************************************/ - -/* Return NULL on exception, result must be freed by caller. */ -extern char GEOS_DLL *GEOSGeomType(const GEOSGeometry* g); - -/* Return -1 on exception */ -extern int GEOS_DLL GEOSGeomTypeId(const GEOSGeometry* g); - -/* Return 0 on exception */ -extern int GEOS_DLL GEOSGetSRID(const GEOSGeometry* g); - -extern void GEOS_DLL GEOSSetSRID(GEOSGeometry* g, int SRID); - -extern void GEOS_DLL *GEOSGeom_getUserData(const GEOSGeometry* g); - -extern void GEOS_DLL GEOSGeom_setUserData(GEOSGeometry* g, void* userData); - - -/* May be called on all geometries in GEOS 3.x, returns -1 on error and 1 - * for non-multi geometries. Older GEOS versions only accept - * GeometryCollections or Multi* geometries here, and are likely to crash - * when fed simple geometries, so beware if you need compatibility with - * old GEOS versions. - */ -extern int GEOS_DLL GEOSGetNumGeometries(const GEOSGeometry* g); - -/* - * Return NULL on exception. - * Returned object is a pointer to internal storage: - * it must NOT be destroyed directly. - * Up to GEOS 3.2.0 the input geometry must be a Collection, in - * later version it doesn't matter (getGeometryN(0) for a single will - * return the input). - */ -extern const GEOSGeometry GEOS_DLL *GEOSGetGeometryN(const GEOSGeometry* g, int n); - -/* Return -1 on exception */ -extern int GEOS_DLL GEOSNormalize(GEOSGeometry* g); - -/* Return NULL on exception */ -extern GEOSGeometry GEOS_DLL *GEOSGeom_setPrecision( - const GEOSGeometry *g, double gridSize, int flags); - -/* Return -1 on exception */ -extern double GEOS_DLL GEOSGeom_getPrecision(const GEOSGeometry *g); - -/* Return -1 on exception */ -extern int GEOS_DLL GEOSGetNumInteriorRings(const GEOSGeometry* g); - -/* Return -1 on exception, Geometry must be a LineString. */ -extern int GEOS_DLL GEOSGeomGetNumPoints(const GEOSGeometry* g); - -/* Return 0 on exception, otherwise 1, Geometry must be a Point. */ -extern int GEOS_DLL GEOSGeomGetX(const GEOSGeometry *g, double *x); -extern int GEOS_DLL GEOSGeomGetY(const GEOSGeometry *g, double *y); -extern int GEOS_DLL GEOSGeomGetZ(const GEOSGeometry *g, double *z); - -/* - * Return NULL on exception, Geometry must be a Polygon. - * Returned object is a pointer to internal storage: - * it must NOT be destroyed directly. - */ -extern const GEOSGeometry GEOS_DLL *GEOSGetInteriorRingN(const GEOSGeometry* g, int n); - -/* - * Return NULL on exception, Geometry must be a Polygon. - * Returned object is a pointer to internal storage: - * it must NOT be destroyed directly. - */ -extern const GEOSGeometry GEOS_DLL *GEOSGetExteriorRing(const GEOSGeometry* g); - -/* Return -1 on exception */ -extern int GEOS_DLL GEOSGetNumCoordinates(const GEOSGeometry* g); - -/* - * Return NULL on exception. - * Geometry must be a LineString, LinearRing or Point. - */ -extern const GEOSCoordSequence GEOS_DLL *GEOSGeom_getCoordSeq(const GEOSGeometry* g); - -/* - * Return 0 on exception (or empty geometry) - */ -extern int GEOS_DLL GEOSGeom_getDimensions(const GEOSGeometry* g); - -/* - * Return 2 or 3. - */ -extern int GEOS_DLL GEOSGeom_getCoordinateDimension(const GEOSGeometry* g); - -/* - * Return 0 on exception - */ -extern int GEOS_DLL GEOSGeom_getXMin(const GEOSGeometry* g, double* value); -extern int GEOS_DLL GEOSGeom_getYMin(const GEOSGeometry* g, double* value); -extern int GEOS_DLL GEOSGeom_getXMax(const GEOSGeometry* g, double* value); -extern int GEOS_DLL GEOSGeom_getYMax(const GEOSGeometry* g, double* value); - -/* - * Return NULL on exception. - * Must be LineString and must be freed by called. - */ -extern GEOSGeometry GEOS_DLL *GEOSGeomGetPointN(const GEOSGeometry *g, int n); -extern GEOSGeometry GEOS_DLL *GEOSGeomGetStartPoint(const GEOSGeometry *g); -extern GEOSGeometry GEOS_DLL *GEOSGeomGetEndPoint(const GEOSGeometry *g); - -/************************************************************************ - * - * Misc functions - * - ***********************************************************************/ - -/* Return 0 on exception, 1 otherwise */ -extern int GEOS_DLL GEOSArea(const GEOSGeometry* g, double *area); -extern int GEOS_DLL GEOSLength(const GEOSGeometry* g, double *length); -extern int GEOS_DLL GEOSDistance(const GEOSGeometry* g1, const GEOSGeometry* g2, - double *dist); -extern int GEOS_DLL GEOSDistanceIndexed(const GEOSGeometry* g1, const GEOSGeometry* g2, - double *dist); -extern int GEOS_DLL GEOSHausdorffDistance(const GEOSGeometry *g1, - const GEOSGeometry *g2, double *dist); -extern int GEOS_DLL GEOSHausdorffDistanceDensify(const GEOSGeometry *g1, - const GEOSGeometry *g2, double densifyFrac, double *dist); -extern int GEOS_DLL GEOSFrechetDistance(const GEOSGeometry *g1, - const GEOSGeometry *g2, double *dist); -extern int GEOS_DLL GEOSFrechetDistanceDensify(const GEOSGeometry *g1, - const GEOSGeometry *g2, double densifyFrac, double *dist); -extern int GEOS_DLL GEOSGeomGetLength(const GEOSGeometry *g, double *length); - -/* Return 0 on exception, the closest points of the two geometries otherwise. - * The first point comes from g1 geometry and the second point comes from g2. - */ -extern GEOSCoordSequence GEOS_DLL *GEOSNearestPoints( - const GEOSGeometry* g1, const GEOSGeometry* g2); - - -/************************************************************************ - * - * Algorithms - * - ***********************************************************************/ - -/* Walking from A to B: - * return -1 if reaching P takes a counter-clockwise (left) turn - * return 1 if reaching P takes a clockwise (right) turn - * return 0 if P is collinear with A-B - * - * On exceptions, return 2. - * - */ -extern int GEOS_DLL GEOSOrientationIndex(double Ax, double Ay, double Bx, double By, - double Px, double Py); - -/************************************************************************ - * - * Reader and Writer APIs - * - ***********************************************************************/ - -/* WKT Reader */ -extern GEOSWKTReader GEOS_DLL *GEOSWKTReader_create(); -extern void GEOS_DLL GEOSWKTReader_destroy(GEOSWKTReader* reader); -extern GEOSGeometry GEOS_DLL *GEOSWKTReader_read(GEOSWKTReader* reader, const char *wkt); - -/* WKT Writer */ -extern GEOSWKTWriter GEOS_DLL *GEOSWKTWriter_create(); -extern void GEOS_DLL GEOSWKTWriter_destroy(GEOSWKTWriter* writer); -extern char GEOS_DLL *GEOSWKTWriter_write(GEOSWKTWriter* writer, const GEOSGeometry* g); -extern void GEOS_DLL GEOSWKTWriter_setTrim(GEOSWKTWriter *writer, char trim); -extern void GEOS_DLL GEOSWKTWriter_setRoundingPrecision(GEOSWKTWriter *writer, int precision); -extern void GEOS_DLL GEOSWKTWriter_setOutputDimension(GEOSWKTWriter *writer, int dim); -extern int GEOS_DLL GEOSWKTWriter_getOutputDimension(GEOSWKTWriter *writer); -extern void GEOS_DLL GEOSWKTWriter_setOld3D(GEOSWKTWriter *writer, int useOld3D); - -/* WKB Reader */ -extern GEOSWKBReader GEOS_DLL *GEOSWKBReader_create(); -extern void GEOS_DLL GEOSWKBReader_destroy(GEOSWKBReader* reader); -extern GEOSGeometry GEOS_DLL *GEOSWKBReader_read(GEOSWKBReader* reader, const unsigned char *wkb, size_t size); -extern GEOSGeometry GEOS_DLL *GEOSWKBReader_readHEX(GEOSWKBReader* reader, const unsigned char *hex, size_t size); - -/* WKB Writer */ -extern GEOSWKBWriter GEOS_DLL *GEOSWKBWriter_create(); -extern void GEOS_DLL GEOSWKBWriter_destroy(GEOSWKBWriter* writer); - -/* The caller owns the results for these two methods! */ -extern unsigned char GEOS_DLL *GEOSWKBWriter_write(GEOSWKBWriter* writer, const GEOSGeometry* g, size_t *size); -extern unsigned char GEOS_DLL *GEOSWKBWriter_writeHEX(GEOSWKBWriter* writer, const GEOSGeometry* g, size_t *size); - -/* - * Specify whether output WKB should be 2d or 3d. - * Return previously set number of dimensions. - */ -extern int GEOS_DLL GEOSWKBWriter_getOutputDimension(const GEOSWKBWriter* writer); -extern void GEOS_DLL GEOSWKBWriter_setOutputDimension(GEOSWKBWriter* writer, int newDimension); - -/* - * Specify whether the WKB byte order is big or little endian. - * The return value is the previous byte order. - */ -extern int GEOS_DLL GEOSWKBWriter_getByteOrder(const GEOSWKBWriter* writer); -extern void GEOS_DLL GEOSWKBWriter_setByteOrder(GEOSWKBWriter* writer, int byteOrder); - -/* - * Specify whether SRID values should be output. - */ -extern char GEOS_DLL GEOSWKBWriter_getIncludeSRID(const GEOSWKBWriter* writer); -extern void GEOS_DLL GEOSWKBWriter_setIncludeSRID(GEOSWKBWriter* writer, const char writeSRID); - -/* - * Free buffers returned by stuff like GEOSWKBWriter_write(), - * GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(). - */ -extern void GEOS_DLL GEOSFree(void *buffer); - -#endif /* #ifndef GEOS_USE_ONLY_R_API */ - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* #ifndef GEOS_C_H_INCLUDED */ - diff --git a/sys/geos-src/build.rs b/sys/geos-src/build.rs index 19d4805..1f0a704 100644 --- a/sys/geos-src/build.rs +++ b/sys/geos-src/build.rs @@ -6,6 +6,7 @@ fn main() { .define("BUILD_BENCHMARKS", "OFF") // BUILD_TESTING may need to be set ON for GEOS 3.8.x / 3.9.x due to CMake issues .define("BUILD_TESTING", "OFF") + .define("GEOS_ENABLE_TESTS", "OFF") // GEOS <= 3.7 .define("BUILD_DOCUMENTATION", "OFF") .define("CMAKE_INSTALL_LIBDIR", "lib") .define("BUILD_SHARED_LIBS", "OFF") // GEOS >= 3.8 diff --git a/sys/prebuilt-bindings/geos_3.10.rs b/sys/prebuilt-bindings/geos_3.10.rs new file mode 100644 index 0000000..4ffcdbd --- /dev/null +++ b/sys/prebuilt-bindings/geos_3.10.rs @@ -0,0 +1,4555 @@ +/* automatically generated by rust-bindgen 0.60.1 */ + +pub const GEOS_VERSION_MAJOR: u32 = 3; +pub const GEOS_VERSION_MINOR: u32 = 10; +pub const GEOS_VERSION_PATCH: u32 = 3; +pub const GEOS_VERSION: &[u8; 7usize] = b"3.10.3\0"; +pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.18.0\0"; +pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; +pub const GEOS_CAPI_VERSION_MINOR: u32 = 16; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 1; +pub const GEOS_CAPI_VERSION: &[u8; 19usize] = b"3.10.3-CAPI-1.16.1\0"; +pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; +pub const GEOS_CAPI_LAST_INTERFACE: u32 = 17; +pub type wchar_t = libc::c_int; +pub type max_align_t = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSContextHandle_HS { + _unused: [u8; 0], +} +#[doc = " Type returned by GEOS_init_r(), for use in multi-threaded"] +#[doc = " applications."] +#[doc = ""] +#[doc = " There should be only one GEOSContextHandle_t per thread."] +pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; +#[doc = " Callback function for passing GEOS error messages to parent process."] +#[doc = ""] +#[doc = " Set the GEOSMessageHandler for error and notice messages in \\ref initGEOS"] +#[doc = " for single-threaded programs, or using \\ref initGEOS_r for threaded"] +#[doc = " programs"] +#[doc = ""] +#[doc = " \\param fmt the message format template"] +pub type GEOSMessageHandler = + ::std::option::Option; +#[doc = " A GEOS message handler function."] +#[doc = ""] +#[doc = " \\param message the message contents"] +#[doc = " \\param userdata the user data pointer that was passed to GEOS when"] +#[doc = " registering this message handler."] +#[doc = ""] +#[doc = " \\see GEOSContext_setErrorMessageHandler"] +#[doc = " \\see GEOSContext_setNoticeMessageHandler"] +pub type GEOSMessageHandler_r = ::std::option::Option< + unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeom_t { + _unused: [u8; 0], +} +#[doc = " Geometry generic type. Geometry can be a point, linestring, polygon,"] +#[doc = " multipoint, multilinestring, multipolygon, or geometrycollection."] +#[doc = " Geometry type can be read with \\ref GEOSGeomTypeId. Most functions"] +#[doc = " in GEOS either have GEOSGeometry* as a parameter or a return type."] +#[doc = " \\see GEOSGeom_createPoint"] +#[doc = " \\see GEOSGeom_createLineString"] +#[doc = " \\see GEOSGeom_createPolygon"] +#[doc = " \\see GEOSGeom_createCollection"] +#[doc = " \\see GEOSGeom_destroy"] +pub type GEOSGeometry = GEOSGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSPrepGeom_t { + _unused: [u8; 0], +} +#[doc = " Prepared geometry type."] +#[doc = " \\see GEOSPrepare()"] +#[doc = " \\see GEOSPreparedGeom_destroy()"] +pub type GEOSPreparedGeometry = GEOSPrepGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSCoordSeq_t { + _unused: [u8; 0], +} +#[doc = " Coordinate sequence."] +#[doc = " \\see GEOSCoordSeq_create()"] +#[doc = " \\see GEOSCoordSeq_destroy()"] +pub type GEOSCoordSequence = GEOSCoordSeq_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSSTRtree_t { + _unused: [u8; 0], +} +#[doc = " STRTree index."] +#[doc = " \\see GEOSSTRtree_create()"] +#[doc = " \\see GEOSSTRtree_destroy()"] +pub type GEOSSTRtree = GEOSSTRtree_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSBufParams_t { + _unused: [u8; 0], +} +#[doc = " Parameter object for buffering."] +#[doc = " \\see GEOSBufferParams_create()"] +#[doc = " \\see GEOSBufferParams_destroy()"] +pub type GEOSBufferParams = GEOSBufParams_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSMakeValidParams_t { + _unused: [u8; 0], +} +#[doc = " Parameter object for validity enforcement."] +#[doc = " \\see GEOSMakeValidParams_create()"] +#[doc = " \\see GEOSMakeValidParams_destroy()"] +pub type GEOSMakeValidParams = GEOSMakeValidParams_t; +#[doc = " \\cond"] +pub type GEOSGeom = *mut GEOSGeometry; +pub type GEOSCoordSeq = *mut GEOSCoordSequence; +#[doc = " Point"] +pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; +#[doc = " Linestring"] +pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; +#[doc = " Linear ring, used within polygons"] +pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; +#[doc = " Polygon"] +pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; +#[doc = " Multipoint, a homogeneous collection of points"] +pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; +#[doc = " Multilinestring, a homogeneous collection of linestrings"] +pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; +#[doc = " Multipolygon, a homogeneous collection of polygons"] +pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; +#[doc = " Geometry collection, a heterogeneous collection of geometry"] +pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; +#[doc = " Geometry type number, used by functions returning or"] +#[doc = " consuming geometry types."] +#[doc = ""] +#[doc = " \\see GEOSGeomType"] +#[doc = " \\see GEOSGeomTypeId"] +pub type GEOSGeomTypes = libc::c_uint; +#[doc = " Big Endian"] +pub const GEOSWKBByteOrders_GEOS_WKB_XDR: GEOSWKBByteOrders = 0; +#[doc = " Little Endian"] +pub const GEOSWKBByteOrders_GEOS_WKB_NDR: GEOSWKBByteOrders = 1; +#[doc = " Well-known binary byte orders used when"] +#[doc = " writing to WKB."] +#[doc = ""] +#[doc = " \\see GEOSWKBWriter_setByteOrder"] +pub type GEOSWKBByteOrders = libc::c_uint; +#[doc = " Extended"] +pub const GEOSWKBFlavors_GEOS_WKB_EXTENDED: GEOSWKBFlavors = 1; +#[doc = " ISO"] +pub const GEOSWKBFlavors_GEOS_WKB_ISO: GEOSWKBFlavors = 2; +#[doc = " Well-known binary flavors to use"] +#[doc = " when writing to WKB. ISO flavour is"] +#[doc = " more standard. Extended flavour supports"] +#[doc = " 3D and SRID embedding. GEOS reads both"] +#[doc = " transparently."] +#[doc = ""] +#[doc = " \\see GEOSWKBWriter_setFlavor"] +pub type GEOSWKBFlavors = libc::c_uint; +#[doc = " Callback function for use in spatial index search calls. Pass into"] +#[doc = " the query function and handle query results as the index"] +#[doc = " returns them."] +#[doc = ""] +#[doc = " \\see GEOSSTRtree_query"] +pub type GEOSQueryCallback = ::std::option::Option< + unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), +>; +#[doc = " Callback function for use in spatial index nearest neighbor calculations."] +#[doc = " Allows custom distance to be calculated between items in the"] +#[doc = " index. Is passed two items, and sets the calculated distance"] +#[doc = " between the items into the distance pointer. Extra data for the"] +#[doc = " calculation can be passed via the userdata."] +#[doc = ""] +#[doc = " \\param item1 first of the pair of items to calculate distance between"] +#[doc = " \\param item2 second of the pair of items to calculate distance between"] +#[doc = " \\param distance the distance between the items here"] +#[doc = " \\param userdata extra data for the calculation"] +#[doc = ""] +#[doc = " \\return zero if distance calculation succeeded, non-zero otherwise"] +#[doc = ""] +#[doc = " \\see GEOSSTRtree_nearest_generic"] +#[doc = " \\see GEOSSTRtree_iterate"] +pub type GEOSDistanceCallback = ::std::option::Option< + unsafe extern "C" fn( + item1: *const libc::c_void, + item2: *const libc::c_void, + distance: *mut f64, + userdata: *mut libc::c_void, + ) -> libc::c_int, +>; +#[doc = " Callback function for use in interruption. The callback will be invoked _before_ checking for"] +#[doc = " interruption, so can be used to request it."] +#[doc = ""] +#[doc = " \\see GEOS_interruptRegisterCallback"] +#[doc = " \\see GEOS_interruptRequest"] +#[doc = " \\see GEOS_interruptCancel"] +pub type GEOSInterruptCallback = ::std::option::Option; +extern "C" { + #[doc = " Register a function to be called when processing is interrupted."] + #[doc = " \\param cb Callback function to invoke"] + #[doc = " \\return the previously configured callback"] + #[doc = " \\see GEOSInterruptCallback"] + pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; +} +extern "C" { + #[doc = " Request safe interruption of operations"] + pub fn GEOS_interruptRequest(); +} +extern "C" { + #[doc = " Cancel a pending interruption request"] + pub fn GEOS_interruptCancel(); +} +extern "C" { + #[doc = " Initialize a context for this thread. Pass this context into"] + #[doc = " your other calls of `*_r` functions."] + #[doc = " \\return a GEOS context for this thread"] + pub fn GEOS_init_r() -> GEOSContextHandle_t; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSContextHandle_t"] + #[doc = " when you are finished calling GEOS functions."] + #[doc = " \\param handle to be freed"] + pub fn GEOS_finish_r(handle: GEOSContextHandle_t); +} +extern "C" { + #[doc = " Set the notice handler callback function for run-time notice messages."] + #[doc = " \\param extHandle the context returned by \\ref GEOS_init_r."] + #[doc = " \\param nf the handler callback"] + #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] + pub fn GEOSContext_setNoticeHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + #[doc = " Set the notice handler callback function for run-time error messages."] + #[doc = " \\param extHandle the GEOS context from \\ref GEOS_init_r"] + #[doc = " \\param ef the handler callback"] + #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] + pub fn GEOSContext_setErrorHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + #[doc = " Sets a notice message handler on the given GEOS context."] + #[doc = " \\param extHandle the GEOS context from \\ref GEOS_init_r"] + #[doc = " \\param nf the message handler"] + #[doc = " \\param userData optional user data pointer that will be passed to the message handler"] + #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] + pub fn GEOSContext_setNoticeMessageHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + #[doc = " Sets an error message handler on the given GEOS context."] + #[doc = ""] + #[doc = " \\param extHandle the GEOS context"] + #[doc = " \\param ef the message handler"] + #[doc = " \\param userData optional user data pointer that will be passed to the message handler"] + #[doc = ""] + #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] + pub fn GEOSContext_setErrorMessageHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_create"] + pub fn GEOSCoordSeq_create_r( + handle: GEOSContextHandle_t, + size: libc::c_uint, + dims: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_copyFromBuffer"] + pub fn GEOSCoordSeq_copyFromBuffer_r( + handle: GEOSContextHandle_t, + buf: *const f64, + size: libc::c_uint, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_copyFromArrays"] + pub fn GEOSCoordSeq_copyFromArrays_r( + handle: GEOSContextHandle_t, + x: *const f64, + y: *const f64, + z: *const f64, + m: *const f64, + size: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_copyToBuffer"] + pub fn GEOSCoordSeq_copyToBuffer_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + buf: *mut f64, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_copyToArrays"] + pub fn GEOSCoordSeq_copyToArrays_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + x: *mut f64, + y: *mut f64, + z: *mut f64, + m: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_clone"] + pub fn GEOSCoordSeq_clone_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_destroy"] + pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setX"] + pub fn GEOSCoordSeq_setX_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setY"] + pub fn GEOSCoordSeq_setY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setZ"] + pub fn GEOSCoordSeq_setZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setXY"] + pub fn GEOSCoordSeq_setXY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setXYZ"] + pub fn GEOSCoordSeq_setXYZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + z: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setOrdinate"] + pub fn GEOSCoordSeq_setOrdinate_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getX"] + pub fn GEOSCoordSeq_getX_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getY"] + pub fn GEOSCoordSeq_getY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getZ"] + pub fn GEOSCoordSeq_getZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getXY"] + pub fn GEOSCoordSeq_getXY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getXYZ"] + pub fn GEOSCoordSeq_getXYZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getOrdinate"] + pub fn GEOSCoordSeq_getOrdinate_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getSize"] + pub fn GEOSCoordSeq_getSize_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getDimensions"] + pub fn GEOSCoordSeq_getDimensions_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_isCCW"] + pub fn GEOSCoordSeq_isCCW_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSProject"] + pub fn GEOSProject_r( + handle: GEOSContextHandle_t, + line: *const GEOSGeometry, + point: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + #[doc = " \\see GEOSInterpolate"] + pub fn GEOSInterpolate_r( + handle: GEOSContextHandle_t, + line: *const GEOSGeometry, + d: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSProjectNormalized"] + pub fn GEOSProjectNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + #[doc = " \\see GEOSInterpolateNormalized"] + pub fn GEOSInterpolateNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSBuffer"] + pub fn GEOSBuffer_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +#[doc = " End is rounded, with end point of original line in the centre of the round cap."] +pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; +#[doc = " End is flat, with end point of original line at the end of the buffer"] +pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; +#[doc = " End is flat, with end point of original line in the middle of a square enclosing that point"] +pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; +#[doc = " Cap styles control the ends of buffered lines."] +#[doc = " \\see GEOSBuffer"] +pub type GEOSBufCapStyles = libc::c_uint; +#[doc = " Join is rounded, essentially each line is terminated"] +#[doc = " in a round cap. Form round corner."] +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; +#[doc = " Join is flat, with line between buffer edges,"] +#[doc = " through the join point. Forms flat corner."] +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; +#[doc = " Join is the point at which the two buffer edges intersect."] +#[doc = " Forms sharp corner."] +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; +#[doc = " Join styles control the buffer shape at bends in a line."] +#[doc = " \\see GEOSBuffer"] +pub type GEOSBufJoinStyles = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSBufferParams_create"] + pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_destroy"] + pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setEndCapStyle"] + pub fn GEOSBufferParams_setEndCapStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setJoinStyle"] + pub fn GEOSBufferParams_setJoinStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setMitreLimit"] + pub fn GEOSBufferParams_setMitreLimit_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + mitreLimit: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setQuadrantSegments"] + pub fn GEOSBufferParams_setQuadrantSegments_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setSingleSided"] + pub fn GEOSBufferParams_setSingleSided_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferWithParams"] + pub fn GEOSBufferWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSBufferWithStyle"] + pub fn GEOSBufferWithStyle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSDensify"] + pub fn GEOSDensify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSOffsetCurve"] + pub fn GEOSOffsetCurve_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createPoint"] + pub fn GEOSGeom_createPoint_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createPointFromXY"] + pub fn GEOSGeom_createPointFromXY_r( + handle: GEOSContextHandle_t, + x: f64, + y: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createEmptyPoint"] + pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createLinearRing"] + pub fn GEOSGeom_createLinearRing_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createLineString"] + pub fn GEOSGeom_createLineString_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createEmptyLineString"] + pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createEmptyPolygon"] + pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createPolygon"] + pub fn GEOSGeom_createPolygon_r( + handle: GEOSContextHandle_t, + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createCollection"] + pub fn GEOSGeom_createCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createEmptyCollection"] + pub fn GEOSGeom_createEmptyCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_clone"] + pub fn GEOSGeom_clone_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_destroy"] + pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " \\see GEOSEnvelope"] + pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSIntersection"] + pub fn GEOSIntersection_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSIntersectionPrec"] + pub fn GEOSIntersectionPrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSConvexHull"] + pub fn GEOSConvexHull_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumRotatedRectangle"] + pub fn GEOSMinimumRotatedRectangle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMaximumInscribedCircle"] + pub fn GEOSMaximumInscribedCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSLargestEmptyCircle"] + pub fn GEOSLargestEmptyCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + boundary: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumWidth"] + pub fn GEOSMinimumWidth_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumClearanceLine"] + pub fn GEOSMinimumClearanceLine_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumClearance"] + pub fn GEOSMinimumClearance_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + distance: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSDifference"] + pub fn GEOSDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSDifferencePrec"] + pub fn GEOSDifferencePrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSymDifference"] + pub fn GEOSSymDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSymDifferencePrec"] + pub fn GEOSSymDifferencePrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSBoundary"] + pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSUnion"] + pub fn GEOSUnion_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSUnionPrec"] + pub fn GEOSUnionPrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSUnaryUnion"] + pub fn GEOSUnaryUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSUnaryUnionPrec"] + pub fn GEOSUnaryUnionPrec_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSCoverageUnion"] + pub fn GEOSCoverageUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPointOnSurface"] + pub fn GEOSPointOnSurface_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGetCentroid"] + pub fn GEOSGetCentroid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumBoundingCircle"] + pub fn GEOSMinimumBoundingCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + radius: *mut f64, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSNode"] + pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSClipByRect"] + pub fn GEOSClipByRect_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonize"] + pub fn GEOSPolygonize_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonize_valid"] + pub fn GEOSPolygonize_valid_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngems: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonizer_getCutEdges"] + pub fn GEOSPolygonizer_getCutEdges_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonize_full"] + pub fn GEOSPolygonize_full_r( + handle: GEOSContextHandle_t, + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalidRings: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSBuildArea"] + pub fn GEOSBuildArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSLineMerge"] + pub fn GEOSLineMerge_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSReverse"] + pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSimplify"] + pub fn GEOSSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSTopologyPreserveSimplify"] + pub fn GEOSTopologyPreserveSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_extractUniquePoints"] + pub fn GEOSGeom_extractUniquePoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSharedPaths"] + pub fn GEOSSharedPaths_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSnap"] + pub fn GEOSSnap_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSDelaunayTriangulation"] + pub fn GEOSDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSConstrainedDelaunayTriangulation"] + pub fn GEOSConstrainedDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSVoronoiDiagram"] + pub fn GEOSVoronoiDiagram_r( + extHandle: GEOSContextHandle_t, + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSegmentIntersection"] + pub fn GEOSSegmentIntersection_r( + extHandle: GEOSContextHandle_t, + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSDisjoint"] + pub fn GEOSDisjoint_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSTouches"] + pub fn GEOSTouches_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSIntersects"] + pub fn GEOSIntersects_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSCrosses"] + pub fn GEOSCrosses_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSWithin"] + pub fn GEOSWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSContains"] + pub fn GEOSContains_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSOverlaps"] + pub fn GEOSOverlaps_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSEquals"] + pub fn GEOSEquals_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSEqualsExact"] + pub fn GEOSEqualsExact_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSCovers"] + pub fn GEOSCovers_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSCoveredBy"] + pub fn GEOSCoveredBy_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPrepare"] + pub fn GEOSPrepare_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSPreparedGeometry; +} +extern "C" { + #[doc = " \\see GEOSPreparedGeom_destroy"] + pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); +} +extern "C" { + #[doc = " \\see GEOSPreparedContains"] + pub fn GEOSPreparedContains_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedContainsProperly"] + pub fn GEOSPreparedContainsProperly_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedCoveredBy"] + pub fn GEOSPreparedCoveredBy_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedCovers"] + pub fn GEOSPreparedCovers_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedCrosses"] + pub fn GEOSPreparedCrosses_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedDisjoint"] + pub fn GEOSPreparedDisjoint_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedIntersects"] + pub fn GEOSPreparedIntersects_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedOverlaps"] + pub fn GEOSPreparedOverlaps_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedTouches"] + pub fn GEOSPreparedTouches_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedWithin"] + pub fn GEOSPreparedWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedNearestPoints"] + pub fn GEOSPreparedNearestPoints_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSPreparedDistance"] + pub fn GEOSPreparedDistance_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSPreparedDistanceWithin"] + pub fn GEOSPreparedDistanceWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_create"] + pub fn GEOSSTRtree_create_r( + handle: GEOSContextHandle_t, + nodeCapacity: usize, + ) -> *mut GEOSSTRtree; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_insert"] + pub fn GEOSSTRtree_insert_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " \\see GEOSSTRtree_query"] + pub fn GEOSSTRtree_query_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " \\see GEOSSTRtree_nearest"] + pub fn GEOSSTRtree_nearest_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_nearest_generic"] + pub fn GEOSSTRtree_nearest_generic_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_iterate"] + pub fn GEOSSTRtree_iterate_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " \\see GEOSSTRtree_remove"] + pub fn GEOSSTRtree_remove_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_destroy"] + pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " \\see GEOSisEmpty"] + pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisSimple"] + pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisRing"] + pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSHasZ"] + pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisClosed"] + pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryRuleMod2()"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; +#[doc = " Same as \\ref GEOSRELATE_BNR_MOD2"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; +#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryEndPoint()"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; +#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint()"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 3; +#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryMonovalentEndPoint()"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 4; +#[doc = " Controls the behavior of the result of GEOSRelate when returning"] +#[doc = " DE9IM results for two geometries."] +pub type GEOSRelateBoundaryNodeRules = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSRelatePattern"] + pub fn GEOSRelatePattern_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSRelate"] + pub fn GEOSRelate_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSRelatePatternMatch"] + pub fn GEOSRelatePatternMatch_r( + handle: GEOSContextHandle_t, + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSRelateBoundaryNodeRule"] + pub fn GEOSRelateBoundaryNodeRule_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +#[doc = " Allow self-touching rings to form a hole in a polygon."] +pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; +#[doc = " Change behaviour of validity testing in \\ref GEOSisValidDetail"] +pub type GEOSValidFlags = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSisValid"] + pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisValidReason"] + pub fn GEOSisValidReason_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisValidDetail"] + pub fn GEOSisValidDetail_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +#[doc = " Original method, combines all rings into"] +#[doc = "a set of noded lines and then extracts valid"] +#[doc = "polygons from that linework."] +pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_LINEWORK: GEOSMakeValidMethods = 0; +#[doc = " Structured method, first makes all rings valid"] +#[doc = "then merges shells and subtracts holes from"] +#[doc = "shells to generate valid result. Assumes that"] +#[doc = "holes and shells are correctly categorized."] +pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_STRUCTURE: GEOSMakeValidMethods = 1; +#[doc = " Algorithm to use when repairing invalid geometries."] +#[doc = ""] +#[doc = " \\see GEOSMakeValidWithParams"] +pub type GEOSMakeValidMethods = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSMakeValidParams_create"] + pub fn GEOSMakeValidParams_create_r(extHandle: GEOSContextHandle_t) + -> *mut GEOSMakeValidParams; +} +extern "C" { + #[doc = " \\see GEOSMakeValidParams_destroy"] + pub fn GEOSMakeValidParams_destroy_r( + handle: GEOSContextHandle_t, + parms: *mut GEOSMakeValidParams, + ); +} +extern "C" { + #[doc = " \\see GEOSMakeValidParams_setKeepCollapsed"] + pub fn GEOSMakeValidParams_setKeepCollapsed_r( + handle: GEOSContextHandle_t, + p: *mut GEOSMakeValidParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSMakeValidParams_setMethod"] + pub fn GEOSMakeValidParams_setMethod_r( + handle: GEOSContextHandle_t, + p: *mut GEOSMakeValidParams, + method: GEOSMakeValidMethods, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSMakeValid"] + pub fn GEOSMakeValid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + makeValidParams: *const GEOSMakeValidParams, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeomType"] + pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSGeomTypeId"] + pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGetSRID"] + pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSSetSRID"] + pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + #[doc = " \\see GEOSGeom_getUserData"] + pub fn GEOSGeom_getUserData_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_void; +} +extern "C" { + #[doc = " \\see GEOSGeom_setUserData"] + pub fn GEOSGeom_setUserData_r( + handle: GEOSContextHandle_t, + g: *mut GEOSGeometry, + userData: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " \\see GEOSGetNumGeometries"] + pub fn GEOSGetNumGeometries_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGetGeometryN"] + pub fn GEOSGetGeometryN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSNormalize"] + pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; +} +#[doc = " The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed."] +pub const GEOSPrecisionRules_GEOS_PREC_VALID_OUTPUT: GEOSPrecisionRules = 0; +#[doc = " Precision reduction is performed pointwise. Output geometry may be invalid due to collapse or self-intersection. (This might be better called \"GEOS_PREC_POINTWISE\" - the current name is historical.)"] +pub const GEOSPrecisionRules_GEOS_PREC_NO_TOPO: GEOSPrecisionRules = 1; +#[doc = " Like the default mode, except that collapsed linear geometry elements are preserved. Collapsed polygonal input elements are removed."] +pub const GEOSPrecisionRules_GEOS_PREC_KEEP_COLLAPSED: GEOSPrecisionRules = 2; +#[doc = " Controls the behavior of GEOSGeom_setPrecision()"] +#[doc = " when altering the precision of a geometry."] +pub type GEOSPrecisionRules = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSGeom_setPrecision"] + pub fn GEOSGeom_setPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_getPrecision"] + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; +} +extern "C" { + #[doc = " \\see GEOSGetNumInteriorRings"] + pub fn GEOSGetNumInteriorRings_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetNumPoints"] + pub fn GEOSGeomGetNumPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetX"] + pub fn GEOSGeomGetX_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + x: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetY"] + pub fn GEOSGeomGetY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetZ"] + pub fn GEOSGeomGetZ_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGetInteriorRingN"] + pub fn GEOSGetInteriorRingN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGetExteriorRing"] + pub fn GEOSGetExteriorRing_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGetNumCoordinates"] + pub fn GEOSGetNumCoordinates_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getCoordSeq"] + pub fn GEOSGeom_getCoordSeq_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSGeom_getDimensions"] + pub fn GEOSGeom_getDimensions_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getCoordinateDimension"] + pub fn GEOSGeom_getCoordinateDimension_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getXMin"] + pub fn GEOSGeom_getXMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getYMin"] + pub fn GEOSGeom_getYMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getXMax"] + pub fn GEOSGeom_getXMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getYMax"] + pub fn GEOSGeom_getYMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetPointN"] + pub fn GEOSGeomGetPointN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeomGetStartPoint"] + pub fn GEOSGeomGetStartPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeomGetEndPoint"] + pub fn GEOSGeomGetEndPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSArea"] + pub fn GEOSArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + area: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSLength"] + pub fn GEOSLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSDistance"] + pub fn GEOSDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSDistanceWithin"] + pub fn GEOSDistanceWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSDistanceIndexed"] + pub fn GEOSDistanceIndexed_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSHausdorffDistance"] + pub fn GEOSHausdorffDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSHausdorffDistanceDensify"] + pub fn GEOSHausdorffDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSFrechetDistance"] + pub fn GEOSFrechetDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSFrechetDistanceDensify"] + pub fn GEOSFrechetDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetLength"] + pub fn GEOSGeomGetLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSNearestPoints"] + pub fn GEOSNearestPoints_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSOrientationIndex"] + pub fn GEOSOrientationIndex_r( + handle: GEOSContextHandle_t, + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTReader_t { + _unused: [u8; 0], +} +#[doc = " Reader object to read Well-Known Text (WKT) format and construct Geometry."] +#[doc = " \\see GEOSWKTReader_create"] +#[doc = " \\see GEOSWKTReader_create_r"] +pub type GEOSWKTReader = GEOSWKTReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTWriter_t { + _unused: [u8; 0], +} +#[doc = " Writer object to turn Geometry into Well-Known Text (WKT)."] +#[doc = " \\see GEOSWKTWriter_create"] +#[doc = " \\see GEOSWKTWriter_create_r"] +pub type GEOSWKTWriter = GEOSWKTWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBReader_t { + _unused: [u8; 0], +} +#[doc = " Reader object to read Well-Known Binary (WKB) format and construct Geometry."] +#[doc = " \\see GEOSWKBReader_create"] +#[doc = " \\see GEOSWKBReader_create_r"] +pub type GEOSWKBReader = GEOSWKBReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBWriter_t { + _unused: [u8; 0], +} +#[doc = " Writer object to turn Geometry into Well-Known Binary (WKB)."] +#[doc = " \\see GEOSWKBWriter_create"] +#[doc = " \\see GEOSWKBWriter_create_r"] +pub type GEOSWKBWriter = GEOSWKBWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeoJSONReader_t { + _unused: [u8; 0], +} +#[doc = " Reader object to read GeoJSON format and construct a Geometry."] +#[doc = " \\see GEOSGeoJSONReader_create"] +#[doc = " \\see GEOSGeoJSONReader_create_r"] +pub type GEOSGeoJSONReader = GEOSGeoJSONReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeoJSONWriter_t { + _unused: [u8; 0], +} +#[doc = " Writer object to turn a Geometry into GeoJSON."] +#[doc = " \\see GEOSGeoJSONReader_create"] +#[doc = " \\see GEOSGeoJSONReader_create_r"] +pub type GEOSGeoJSONWriter = GEOSGeoJSONWriter_t; +extern "C" { + #[doc = " \\see GEOSWKTReader_create"] + pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; +} +extern "C" { + #[doc = " \\see GEOSWKTReader_destroy"] + pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); +} +extern "C" { + #[doc = " \\see GEOSWKTReader_read"] + pub fn GEOSWKTReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSWKTReader_create"] + pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_destroy"] + pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_write"] + pub fn GEOSWKTWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_setTrim"] + pub fn GEOSWKTWriter_setTrim_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + trim: libc::c_char, + ); +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_setRoundingPrecision"] + pub fn GEOSWKTWriter_setRoundingPrecision_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + precision: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_setOutputDimension"] + pub fn GEOSWKTWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + dim: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_getOutputDimension"] + pub fn GEOSWKTWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_setOld3D"] + pub fn GEOSWKTWriter_setOld3D_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + useOld3D: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKBReader_create"] + pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; +} +extern "C" { + #[doc = " \\see GEOSWKBReader_destroy"] + pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); +} +extern "C" { + #[doc = " \\see GEOSWKBReader_read"] + pub fn GEOSWKBReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSWKBReader_readHEX"] + pub fn GEOSWKBReader_readHEX_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_create"] + pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_destroy"] + pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_write"] + pub fn GEOSWKBWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_writeHEX"] + pub fn GEOSWKBWriter_writeHEX_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_getOutputDimension"] + pub fn GEOSWKBWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_setOutputDimension"] + pub fn GEOSWKBWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + newDimension: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_getByteOrder"] + pub fn GEOSWKBWriter_getByteOrder_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_setByteOrder"] + pub fn GEOSWKBWriter_setByteOrder_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + byteOrder: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_getFlavor"] + pub fn GEOSWKBWriter_getFlavor_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_setFlavor"] + pub fn GEOSWKBWriter_setFlavor_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + flavor: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_getIncludeSRID"] + pub fn GEOSWKBWriter_getIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_setIncludeSRID"] + pub fn GEOSWKBWriter_setIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + writeSRID: libc::c_char, + ); +} +extern "C" { + #[doc = " \\see GEOSGeoJSONReader_create"] + pub fn GEOSGeoJSONReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONReader; +} +extern "C" { + #[doc = " \\see GEOSGeoJSONReader_destroy"] + pub fn GEOSGeoJSONReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSGeoJSONReader); +} +extern "C" { + #[doc = " \\see GEOSWKTReader_read"] + pub fn GEOSGeoJSONReader_readGeometry_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSGeoJSONReader, + geojson: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeoJSONWriter_create"] + pub fn GEOSGeoJSONWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONWriter; +} +extern "C" { + #[doc = " \\see GEOSGeoJSONWriter_destroy"] + pub fn GEOSGeoJSONWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSGeoJSONWriter); +} +extern "C" { + #[doc = " \\see GEOSGeoJSONWriter_writeGeometry"] + pub fn GEOSGeoJSONWriter_writeGeometry_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSGeoJSONWriter, + g: *const GEOSGeometry, + indent: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSFree"] + pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); +} +extern "C" { + #[doc = " Returns the current GEOS version string. eg: \"3.10.0\""] + #[doc = " This function does not have a reentrant variant and is"] + #[doc = " available if `GEOS_USE_ONLY_R_API` is defined."] + #[doc = " \\return version string"] + pub fn GEOSversion() -> *const libc::c_char; +} +extern "C" { + #[doc = " Create a coordinate sequence."] + #[doc = " \\param size number of coordinates in the sequence"] + #[doc = " \\param dims dimensionality of the coordinates (2 or 3)"] + #[doc = " \\return the sequence or NULL on exception"] + pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Create a coordinate sequence by copying from a buffer of doubles (XYXY or XYZXYZ)"] + #[doc = " \\param buf pointer to buffer"] + #[doc = " \\param size number of coordinates in the sequence"] + #[doc = " \\param hasZ does buffer have Z values?"] + #[doc = " \\param hasM does buffer have M values? (they will be ignored)"] + #[doc = " \\return the sequence or NULL on exception"] + pub fn GEOSCoordSeq_copyFromBuffer( + buf: *const f64, + size: libc::c_uint, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Create a coordinate sequence by copying from arrays of doubles"] + #[doc = " \\param x array of x coordinates"] + #[doc = " \\param y array of y coordinates"] + #[doc = " \\param z array of z coordinates, or NULL"] + #[doc = " \\param m array of m coordinates, (must be NULL)"] + #[doc = " \\param size length of each array"] + #[doc = " \\return the sequence or NULL on exception"] + pub fn GEOSCoordSeq_copyFromArrays( + x: *const f64, + y: *const f64, + z: *const f64, + m: *const f64, + size: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Copy the contents of a coordinate sequence to a buffer of doubles (XYXY or XYZXYZ)"] + #[doc = " \\param s sequence to copy"] + #[doc = " \\param buf buffer to which coordinates should be copied"] + #[doc = " \\param hasZ copy Z values to buffer?"] + #[doc = " \\param hasM copy M values to buffer? (will be NaN)"] + #[doc = " \\return 1 on success, 0 on error"] + pub fn GEOSCoordSeq_copyToBuffer( + s: *const GEOSCoordSequence, + buf: *mut f64, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Copy the contents of a coordinate sequence to a buffer of doubles (XYZY or XYZXYZ)"] + #[doc = " \\param s sequence to copy"] + #[doc = " \\param x array to which x values should be copied"] + #[doc = " \\param y array to which y values should be copied"] + #[doc = " \\param z array to which z values should be copied, or NULL"] + #[doc = " \\param m array to which m values should be copied (will all be NAN)"] + #[doc = " \\return 1 on success, 0 on error"] + pub fn GEOSCoordSeq_copyToArrays( + s: *const GEOSCoordSequence, + x: *mut f64, + y: *mut f64, + z: *mut f64, + m: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Clone a coordinate sequence."] + #[doc = " \\param s the coordinate sequence to clone"] + #[doc = " \\return a copy of the coordinate sequence or NULL on exception"] + pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Destroy a coordinate sequence, freeing all memory."] + #[doc = " \\param s the coordinate sequence to destroy"] + pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); +} +extern "C" { + #[doc = " Set X ordinate values in a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val the value to set the ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + #[doc = " Set Y ordinate values in a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val the value to set the ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + #[doc = " Set Z ordinate values in a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val the value to set the ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + #[doc = " Set X and Y ordinate values in a coordinate sequence simultaneously."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param x the value to set the X ordinate to"] + #[doc = " \\param y the value to set the Y ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setXY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Set X, Y and Z ordinate values in a coordinate sequence simultaneously."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param x the value to set the X ordinate to"] + #[doc = " \\param y the value to set the Y ordinate to"] + #[doc = " \\param z the value to set the Z ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setXYZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + z: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Set Nth ordinate value in a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param dim the dimension number of the ordinate to alter, zero based"] + #[doc = " \\param val the value to set the ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setOrdinate( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read X ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val pointer where ordinate value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getX( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read Y ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val pointer where ordinate value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read Z ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val pointer where ordinate value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read X and Y ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param x pointer where ordinate X value will be placed"] + #[doc = " \\param y pointer where ordinate Y value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getXY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read X and Y ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param x pointer where ordinate X value will be placed"] + #[doc = " \\param y pointer where ordinate Y value will be placed"] + #[doc = " \\param z pointer where ordinate Z value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getXYZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read Nth ordinate value from a coordinate sequence."] + #[doc = " \\param[in] s the coordinate sequence"] + #[doc = " \\param[in] idx the index of the coordinate to alter, zero based"] + #[doc = " \\param[in] dim the dimension number of the ordinate to read, zero based"] + #[doc = " \\param[out] val pointer where ordinate value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getOrdinate( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Get size info from a coordinate sequence."] + #[doc = " \\param[in] s the coordinate sequence"] + #[doc = " \\param[out] size pointer where size value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getSize( + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Get dimension info from a coordinate sequence."] + #[doc = " \\param[in] s the coordinate sequence"] + #[doc = " \\param[out] dims pointer where dimension value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getDimensions( + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Check orientation of a coordinate sequence. Closure of the sequence is"] + #[doc = " assumed. Invalid (collapsed) sequences will return false. Short (less"] + #[doc = " than 4 points) sequences will return exception."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param is_ccw pointer for ccw value, 1 if counter-clockwise orientation, 0 otherwise"] + #[doc = " \\return 0 on exception, 1 on success"] + pub fn GEOSCoordSeq_isCCW( + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Distance of point projected onto line from the start of the line."] + #[doc = " \\param line linear target of projection"] + #[doc = " \\param point point to be projected onto 'g'"] + #[doc = " \\return distance along line that point projects to, -1 on exception"] + #[doc = ""] + #[doc = " \\note Line parameter must be a LineString."] + pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; +} +extern "C" { + #[doc = " Measuring from start of line, return point that is distance"] + #[doc = " the start. Line parameter must be a LineString."] + #[doc = " \\param line linear target of projection"] + #[doc = " \\param d distance from start of line to created point"] + #[doc = " \\return The point \\ref GEOSGeometry that is distance from the start of line."] + #[doc = " Caller takes ownership of returned geometry."] + pub fn GEOSInterpolate(line: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Project point to line and calculate the **proportion** of"] + #[doc = " the line the point is from the start. For example, a point that"] + #[doc = " projects to the middle of a line would be return 0.5."] + #[doc = " \\param line linear target of projection"] + #[doc = " \\param point the point to project"] + #[doc = " \\return The proportion of the overall line length that the projected"] + #[doc = " point falls at."] + pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; +} +extern "C" { + #[doc = " Measuring from start of line, return point that is a proportion"] + #[doc = " the start. Line parameter must be a LineString."] + #[doc = " \\param line linear target of projection"] + #[doc = " \\param proportion The proportion from the start of line to created point"] + #[doc = " \\return The point \\ref GEOSGeometry that is distance from the start of line."] + #[doc = " Caller takes ownership of returned geometry."] + pub fn GEOSInterpolateNormalized( + line: *const GEOSGeometry, + proportion: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Buffer a geometry."] + #[doc = " \\param g The input geometry to be buffered."] + #[doc = " \\param width The distance by which to expand the geometry (or contract)"] + #[doc = " if the value is negative."] + #[doc = " \\param quadsegs The number of segments per quadrant to generate. More"] + #[doc = " segments provides a more \"precise\" buffer at the expense of size."] + #[doc = " \\return A \\ref GEOSGeometry of the buffered result."] + #[doc = " NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSBuffer( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a default GEOSBufferParams object for controlling the shape"] + #[doc = " of buffered generated by \\ref GEOSBuffer."] + #[doc = " \\return A newly allocated GEOSBufferParams. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSBufferParams_destroy()."] + pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; +} +extern "C" { + #[doc = " Destroy a GEOSBufferParams and free all associated memory."] + #[doc = " \\param parms The object to destroy."] + pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); +} +extern "C" { + #[doc = " Set the end cap type of a GEOSBufferParams to the desired style,"] + #[doc = " which must be one enumerated in \\ref GEOSBufCapStyles."] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setEndCapStyle( + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Set the join type of a GEOSBufferParams to the desired style,"] + #[doc = " which must be one enumerated in \\ref GEOSBufJoinStyles."] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setJoinStyle( + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Set the mitre limit of a GEOSBufferParams to the desired size."] + #[doc = " For acute angles, a mitre join can extend very very far from"] + #[doc = " the input geometry, which is probably not desired. The"] + #[doc = " mitre limit places an upper bound on that."] + #[doc = " \\param p The GEOSBufferParams to operate on"] + #[doc = " \\param mitreLimit The limit to set"] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + -> libc::c_int; +} +extern "C" { + #[doc = " Set the number of segments to use to stroke each quadrant"] + #[doc = " of circular arcs generated by the buffering process. More"] + #[doc = " segments means a smoother output, but with larger size."] + #[doc = " \\param p The GEOSBufferParams to operate on"] + #[doc = " \\param quadSegs Number of segments per quadrant"] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setQuadrantSegments( + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Sets whether the computed buffer should be single-sided."] + #[doc = " A single-sided buffer is constructed on only one side of each input line."] + #[doc = " \\see geos::operation::buffer::BufferParameters::setSingleSided"] + #[doc = " \\param p The GEOSBufferParams to operate on"] + #[doc = " \\param singleSided Set to 1 for single-sided output 0 otherwise"] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setSingleSided( + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Generates a buffer using the special parameters in the GEOSBufferParams"] + #[doc = " \\param g The geometry to buffer"] + #[doc = " \\param p The parameters to apply to the buffer process"] + #[doc = " \\param width The buffer distance"] + #[doc = " \\return The buffered geometry, or NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSBufferWithParams( + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Generate a buffer using the provided style parameters."] + #[doc = " \\param g The geometry to buffer"] + #[doc = " \\param width Width of the buffer"] + #[doc = " \\param quadsegs Number of segments per quadrant"] + #[doc = " \\param endCapStyle See \\ref GEOSBufCapStyles"] + #[doc = " \\param joinStyle See \\ref GEOSBufJoinStyles"] + #[doc = " \\param mitreLimit See GEOSBufferParams_setMitreLimit"] + #[doc = " \\return The buffered geometry, or NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSBufferWithStyle( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Densifies a geometry using a given distance tolerance."] + #[doc = " Additional vertices will be added to every line segment"] + #[doc = " that is greater this tolerance; these vertices will"] + #[doc = " evenly subdivide that segment."] + #[doc = " Only linear components of input geometry are densified."] + #[doc = " \\param g The geometry to densify"] + #[doc = " \\param tolerance the distance tolerance to densify"] + #[doc = " \\return The densified geometry, or NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSDensify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Generates offset curve for linear geometry."] + #[doc = " Only LineStrings accepted as input."] + #[doc = " \\param g The linear geometry to offset from"] + #[doc = " \\param width Distance to offset from the curve."] + #[doc = " Negative for a right-side offset."] + #[doc = " Positive for a left-side offset."] + #[doc = " \\param quadsegs Number of segments per quadrant"] + #[doc = " \\param joinStyle See \\ref GEOSBufJoinStyles"] + #[doc = " \\param mitreLimit See GEOSBufferParams_setMitreLimit"] + #[doc = " \\return The offset geometry. Returns NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::buffer::BufferBuilder::bufferLineSingleSided"] + pub fn GEOSOffsetCurve( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a point geometry from a coordinate sequence."] + #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] + #[doc = " \\return A newly allocated point geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a point geometry from a pair of coordinates."] + #[doc = " \\param x The X coordinate"] + #[doc = " \\param y The Y coordinate"] + #[doc = " \\return A newly allocated point geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createPointFromXY(x: f64, y: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates an empty point."] + #[doc = " \\return A newly allocated empty point geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a linear ring geometry, for use in a polygon."] + #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] + #[doc = " \\return A newly allocated linear ring geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a linestring geometry."] + #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] + #[doc = " \\return A newly allocated linestring geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates an emptylinestring geometry."] + #[doc = " \\return A newly allocated linestring geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates an empty polygon geometry."] + #[doc = " \\return A newly allocated empty polygon geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a polygon geometry from line ring geometries."] + #[doc = " \\param shell A linear ring that is the exterior ring of the polygon."] + #[doc = " \\param holes An array of linear rings that are the holes."] + #[doc = " \\param nholes The number of rings in the holes array."] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\note The holes argument is an array of GEOSGeometry* objects."] + #[doc = " The caller **retains ownership** of the containing array,"] + #[doc = " but the ownership of the pointed-to objects is transferred"] + #[doc = " to the returned \\ref GEOSGeometry."] + pub fn GEOSGeom_createPolygon( + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a geometry collection."] + #[doc = " \\param type The geometry type, enumerated by \\ref GEOSGeomTypes"] + #[doc = " \\param geoms A list of geometries that will form the collection"] + #[doc = " \\param ngeoms The number of geometries in the geoms list"] + #[doc = " \\return A newly allocated geometry collection. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\note The holes argument is an array of GEOSGeometry* objects."] + #[doc = " The caller **retains ownership** of the containing array,"] + #[doc = " but the ownership of the pointed-to objects is transferred"] + #[doc = " to the returned \\ref GEOSGeometry."] + pub fn GEOSGeom_createCollection( + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create an empty geometry collection."] + #[doc = " \\param type The geometry type, enumerated by \\ref GEOSGeomTypes"] + #[doc = " \\return A newly allocated empty geometry collection. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a new copy of the input geometry."] + #[doc = " \\param g The geometry to copy"] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Release the memory associated with a geometry."] + #[doc = " \\param g The geometry to be destroyed."] + pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " Returns minimum rectangular polygon that contains the geometry."] + #[doc = " \\param g The geometry to calculate an envelope for"] + #[doc = " \\return A newly allocated polygonal envelope. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the intersection of two geometries: the set of points"] + #[doc = " that fall within **both** geometries."] + #[doc = " \\param g1 one of the geometries"] + #[doc = " \\param g2 the other geometry"] + #[doc = " \\return A newly allocated geometry of the intersection. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the intersection of two geometries: the set of points"] + #[doc = " that fall within **both** geometries. All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param g1 one of the geometries"] + #[doc = " \\param g2 the other geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the intersection. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSIntersectionPrec( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the difference of two geometries A and B: the set of points"] + #[doc = " that fall within A but **not** within B."] + #[doc = " \\param ga the base geometry"] + #[doc = " \\param gb the geometry to subtract from it"] + #[doc = " \\return A newly allocated geometry of the difference. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the difference of two geometries A and B: the set of points"] + #[doc = " that fall within A but **not** within B."] + #[doc = " All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param ga one of the geometries"] + #[doc = " \\param gb the other geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the difference. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSDifferencePrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the symmetric difference of two geometries A and B: the set of points"] + #[doc = " that fall in A but **not** within B and the set of points that fall in B but"] + #[doc = " **not** in A."] + #[doc = " \\param ga geometry A"] + #[doc = " \\param gb geometry B"] + #[doc = " \\return A newly allocated geometry of the symmetric difference. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSSymDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the symmetric difference of two geometries A and B: the set of points"] + #[doc = " that fall in A but **not** within B and the set of points that fall in B but"] + #[doc = " **not** in A."] + #[doc = " All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param ga one of the geometries"] + #[doc = " \\param gb the other geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the symmetric difference. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSSymDifferencePrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the union of two geometries A and B: the set of points"] + #[doc = " that fall in A **or** within B."] + #[doc = " \\param ga geometry A"] + #[doc = " \\param gb geometry B"] + #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSUnion(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the union of two geometries A and B: the set of points"] + #[doc = " that fall in A **or** within B."] + #[doc = " All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param ga one of the geometries"] + #[doc = " \\param gb the other geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSUnionPrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the union of all components of a single geometry. Usually"] + #[doc = " used to convert a collection into the smallest set of polygons"] + #[doc = " that cover the same area."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the union of all components of a single geometry. Usually"] + #[doc = " used to convert a collection into the smallest set of polygons"] + #[doc = " that cover the same area."] + #[doc = " All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param g input geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the \"boundary\" of a geometry, as defined by the DE9IM:"] + #[doc = ""] + #[doc = " - the boundary of a polygon is the linear rings dividing the exterior"] + #[doc = " from the interior"] + #[doc = " - the boundary of a linestring is the end points"] + #[doc = " - the boundary of a point is the point"] + #[doc = ""] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the boundary. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns convex hull of a geometry. The smallest convex Geometry"] + #[doc = " that contains all the points in the input Geometry"] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the convex hull. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the minimum rotated rectangular POLYGON which encloses"] + #[doc = " the input geometry. The rectangle has width equal to the"] + #[doc = " minimum diameter, and a longer length. If the convex hill of"] + #[doc = " the input is degenerate (a line or point) a linestring or point"] + #[doc = " is returned. The minimum rotated rectangle can be used as an"] + #[doc = " extremely generalized representation for the given geometry."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the rotated envelope. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Constructs the \"maximum inscribed circle\" (MIC) for a polygonal geometry,"] + #[doc = " up to a specified tolerance."] + #[doc = " The MIC is determined by a point in the interior of the area"] + #[doc = " which has the farthest distance from the area boundary, along with a boundary point at that distance."] + #[doc = " In the context of geography the center of the MIC is known as the"] + #[doc = " \"pole of inaccessibility\". A cartographic use case is to determine a suitable point"] + #[doc = " to place a map label within a polygon."] + #[doc = " The radius length of the MIC is a measure of how \"narrow\" a polygon is. It is the"] + #[doc = " distance at which the negative buffer becomes empty."] + #[doc = " The class supports polygons with holes and multipolygons."] + #[doc = " The implementation uses a successive-approximation technique over a grid of square cells covering the area geometry."] + #[doc = " The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant"] + #[doc = " way by using spatial indexes."] + #[doc = " Returns a two-point linestring, with one point at the center of the inscribed circle and the other"] + #[doc = " on the boundary of the inscribed circle."] + #[doc = " \\param g Input geometry"] + #[doc = " \\param tolerance Stop the algorithm when the search area is smaller than this tolerance"] + #[doc = " \\return A newly allocated geometry of the MIC. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::construct::MaximumInscribedCircle"] + pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Constructs the \"largest empty circle\" (LEC) for a set of obstacle geometries, up to a"] + #[doc = " specified tolerance. The obstacles are point and line geometries."] + #[doc = " The LEC is the largest circle which has its center in the convex hull of the"] + #[doc = " obstacles (the boundary), and whose interior does not intersect with any obstacle."] + #[doc = " The LEC center is the point in the interior of the boundary which has the farthest distance from"] + #[doc = " the obstacles (up to tolerance). The LEC is determined by the center point and a point lying on an"] + #[doc = " obstacle indicating the circle radius."] + #[doc = " The implementation uses a successive-approximation technique over a grid of square cells covering the obstacles and boundary."] + #[doc = " The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant"] + #[doc = " way by using spatial indexes."] + #[doc = " Returns a two-point linestring, with one point at the center of the inscribed circle and the other"] + #[doc = " on the boundary of the inscribed circle."] + #[doc = " \\param obstacles The geometries that the LEC must fit within without covering"] + #[doc = " \\param boundary The area within which the LEC must reside"] + #[doc = " \\param tolerance Stop the algorithm when the search area is smaller than this tolerance"] + #[doc = " \\return A newly allocated geometry of the LEC. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::construct::LargestEmptyCircle"] + pub fn GEOSLargestEmptyCircle( + obstacles: *const GEOSGeometry, + boundary: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns a linestring geometry which represents the minimum diameter of the geometry."] + #[doc = " The minimum diameter is defined to be the width of the smallest band that"] + #[doc = " contains the geometry, where a band is a strip of the plane defined"] + #[doc = " by two parallel lines. This can be thought of as the smallest hole that the geometry"] + #[doc = " can be moved through, with a single rotation."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the LEC. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::MinimumDiameter"] + pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Computes the minimum clearance of a geometry. The minimum clearance is the smallest amount by which"] + #[doc = " a vertex could be move to produce an invalid polygon, a non-simple linestring, or a multipoint with"] + #[doc = " repeated points. If a geometry has a minimum clearance of 'eps', it can be said that:"] + #[doc = ""] + #[doc = " - No two distinct vertices in the geometry are separated by less than 'eps'"] + #[doc = " - No vertex is closer than 'eps' to a line segment of which it is not an endpoint."] + #[doc = ""] + #[doc = " If the minimum clearance cannot be defined for a geometry (such as with a single point, or a multipoint"] + #[doc = " whose points are identical, a value of Infinity will be calculated."] + #[doc = ""] + #[doc = " \\param g the input geometry"] + #[doc = " \\param d a double to which the result can be stored"] + #[doc = " \\return 0 if no exception occurred."] + #[doc = " 2 if an exception occurred."] + #[doc = " \\see geos::precision::MinimumClearance"] + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Returns a LineString whose endpoints define the minimum clearance of a geometry."] + #[doc = " If the geometry has no minimum clearance, an empty LineString will be returned."] + #[doc = ""] + #[doc = " \\param g the input geometry"] + #[doc = " \\return a linestring geometry, or NULL if an exception occurred."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::precision::MinimumClearance"] + pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Optimized union algorithm for polygonal inputs that are correctly"] + #[doc = " noded and do not overlap. It will generate an error (return NULL)"] + #[doc = " for inputs that do not satisfy this constraint."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A geometry that covers all the points of the input geometry."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns a point that is inside the boundary of a polygonal geometry."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A point that is inside the input"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::InteriorPointArea"] + pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns a point at the center of mass of the input."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A point at the center of mass of the input"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::Centroid"] + pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns a geometry which represents the \"minimum bounding circle\","] + #[doc = " the smallest circle that contains the input."] + #[doc = " \\param[in] g The input geometry"] + #[doc = " \\param[out] radius Pointer will be filled with output radius."] + #[doc = " \\param[out] center Pointer will be filled with output circle center. Caller must free."] + #[doc = " \\return The circle geometry or NULL on exception"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::MinimumBoundingCircle::getCircle"] + pub fn GEOSMinimumBoundingCircle( + g: *const GEOSGeometry, + radius: *mut f64, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " For linear inputs, returns a new geometry in which no lines cross"] + #[doc = " each other, and all touching occurs at end points."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return The noded geometry or NULL on exception"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::noding::GeometryNoder::node"] + pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Intersection optimized for a rectangular clipping polygon."] + #[doc = " Supposed to be faster than using GEOSIntersection(). Not"] + #[doc = " guaranteed to return valid results."] + #[doc = " \\param g The input geometry to be clipped"] + #[doc = " \\param xmin Left bound of clipping rectangle"] + #[doc = " \\param ymin Lower bound of clipping rectangle"] + #[doc = " \\param xmax Right bound of clipping rectangle"] + #[doc = " \\param ymax Upper bound of clipping rectangle"] + #[doc = " \\return The clipped geometry or NULL on exception"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::intersection::RectangleIntersection"] + pub fn GEOSClipByRect( + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Polygonizes a set of Geometries which contain linework that"] + #[doc = " represents the edges of a planar graph."] + #[doc = ""] + #[doc = " All types of Geometry are accepted as input; the constituent"] + #[doc = " linework is extracted as the edges to be polygonized."] + #[doc = ""] + #[doc = " The edges must be correctly noded; that is, they must only meet"] + #[doc = " at their endpoints. Polygonization will accept incorrectly noded"] + #[doc = " input but will not form polygons from non-noded edges, and reports"] + #[doc = " them as errors."] + #[doc = ""] + #[doc = " The Polygonizer reports the following kinds of errors:"] + #[doc = ""] + #[doc = " - Dangles - edges which have one or both ends which are"] + #[doc = " not incident on another edge endpoint"] + #[doc = " - Cut Edges - edges which are connected at both ends but"] + #[doc = " which do not form part of a polygon"] + #[doc = " - Invalid Ring Lines - edges which form rings which are invalid"] + #[doc = " (e.g. the component lines contain a self-intersection)"] + #[doc = ""] + #[doc = " Errors are reported to output parameters \"cuts\", \"dangles\" and"] + #[doc = " \"invalid\" (if not-null). Formed polygons are returned as a"] + #[doc = " collection. NULL is returned on exception. All returned"] + #[doc = " geometries must be destroyed by caller."] + #[doc = ""] + #[doc = " The GEOSPolygonize_valid() variant allows extracting only polygons"] + #[doc = " which form a valid polygonal result. The set of extracted polygons"] + #[doc = " is guaranteed to be edge-disjoint. This is useful when it is known"] + #[doc = " that the input lines form a valid polygonal geometry (which may"] + #[doc = " include holes or nested polygons)."] + #[doc = ""] + #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] + #[doc = " \\param ngeoms Size of the geoms array."] + #[doc = " \\return The polygonal output geometry."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::Polygonizer"] + pub fn GEOSPolygonize( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Same polygonizing behavior as GEOSPolygonize(), but only returning results"] + #[doc = " that are valid."] + #[doc = ""] + #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] + #[doc = " \\param ngeoms Size of the geoms array."] + #[doc = " \\return The polygonal output geometry."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::Polygonizer"] + pub fn GEOSPolygonize_valid( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Perform the polygonization as GEOSPolygonize() but return only the"] + #[doc = " \"cut edges\", the linear features that are connected at both ends,"] + #[doc = " do *not* participate in the final polygon."] + #[doc = ""] + #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] + #[doc = " \\param ngeoms Size of the geoms array."] + #[doc = " \\return The \"cut edges\""] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::Polygonizer"] + pub fn GEOSPolygonizer_getCutEdges( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Perform the polygonization as GEOSPolygonize() and return the"] + #[doc = " polygonal result as well as all extra ouputs."] + #[doc = ""] + #[doc = " \\param[in] input A single geometry with all the input lines to polygonize."] + #[doc = " \\param[out] cuts Pointer to hold \"cut edges\", connected on both ends but not part of output. Caller must free."] + #[doc = " \\param[out] dangles Pointer to hold \"dangles\", connected one end but not part of output. Caller must free."] + #[doc = " \\param[out] invalid Pointer to hold invalid outputs, polygons formed but not valid. Caller must free."] + #[doc = " \\return The polygonal valid output"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::Polygonizer"] + pub fn GEOSPolygonize_full( + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalid: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Perform a polygonization using all the linework, assuming that"] + #[doc = " rings contained within rings are empty holes, rather then"] + #[doc = " extra polygons."] + #[doc = " \\param g The input linework"] + #[doc = " \\return The polygonal output"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::BuildArea"] + pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Sews together a set of fully noded LineStrings"] + #[doc = " removing any cardinality 2 nodes in the linework."] + #[doc = " \\param g The input linework"] + #[doc = " \\return The merged linework"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::linemerge::LineMerger"] + pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " For geometries with coordinate sequences, reverses the order"] + #[doc = " of the sequences. Converts CCW rings to CW. Reverses direction"] + #[doc = " of LineStrings."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return The reversed geometry"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Apply the"] + #[doc = " [Douglas/Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)"] + #[doc = " to the coordinate sequences of the input geometry."] + #[doc = " Removes \"unnecessary\" vertices, vertices"] + #[doc = " that are co-linear within the tolerance distance."] + #[doc = " \\param g The input geometry"] + #[doc = " \\param tolerance The tolerance to apply. Larger tolerance leads to simpler output."] + #[doc = " \\return The simplified geometry"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::simplify::DouglasPeuckerSimplifier"] + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Apply the"] + #[doc = " [Douglas/Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)"] + #[doc = " to the coordinate sequences of the input geometry."] + #[doc = " Removes \"unnecessary\" vertices, vertices"] + #[doc = " that are co-linear within the tolerance distance."] + #[doc = " Returns a valid output geometry, checking for collapses, ring-intersections, etc"] + #[doc = " and attempting to avoid. More computationally expensive than GEOSSimplify()"] + #[doc = " \\param g The input geometry"] + #[doc = " \\param tolerance The tolerance to apply. Larger tolerance leads to simpler output."] + #[doc = " \\return The simplified geometry"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::simplify::DouglasPeuckerSimplifier"] + pub fn GEOSTopologyPreserveSimplify( + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return all distinct vertices of input geometry as a MultiPoint."] + #[doc = " Note that only 2 dimensions of the vertices are considered when"] + #[doc = " testing for equality."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return The distinct points"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Find paths shared between the two given lineal geometries."] + #[doc = ""] + #[doc = " Returns a GeometryCollection having two elements:"] + #[doc = ""] + #[doc = " - first element is a MultiLineString containing shared paths"] + #[doc = " having the _same_ direction on both inputs"] + #[doc = " - second element is a MultiLineString containing shared paths"] + #[doc = " having the _opposite_ direction on the two inputs"] + #[doc = ""] + #[doc = " \\param g1 An input geometry"] + #[doc = " \\param g2 An input geometry"] + #[doc = " \\return The shared paths"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::sharedpaths::SharedPathsOp"] + pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Snap first geometry onto second within the given tolerance."] + #[doc = " \\param input An input geometry"] + #[doc = " \\param snap_target A geometry to snap the input to"] + #[doc = " \\param tolerance Snapping tolerance"] + #[doc = " \\return The snapped verion of the input. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSSnap( + input: *const GEOSGeometry, + snap_target: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return a Delaunay triangulation of the vertices of the given geometry."] + #[doc = ""] + #[doc = " \\param g the input geometry whose vertices will be used as \"sites\""] + #[doc = " \\param tolerance optional snapping tolerance to use for improved robustness"] + #[doc = " \\param onlyEdges if non-zero will return a MultiLineString, otherwise it will"] + #[doc = " return a GeometryCollection containing triangular Polygons."] + #[doc = ""] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSDelaunayTriangulation( + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return a constrained Delaunay triangulation of the vertices of the"] + #[doc = " given polygon(s)."] + #[doc = " For non-polygonal inputs, returns an empty geometry collection."] + #[doc = ""] + #[doc = " \\param g the input geometry whose rings will be used as input"] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSConstrainedDelaunayTriangulation(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the Voronoi polygons of the vertices of the given geometry."] + #[doc = ""] + #[doc = " \\param g the input geometry whose vertices will be used as sites."] + #[doc = " \\param tolerance snapping tolerance to use for improved robustness"] + #[doc = " \\param onlyEdges whether to return only edges of the voronoi cells"] + #[doc = " \\param env clipping envelope for the returned diagram, automatically"] + #[doc = " determined if env is NULL."] + #[doc = " The diagram will be clipped to the larger"] + #[doc = " of this envelope or an envelope surrounding the sites."] + #[doc = ""] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSVoronoiDiagram( + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Computes the coordinate where two line segments intersect, if any"] + #[doc = ""] + #[doc = " \\param[in] ax0 x-coordinate of 1st point in 1st segment"] + #[doc = " \\param[in] ay0 y-coordinate of 1st point in 1st segment"] + #[doc = " \\param[in] ax1 x-coordinate of 2nd point in 1st segment"] + #[doc = " \\param[in] ay1 y-coordinate of 2nd point in 1st segment"] + #[doc = " \\param[in] bx0 x-coordinate of 1st point in 2nd segment"] + #[doc = " \\param[in] by0 y-coordinate of 1st point in 2nd segment"] + #[doc = " \\param[in] bx1 x-coordinate of 2nd point in 2nd segment"] + #[doc = " \\param[in] by1 y-coordinate of 2nd point in 2nd segment"] + #[doc = " \\param[out] cx x-coordinate of intersection point"] + #[doc = " \\param[out] cy y-coordinate of intersection point"] + #[doc = ""] + #[doc = " \\return 0 on error, 1 on success, -1 if segments do not intersect"] + pub fn GEOSSegmentIntersection( + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " True if no point of either geometry touchess or is within the other."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::disjoint"] + pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries share boundaries at one or more points, but do"] + #[doc = " not have interior overlaps."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::touches"] + pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries are not disjoint."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::intersects"] + pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries interiors interact but their boundares do not."] + #[doc = " Most useful for finding line crosses cases."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::crosses"] + pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometry g1 is completely within g2, and not"] + #[doc = " touching the boundary of g2."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::within"] + pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometry g2 is completely within g1."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::contains"] + pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries share interiors but are neither"] + #[doc = " within nor contained."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::overlaps"] + pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries cover the same space on the place."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::equals"] + pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometry g1 is completely within g2, including possibly"] + #[doc = " touching the boundary of g2."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::covers"] + pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometry g2 is completely within g1, including possibly"] + #[doc = " touching the boundary of g1."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::coveredby"] + pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Determine pointwise equivalence of two geometries, by checking if each vertex of g2 is"] + #[doc = " within tolerance of the corresponding vertex in g1."] + #[doc = " Unlike GEOSEquals(), geometries that are topologically equivalent but have different"] + #[doc = " representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not"] + #[doc = " considered equivalent by GEOSEqualsExact()."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\param tolerance Tolerance to determine vertex equality"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + pub fn GEOSEqualsExact( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " A \\ref GEOSPreparedGeometry is a wrapper around \\ref GEOSGeometry"] + #[doc = " that adds in a spatial index on the edges of the geometry. This"] + #[doc = " internal index allows spatial predicates to evaluate much faster,"] + #[doc = " so for cases in which the same base geometry will be used over and"] + #[doc = " over again for predicate tests, wrapping it in a \\ref GEOSPreparedGeometry"] + #[doc = " is a best practice."] + #[doc = ""] + #[doc = " The caller retains ownership of the base geometry, and after"] + #[doc = " processing is complete, must destroy **both** the prepared and the"] + #[doc = " base geometry. (Ideally, destroy the prepared geometry first, as"] + #[doc = " it has an internal reference to the base geometry.)"] + #[doc = ""] + #[doc = " \\param g The base geometry to wrap in a prepared geometry."] + #[doc = " \\return A prepared geometry. Caller is responsible for freeing with"] + #[doc = " GEOSPreparedGeom_destroy()"] + pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSPreparedGeometry."] + #[doc = " Caller must separately free the base \\ref GEOSGeometry used"] + #[doc = " to create the prepared geometry."] + #[doc = " \\param g Prepared geometry to destroy."] + pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry is contained."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSContains"] + pub fn GEOSPreparedContains( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry is contained properly."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSContainsProperly"] + pub fn GEOSPreparedContainsProperly( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry is covered by."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSCoveredBy"] + pub fn GEOSPreparedCoveredBy( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry covers."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSCovers"] + pub fn GEOSPreparedCovers( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry crosses."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSCrosses"] + pub fn GEOSPreparedCrosses( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry is disjoint."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSDisjoin"] + pub fn GEOSPreparedDisjoint( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry is disjoint."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSDisjoin"] + pub fn GEOSPreparedIntersects( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry overlaps."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSOverlaps"] + pub fn GEOSPreparedOverlaps( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry touches."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSTouches"] + pub fn GEOSPreparedTouches( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry is within."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSWithin"] + pub fn GEOSPreparedWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation to find the nearest points between the"] + #[doc = " prepared and provided geometry."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns A coordinate sequence containing the nearest points, or NULL on exception."] + #[doc = " The first point in the sequence is from the prepared geometry, and the"] + #[doc = " seconds is from the other argument."] + pub fn GEOSPreparedNearestPoints( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDistance do a high performance"] + #[doc = " calculation to find the distance points between the"] + #[doc = " prepared and provided geometry. Useful for situations where"] + #[doc = " one geometry is large and static and needs to be tested"] + #[doc = " against a large number of other geometries."] + #[doc = " \\param[in] pg1 The prepared geometry"] + #[doc = " \\param[in] g2 The geometry to test"] + #[doc = " \\param[out] dist Pointer to store the result in"] + #[doc = " \\return 1 on success"] + pub fn GEOSPreparedDistance( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDistanceWithin do a high performance"] + #[doc = " calculation to find whether the prepared and provided geometry"] + #[doc = " are within the given max distance."] + #[doc = " Useful for situations where"] + #[doc = " one geometry is large and static and needs to be tested"] + #[doc = " against a large number of other geometries."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\param dist The max distance"] + #[doc = " \\return 1 on success"] + pub fn GEOSPreparedDistanceWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Create a new \\ref GEOSSTRtree using the Sort-Tile-Recursive algorithm"] + #[doc = " ([STRtree](https://en.wikipedia.org/wiki/R-tree))"] + #[doc = " for two-dimensional spatial data."] + #[doc = ""] + #[doc = " \\param nodeCapacity The maximum number of child nodes that a node may have."] + #[doc = " The minimum recommended capacity value is 4."] + #[doc = " If unsure, use a default node capacity of 10."] + #[doc = " \\return a pointer to the created tree"] + pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; +} +extern "C" { + #[doc = " Insert an item into an \\ref GEOSSTRtree"] + #[doc = ""] + #[doc = " \\param tree the \\ref GEOSSTRtree in which the item should be inserted"] + #[doc = " \\param g a GEOSGeometry whose envelope corresponds to the extent of 'item'. As of GEOS 3.9, this envelope will be"] + #[doc = " copied into the tree and the caller may destroy `g` while the tree is still in use. Before GEOS 3.9, `g`"] + #[doc = " must be retained until the tree is destroyed."] + #[doc = " \\param item the item to insert into the tree"] + #[doc = " \\note The tree does **not** take ownership of the geometry or the item."] + pub fn GEOSSTRtree_insert( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " Query an \\ref GEOSSTRtree for items intersecting a specified envelope"] + #[doc = ""] + #[doc = " \\param tree the \\ref GEOSSTRtree to search"] + #[doc = " \\param g a GEOSGeomety from which a query envelope will be extracted"] + #[doc = " \\param callback a function to be executed for each item in the tree whose envelope intersects"] + #[doc = " the envelope of 'g'. The callback function should take two parameters: a void"] + #[doc = " pointer representing the located item in the tree, and a void userdata pointer."] + #[doc = " \\param userdata an optional pointer to pe passed to 'callback' as an argument"] + pub fn GEOSSTRtree_query( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " Returns the nearest item in the \\ref GEOSSTRtree to the supplied geometry."] + #[doc = " All items in the tree MUST be of type \\ref GEOSGeometry."] + #[doc = " If this is not the case, use GEOSSTRtree_nearest_generic() instead."] + #[doc = ""] + #[doc = " \\param tree the \\ref GEOSSTRtree to search"] + #[doc = " \\param geom the geometry with which the tree should be queried"] + #[doc = " \\return a const pointer to the nearest \\ref GEOSGeometry in the tree to 'geom', or NULL in"] + #[doc = " case of exception"] + pub fn GEOSSTRtree_nearest( + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " Returns the nearest item in the \\ref GEOSSTRtree to the supplied item"] + #[doc = ""] + #[doc = " \\param tree the STRtree to search"] + #[doc = " \\param item the item with which the tree should be queried"] + #[doc = " \\param itemEnvelope a GEOSGeometry having the bounding box of 'item'"] + #[doc = " \\param distancefn a function that can compute the distance between two items"] + #[doc = " in the STRtree. The function should return zero in case of error,"] + #[doc = " and should store the computed distance to the location pointed to by"] + #[doc = " the 'distance' argument. The computed distance between two items"] + #[doc = " must not exceed the Cartesian distance between their envelopes."] + #[doc = " \\param userdata optional pointer to arbitrary data; will be passed to distancefn"] + #[doc = " each time it is called."] + #[doc = " \\return a const pointer to the nearest item in the tree to 'item', or NULL in"] + #[doc = " case of exception"] + pub fn GEOSSTRtree_nearest_generic( + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + #[doc = " Iterate over all items in the \\ref GEOSSTRtree."] + #[doc = ""] + #[doc = " \\param tree the STRtree over which to iterate"] + #[doc = " \\param callback a function to be executed for each item in the tree."] + #[doc = " \\param userdata payload to pass the callback function."] + pub fn GEOSSTRtree_iterate( + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " Removes an item from the \\ref GEOSSTRtree"] + #[doc = ""] + #[doc = " \\param tree the STRtree from which to remove an item"] + #[doc = " \\param g the envelope of the item to remove"] + #[doc = " \\param item the item to remove"] + #[doc = " \\return 0 if the item was not removed;"] + #[doc = " 1 if the item was removed;"] + #[doc = " 2 if an exception occurred"] + pub fn GEOSSTRtree_remove( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Frees all the memory associated with a \\ref GEOSSTRtree."] + #[doc = " Only the tree is freed. The geometries and items fed into"] + #[doc = " GEOSSTRtree_insert() are not owned by the tree, and are"] + #[doc = " still left to the caller to manage."] + pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " Tests whether the input geometry is empty. If the geometry or any"] + #[doc = " component is non-empty, the geometry is non-empty. An empty geometry"] + #[doc = " has no boundary or interior."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Tests whether the input geometry is \"simple\". Mostly relevant for"] + #[doc = " linestrings. A \"simple\" linestring has no self-intersections."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Tests whether the input geometry is a ring. Rings are"] + #[doc = " linestrings, without self-intersections,"] + #[doc = " with start and end point being identical."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Tests whether the input geometry has z coordinates."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Tests whether the input geometry is closed."] + #[doc = " A closed geometry is a linestring or multilinestring"] + #[doc = " with the start and end points being the same."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Calculate the DE9IM pattern for this geometry pair"] + #[doc = " and compare against the provided pattern to check for"] + #[doc = " consistency. If the result and pattern are consistent"] + #[doc = " return true. The pattern may include glob \"*\" characters"] + #[doc = " for portions that are allowed to match any value."] + #[doc = " \\see geos::geom::Geometry::relate"] + #[doc = " \\param g1 First geometry in pair"] + #[doc = " \\param g2 Second geometry in pair"] + #[doc = " \\param pat DE9IM pattern to check"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSRelatePattern( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Calculate and return the DE9IM pattern for this geometry pair."] + #[doc = " \\see geos::geom::Geometry::relate"] + #[doc = " \\param g1 First geometry in pair"] + #[doc = " \\param g2 Second geometry in pair"] + #[doc = " \\return DE9IM string. Caller is responsible for freeing with GEOSFree()."] + #[doc = " NULL on exception"] + pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Compare two DE9IM patterns and return true if they"] + #[doc = " are consistent."] + #[doc = " \\param mat Complete DE9IM string (does not have \"*\")"] + #[doc = " \\param pat Pattern to match to (may contain \"*\")"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSRelatePatternMatch( + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Calculate and return the DE9IM pattern for this geometry pair."] + #[doc = " Apply the supplied \\ref GEOSRelateBoundaryNodeRules."] + #[doc = " \\see geos::geom::Geometry::relate"] + #[doc = " \\see geos::algorithm::BoundaryNodeRule"] + #[doc = " \\param g1 First geometry in pair"] + #[doc = " \\param g2 Second geometry in pair"] + #[doc = " \\param bnr A member of the \\ref GEOSRelateBoundaryNodeRules enum"] + #[doc = " \\return DE9IM string. Caller is responsible for freeing with GEOSFree()."] + #[doc = " NULL on exception"] + pub fn GEOSRelateBoundaryNodeRule( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Check the validity of the provided geometry."] + #[doc = " - All points are valid."] + #[doc = " - All non-zero-length linestrings are valid."] + #[doc = " - Polygon rings must be non-self-intersecting, and interior rings"] + #[doc = " contained within exterior rings."] + #[doc = " - Multi-polygon components may not touch or overlap."] + #[doc = ""] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::operation::valid::isValidOp"] + pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Return the human readable reason a geometry is invalid,"] + #[doc = " \"Valid Geometry\" string otherwise, or NULL on exception."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return A string with the reason, NULL on exception."] + #[doc = "Caller must GEOSFree() their result."] + pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + #[doc = " In one step, calculate and return the validity, the"] + #[doc = " human readable validity reason and a point at which validity"] + #[doc = " rules are broken."] + #[doc = " Caller has the responsibility to destroy 'reason' with GEOSFree()"] + #[doc = " and 'location' with GEOSGeom_destroy()"] + #[doc = " \\param g The geometry to test"] + #[doc = " \\param flags A value from the \\ref GEOSValidFlags enum"] + #[doc = " \\param reason A pointer in which the reason string will be places"] + #[doc = " \\param location A pointer in which the location GEOSGeometry will be placed"] + #[doc = " \\return 1 when valid, 0 when invalid, 2 on exception"] + pub fn GEOSisValidDetail( + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Repair an invalid geometry, returning a valid output."] + #[doc = " \\param g The geometry to repair"] + #[doc = " \\return The repaired geometry. Caller must free with GEOSGeom_destroy()."] + pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Repair an invalid geometry, returning a valid output, using the"] + #[doc = " indicated GEOSMakeValidMethods algorithm and options."] + #[doc = " \\param g is the geometry to test."] + #[doc = " \\param makeValidParams is a GEOSMakeValidParams with the desired parameters set on it."] + #[doc = " \\return A repaired geometry. Caller must free with GEOSGeom_destroy()."] + #[doc = " \\see GEOSMakeValidParams_create"] + #[doc = " \\see GEOSMakeValidParams_destroy"] + #[doc = " \\see GEOSMakeValidParams_setMethod"] + #[doc = " \\see GEOSMakeValidParams_setKeepCollapsed"] + pub fn GEOSMakeValidWithParams( + g: *const GEOSGeometry, + makeValidParams: *const GEOSMakeValidParams, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a GEOSMakeValidParams to hold the desired parameters"] + #[doc = " to control the algorithm and behavior of the validation process."] + #[doc = " \\return a parameter object"] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidParams_create() -> *mut GEOSMakeValidParams; +} +extern "C" { + #[doc = " Destroy a GEOSMakeValidParams."] + #[doc = " \\param parms the object to destroy"] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidParams_destroy(parms: *mut GEOSMakeValidParams); +} +extern "C" { + #[doc = " Set the GEOSMakeValidMethods to use in making the geometry"] + #[doc = " valid."] + #[doc = " \\return 0 on exception, 1 on success."] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidParams_setMethod( + p: *mut GEOSMakeValidParams, + method: GEOSMakeValidMethods, + ) -> libc::c_int; +} +extern "C" { + #[doc = " When this parameter is not set to 0, the GEOS_MAKE_VALID_STRUCTURE method will drop"] + #[doc = " any component that has collapsed into a lower dimensionality."] + #[doc = " For example, a ring collapsing to a line, or a line collapsing"] + #[doc = " to a point."] + #[doc = " \\return 0 on exception, 1 on success."] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidParams_setKeepCollapsed( + p: *mut GEOSMakeValidParams, + keepCollapsed: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the geometry type string for this geometry."] + #[doc = " eg: \"GeometryCollection\", \"LineString\""] + #[doc = " \\param g Input geometry"] + #[doc = " \\return A string with the geometry type."] + #[doc = " Caller must free with GEOSFree()."] + #[doc = " NULL on exception."] + pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Returns the \\ref GEOSGeomTypeId number for this geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return The geometry type number, or -1 on exception."] + pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the \"spatial reference id\" (SRID) for this geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return SRID number or 0 if unknown / not set."] + pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Set the \"spatial reference id\" (SRID) for this geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\param SRID SRID number or 0 for unknown SRID."] + pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + #[doc = " Return the anonymous \"user data\" for this geometry."] + #[doc = " User data must be managed by the caller, and freed before"] + #[doc = " the geometry is freed."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return A void* to the user data, caller is responsible for"] + #[doc = " casting to the appropriate type and freeing."] + pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; +} +extern "C" { + #[doc = " Set the anonymous \"user data\" for this geometry."] + #[doc = " Don't forget to free the user data before freeing the geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\param userData Void pointer to user data"] + pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); +} +extern "C" { + #[doc = " Returns the number of sub-geometries immediately under a"] + #[doc = " multi-geometry or collection or 1 for a simple geometry."] + #[doc = " For nested collections, remember to check if returned"] + #[doc = " sub-geometries are **themselves** also collections."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return Number of direct children in this collection"] + #[doc = " \\warning For GEOS < 3.2 this function may crash when fed simple geometries"] + pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the specified sub-geometry of a collection. For"] + #[doc = " a simple geometry, returns a pointer to the input."] + #[doc = " Returned object is a pointer to internal storage:"] + #[doc = " it must NOT be destroyed directly."] + #[doc = " \\param g Input geometry"] + #[doc = " \\param n Sub-geometry index, zero-base"] + #[doc = " \\return A const \\ref GEOSGeometry, do not free!"] + #[doc = "It will be freed when the parent is freed."] + #[doc = "Returns NULL on exception."] + #[doc = " \\note Up to GEOS 3.2.0 the input geometry must be a Collection, in"] + #[doc = " later versions it doesn't matter (getGeometryN(0) for a single will"] + #[doc = " return the input)."] + pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " Organize the sub-geometries, rings, and coordinate order"] + #[doc = " of geometries, so that geometries that represent the same"] + #[doc = " object can be easily compared. Starts rings from the same"] + #[doc = " location, orients them in the same way, sorts geometry"] + #[doc = " sub-components in the same way. Use before calling"] + #[doc = " GEOSEqualsExact() to avoid false \"not equal\" results."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return 0 on success or -1 on exception"] + pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Change the rounding precision on a geometry. This will"] + #[doc = " affect the precision of the existing geometry as well as"] + #[doc = " any geometries derived from this geometry using overlay"] + #[doc = " functions. The output will be a valid \\ref GEOSGeometry."] + #[doc = ""] + #[doc = " Note that operations will always be performed in the precision"] + #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] + #[doc = " That same precision will be attached to the operation outputs."] + #[doc = ""] + #[doc = " In the Default and GEOS_PREC_KEEP_COLLAPSED modes invalid input"] + #[doc = " may cause an error to occur, unless the invalidity is below"] + #[doc = " the scale of the requested precision"] + #[doc = ""] + #[doc = " There are only 3 modes. The GEOS_PREC_NO_TOPO mode"] + #[doc = " takes precedence over GEOS_PREC_KEEP_COLLAPSED."] + #[doc = " So the combination GEOS_PREC_NO_TOPO || GEOS_PREC_KEEP_COLLAPSED"] + #[doc = " has the same semantics as GEOS_PREC_NO_TOPO"] + #[doc = ""] + #[doc = " \\param g Input geometry"] + #[doc = " \\param gridSize cell size of grid to round coordinates to,"] + #[doc = " or 0 for FLOATING precision"] + #[doc = " \\param flags The bitwise OR of members of the \\ref GEOSPrecisionRules enum"] + #[doc = " \\return The precision reduced result."] + #[doc = " Caller must free with GEOSGeom_destroy()"] + #[doc = " NULL on exception."] + pub fn GEOSGeom_setPrecision( + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Read the currently set precision value from the"] + #[doc = " geometry and returns the grid size if it is a fixed"] + #[doc = " precision or 0.0 if it is full floating point precision."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return The grid size, or -1 on exception"] + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; +} +extern "C" { + #[doc = " Returns the number of interior rings, for a Polygon input, or"] + #[doc = " an exception otherwise."] + #[doc = " \\param g Input Polygon geometry"] + #[doc = " \\return Number of interior rings, -1 on exception"] + pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the number of points, for a LineString input, or"] + #[doc = " an exception otherwise."] + #[doc = " \\param g Input LineString geometry"] + #[doc = " \\return Number of points, -1 on exception"] + pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the X coordinate, for a Point input, or an"] + #[doc = " exception otherwise."] + #[doc = " \\param[in] g Input Point geometry"] + #[doc = " \\param[out] x Pointer to hold return value"] + #[doc = " \\returns 1 on success, 0 on exception"] + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the Y coordinate, for a Point input, or an"] + #[doc = " exception otherwise."] + #[doc = " \\param[in] g Input Point geometry"] + #[doc = " \\param[out] y Pointer to hold return value"] + #[doc = " \\returns 1 on success, 0 on exception"] + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the Z coordinate, for a Point input, or an"] + #[doc = " exception otherwise."] + #[doc = " \\param[in] g Input Point geometry"] + #[doc = " \\param[out] z Pointer to hold return value"] + #[doc = " \\returns 1 on success, 0 on exception"] + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the N'th ring for a Polygon input."] + #[doc = " \\note Returned object is a pointer to internal storage:"] + #[doc = " it must NOT be destroyed directly."] + #[doc = " \\param g Input Polygon geometry"] + #[doc = " \\param n Index of the desired ring"] + #[doc = " \\return LinearRing geometry. Owned by parent geometry, do not free. NULL on exception."] + pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " Get the external ring of a Polygon."] + #[doc = " \\note Returned object is a pointer to internal storage:"] + #[doc = " it must NOT be destroyed directly."] + #[doc = " \\param g Input Polygon geometry"] + #[doc = " \\return LinearRing geometry. Owned by parent geometry, do not free. NULL on exception."] + pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " Get the total number of points in a geometry,"] + #[doc = " of any type."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return Number of points in the geometry. -1 on exception."] + pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Return the coordinate sequence underlying the"] + #[doc = " given geometry (Must be a LineString, LinearRing or Point)."] + #[doc = " Do not directly free the coordinate sequence, it is owned by"] + #[doc = " the parent geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return Coordinate sequence or NULL on exception."] + pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; +} +extern "C" { + #[doc = " Return the planar dimensionality of the geometry."] + #[doc = ""] + #[doc = " - 0 for point, multipoint"] + #[doc = " - 1 for linestring, multilinestring"] + #[doc = " - 2 for polygon, multipolygon"] + #[doc = ""] + #[doc = " \\see geos::geom::Dimension::DimensionType"] + #[doc = " \\param g Input geometry"] + #[doc = " \\return The dimensionality"] + pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Return the cartesian dimension of the geometry."] + #[doc = ""] + #[doc = " - 2 for XY data"] + #[doc = " - 3 for XYZ data"] + #[doc = ""] + #[doc = " \\param g Input geometry"] + #[doc = " \\return The dimension"] + pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the minimum X value in the geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] value Pointer to place result"] + #[doc = " \\return 0 on exception"] + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the minimum Y value in the geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] value Pointer to place result"] + #[doc = " \\return 0 on exception"] + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the maximum X value in the geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] value Pointer to place result"] + #[doc = " \\return 0 on exception"] + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the maximum Y value in the geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] value Pointer to place result"] + #[doc = " \\return 0 on exception"] + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Return the N'th point of a LineString"] + #[doc = " \\param g Input geometry, must be a LineString"] + #[doc = " \\param n Index of desired point (zero based)"] + #[doc = " \\return A Point geometry."] + #[doc = " Caller must free with GEOSGeom_destroy()"] + #[doc = " NULL on exception."] + pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return the first point of a LineString"] + #[doc = " \\param g Input geometry, must be a LineString"] + #[doc = " \\return A Point geometry."] + #[doc = " Caller must free with GEOSGeom_destroy()"] + #[doc = " NULL on exception."] + pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return the last point of a LineString"] + #[doc = " \\param g Input geometry, must be a LineString"] + #[doc = " \\return A Point geometry."] + #[doc = " Caller must free with GEOSGeom_destroy()"] + #[doc = " NULL on exception."] + pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Calculate the area of a geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] area Pointer to be filled in with area result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the length of a geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] length Pointer to be filled in with length result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the distance between two geometries."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Test whether the distance between two geometries is"] + #[doc = " within the given dist."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\param dist The max distance"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + pub fn GEOSDistanceWithin( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Calculate the distance between two geometries, using the"] + #[doc = " indexed facet distance, which first indexes the geometries"] + #[doc = " internally, then calculates the distance. Useful when one"] + #[doc = " or both geometries is very large."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::operation::distance:;IndexedFacetDistance"] + pub fn GEOSDistanceIndexed( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the Hausdorff distance between two geometries."] + #[doc = " [Hausdorff distance](https://en.wikipedia.org/wiki/Hausdorff_distance)"] + #[doc = " is the largest distance between two geometries."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::algorithm::distance::DiscreteHausdorffDistance"] + pub fn GEOSHausdorffDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate a more precise Hausdorff distance between two geometries,"] + #[doc = " by densifying the inputs before computation."] + #[doc = " [Hausdorff distance](https://en.wikipedia.org/wiki/Hausdorff_distance)"] + #[doc = " is the largest distance between two geometries."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[in] densifyFrac The largest % of the overall line length that"] + #[doc = " any given two-point segment should be"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::algorithm::distance::DiscreteHausdorffDistance"] + pub fn GEOSHausdorffDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the"] + #[doc = " [Frechet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance)"] + #[doc = " between two geometries,"] + #[doc = " a similarity measure for linear features."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::algorithm::distance::DiscreteFrechetDistance"] + pub fn GEOSFrechetDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the"] + #[doc = " [Frechet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance)"] + #[doc = " between two geometries,"] + #[doc = " a similarity measure for linear features. For more precision, first"] + #[doc = " densify the inputs."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[in] densifyFrac The largest % of the overall line length that"] + #[doc = " any given two-point segment should be"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::algorithm::distance::DiscreteFrechetDistance"] + pub fn GEOSFrechetDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the length of a LineString."] + #[doc = " Only works for LineString inputs, returns exception otherwise."] + #[doc = ""] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] length Pointer to be filled in with length result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " The closest points of the two geometries."] + #[doc = " The first point comes from g1 geometry and the second point comes from g2."] + #[doc = ""] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\return A coordinate sequence with the two points, or NULL on exception."] + #[doc = " Caller must free with GEOSCoordSeq_destroy()."] + pub fn GEOSNearestPoints( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " For the points formed by the six input ordinates,"] + #[doc = " walking from A to B and then to P."] + #[doc = " \\param Ax X coordinate of A"] + #[doc = " \\param Ay Y coordinate of A"] + #[doc = " \\param Bx X coordinate of B"] + #[doc = " \\param By Y coordinate of B"] + #[doc = " \\param Px X coordinate of P"] + #[doc = " \\param Py Y coordinate of P"] + #[doc = " \\return -1 if reaching P takes a counter-clockwise (left) turn,"] + #[doc = " 1 if reaching P takes a clockwise (right) turn,"] + #[doc = " 0 if P is collinear with A-B"] + pub fn GEOSOrientationIndex( + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSWKTReader."] + #[doc = " \\returns a new reader. Caller must free with GEOSWKTReader_destroy()"] + pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSWKTReader."] + #[doc = " \\param reader The reader to destroy."] + pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); +} +extern "C" { + #[doc = " Use a reader to parse the well-known text representation of"] + #[doc = " a geometry, and return an allocated geometry."] + #[doc = " \\param reader A WKT reader object, caller retains ownership"] + #[doc = " \\param wkt The WKT string to parse, caller retains ownership"] + #[doc = " \\return A \\ref GEOSGeometry, caller to free with GEOSGeom_destroy())"] + pub fn GEOSWKTReader_read( + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSWKTWriter."] + #[doc = " \\returns a new writer. Caller must free with GEOSWKTWriter_destroy()"] + pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSWKTWriter."] + #[doc = " \\param writer The writer to destroy."] + pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); +} +extern "C" { + #[doc = " Writes out the well-known text representation of a geometry,"] + #[doc = " using the trim, rounding and dimension settings of the writer."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return A newly allocated string containing the WKT output or NULL on exception."] + #[doc = " Caller must free with GEOSFree()"] + pub fn GEOSWKTWriter_write( + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Sets the number trimming option on a \\ref GEOSWKTWriter."] + #[doc = " With trim set to 1, the writer will strip trailing 0's from"] + #[doc = " the output coordinates. With 0, all coordinates will be"] + #[doc = " padded with 0's out to the rounding precision."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param trim The trimming behaviour to set, 1 for 'on', 0 for 'off', default 'off'"] + pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); +} +extern "C" { + #[doc = " Sets the number places after the decimal to output in"] + #[doc = " WKT."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param precision The desired precision, default 16."] + pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); +} +extern "C" { + #[doc = " Sets whether or not to write out XY or XYZ coordinates."] + #[doc = " Legal values are 2 or 3."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param dim The desired dimension, default 2."] + pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); +} +extern "C" { + #[doc = " Reads the current output dimension from a \\ref GEOSWKTWriter."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\return The current dimension."] + pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; +} +extern "C" { + #[doc = " Sets the format for 3D outputs. The \"old 3D\" format does not"] + #[doc = " include a dimensionality tag, eg. \"POINT(1 2 3)\" while the new (ISO)"] + #[doc = " format does includes a tag, eg \"POINT Z (1 2 3)\"."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param useOld3D True to use the old format, false is the default."] + pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSWKBReader."] + #[doc = " \\returns a new reader. Caller must free with GEOSWKBReader_destroy()"] + pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSWKBReader."] + #[doc = " \\param reader The reader to destroy."] + pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); +} +extern "C" { + #[doc = " Read a geometry from a well-known binary buffer."] + #[doc = " \\param reader A \\ref GEOSWKBReader"] + #[doc = " \\param wkb A pointer to the buffer to read from"] + #[doc = " \\param size The number of bytes of data in the buffer"] + #[doc = " \\return A \\ref GEOSGeometry built from the WKB, or NULL on exception."] + pub fn GEOSWKBReader_read( + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Read a geometry from a **hex encoded** well-known binary buffer."] + #[doc = " \\param reader A \\ref GEOSWKBReader"] + #[doc = " \\param hex A pointer to the buffer to read from"] + #[doc = " \\param size The number of bytes of data in the buffer"] + #[doc = " \\return A \\ref GEOSGeometry built from the HEX WKB, or NULL on exception."] + pub fn GEOSWKBReader_readHEX( + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSWKBWriter."] + #[doc = " \\returns a new writer. Caller must free with GEOSWKBWriter_destroy()"] + pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSWKBWriter."] + #[doc = " \\param writer The writer to destroy."] + pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); +} +extern "C" { + #[doc = " Write out the WKB representation of a geometry."] + #[doc = " \\param writer The \\ref GEOSWKBWriter controlling the"] + #[doc = " writing."] + #[doc = " \\param g Geometry to convert to WKB"] + #[doc = " \\param size Pointer to write the size of the final output WKB to"] + #[doc = " \\return The WKB representation. Caller must free with GEOSFree()"] + pub fn GEOSWKBWriter_write( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Write out the **hex** WKB representation of a geometry."] + #[doc = " \\param writer The \\ref GEOSWKBWriter controlling the"] + #[doc = " writing."] + #[doc = " \\param g Geometry to convert to WKB"] + #[doc = " \\param size Pointer to write the size of the final output WKB to"] + #[doc = " \\return The HEX WKB representation. Caller must free with GEOSFree()"] + pub fn GEOSWKBWriter_writeHEX( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Read the current output dimension of the writer."] + #[doc = " Either 2 or 3 dimensions."] + #[doc = " Return current number of dimensions."] + #[doc = " \\param writer The writer to read from."] + #[doc = " \\return Number of dimensions (2 or 3)"] + pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + #[doc = " Set the output dimensionality of the writer. Either"] + #[doc = " 2 or 3 dimensions."] + #[doc = " \\param writer The writer to read from."] + #[doc = " \\param newDimension The dimensionality desired"] + pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); +} +extern "C" { + #[doc = " Find whether the writer will use WKB"] + #[doc = " [byte order](https://en.wikipedia.org/wiki/Endianness)"] + #[doc = " that is big or little endian."] + #[doc = " The return value is a member of \\ref GEOSWKBByteOrders."] + #[doc = " \\param writer The writer to read byte order from"] + #[doc = " \\return The current byte order"] + pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + #[doc = " Set the output byte order of the writer, using"] + #[doc = " a value from \\ref GEOSWKBByteOrders enum."] + #[doc = " \\param writer The writer to set byte order on"] + #[doc = " \\param byteOrder Desired byte order"] + pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); +} +extern "C" { + #[doc = " Find whether the writer will use"] + #[doc = " [WKB](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary)"] + #[doc = " that is ISO flavor or \"extended\" flavor. The flavor"] + #[doc = " determines how extra dimensionality is encoded with the"] + #[doc = " type number, and whether SRID can be included in the WKB."] + #[doc = " ISO flavor does not support SRID embedding. ISO flavor"] + #[doc = " is \"more standard\" for 3D output. GEOS can read both flavors."] + #[doc = " The return value is a member of \\ref GEOSWKBFlavors."] + #[doc = " \\param writer The writer to read flavor from"] + #[doc = " \\return The current flavor"] + pub fn GEOSWKBWriter_getFlavor(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + #[doc = " Set the output flavor of the writer, using"] + #[doc = " a value from \\ref GEOSWKBFlavors enum."] + #[doc = " \\param writer The writer to set flavor on"] + #[doc = " \\param flavor Desired flavor"] + pub fn GEOSWKBWriter_setFlavor(writer: *mut GEOSWKBWriter, flavor: libc::c_int); +} +extern "C" { + #[doc = " Read the current SRID embedding value from the writer."] + #[doc = " \\param writer The writer to check SRID value on"] + pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; +} +extern "C" { + #[doc = " Specify whether SRID values should be output in WKB."] + #[doc = " Many WKB readers do not support SRID values, use with caution."] + #[doc = " \\param writer The writer to set SRID output on"] + #[doc = " \\param writeSRID Set to 1 to include SRID, 0 otherwise"] + pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); +} +extern "C" { + #[doc = " Free strings and byte buffers returned by functions such"] + #[doc = " as GEOSWKBWriter_write(),"] + #[doc = " GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(), etc."] + #[doc = " \\param buffer The memory to free"] + pub fn GEOSFree(buffer: *mut libc::c_void); +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSGeoJSONReader."] + #[doc = " \\returns a new reader. Caller must free with GEOSGeoJSONReader_destroy()"] + pub fn GEOSGeoJSONReader_create() -> *mut GEOSGeoJSONReader; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSGeoJSONReader."] + #[doc = " \\param reader The reader to destroy."] + pub fn GEOSGeoJSONReader_destroy(reader: *mut GEOSGeoJSONReader); +} +extern "C" { + #[doc = " Use a reader to parse a GeoJSON. A single geometry or feature is"] + #[doc = " converted into a geometry. A featurecollection is converted into a"] + #[doc = " geometrycollection. Feature properties are not read."] + #[doc = " \\param reader A GeoJSON reader object, caller retains ownership"] + #[doc = " \\param geojson The json string to parse, caller retains ownership"] + #[doc = " \\return A \\ref GEOSGeometry, caller to free with GEOSGeom_destroy())"] + pub fn GEOSGeoJSONReader_readGeometry( + reader: *mut GEOSGeoJSONReader, + geojson: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSGeoJSONWriter."] + #[doc = " \\returns a new writer. Caller must free with GEOSGeoJSONWriter_destroy()"] + pub fn GEOSGeoJSONWriter_create() -> *mut GEOSGeoJSONWriter; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSGeoJSONWriter."] + #[doc = " \\param writer The writer to destroy."] + pub fn GEOSGeoJSONWriter_destroy(writer: *mut GEOSGeoJSONWriter); +} +extern "C" { + #[doc = " Write out the GeoJSON representation of a geometry. Note that writing a GeoJSON"] + #[doc = " Feature or FeatureCollection is unsupported through the GEOS C API."] + #[doc = " \\param writer A GeoJSON reader object, caller retains ownership."] + #[doc = " \\param g The geometry to convert, caller retains ownership."] + #[doc = " \\param indent The indentation used. Use -1 for no formatting."] + #[doc = " \\return A char pointer, caller to free with GEOSFree())"] + pub fn GEOSGeoJSONWriter_writeGeometry( + writer: *mut GEOSGeoJSONWriter, + g: *const GEOSGeometry, + indent: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getOutputDimension_r()"] + pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setOutputDimension_r()"] + pub fn GEOS_setWKBOutputDims_r( + handle: GEOSContextHandle_t, + newDims: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getByteOrder_r()"] + pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setByteOrder_r()"] + pub fn GEOS_setWKBByteOrder_r( + handle: GEOSContextHandle_t, + byteOrder: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBReader_read_r()"] + pub fn GEOSGeomFromWKB_buf_r( + handle: GEOSContextHandle_t, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_write_r()"] + pub fn GEOSGeomToWKB_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBReader_readHEX_r()"] + pub fn GEOSGeomFromHEX_buf_r( + handle: GEOSContextHandle_t, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_writeHEX_r()"] + pub fn GEOSGeomToHEX_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOS_getWKBOutputDims()"] + pub fn GEOS_getWKBOutputDims() -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOS_setWKBOutputDims()"] + pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getByteOrder()"] + pub fn GEOS_getWKBByteOrder() -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setByteOrder()"] + pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBWriter_read()"] + pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_write()"] + pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBWriter_readHEX()"] + pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_writeHEX()"] + pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} diff --git a/sys/prebuilt-bindings/geos_3.11.rs b/sys/prebuilt-bindings/geos_3.11.rs new file mode 100644 index 0000000..cd3fff6 --- /dev/null +++ b/sys/prebuilt-bindings/geos_3.11.rs @@ -0,0 +1,4971 @@ +/* automatically generated by rust-bindgen 0.60.1 */ + +pub const GEOS_VERSION_MAJOR: u32 = 3; +pub const GEOS_VERSION_MINOR: u32 = 11; +pub const GEOS_VERSION: &[u8; 12usize] = b"3.11.0beta2\0"; +pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.18.0\0"; +pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; +pub const GEOS_CAPI_VERSION_MINOR: u32 = 16; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 0; +pub const GEOS_CAPI_VERSION: &[u8; 24usize] = b"3.11.0beta2-CAPI-1.16.0\0"; +pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; +pub const GEOS_CAPI_LAST_INTERFACE: u32 = 17; +pub type wchar_t = libc::c_int; +pub type max_align_t = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSContextHandle_HS { + _unused: [u8; 0], +} +#[doc = " Type returned by GEOS_init_r(), for use in multi-threaded"] +#[doc = " applications."] +#[doc = ""] +#[doc = " There should be only one GEOSContextHandle_t per thread."] +pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; +#[doc = " Callback function for passing GEOS error messages to parent process."] +#[doc = ""] +#[doc = " Set the GEOSMessageHandler for error and notice messages in \\ref initGEOS"] +#[doc = " for single-threaded programs, or using \\ref initGEOS_r for threaded"] +#[doc = " programs"] +#[doc = ""] +#[doc = " \\param fmt the message format template"] +pub type GEOSMessageHandler = + ::std::option::Option; +#[doc = " A GEOS message handler function."] +#[doc = ""] +#[doc = " \\param message the message contents"] +#[doc = " \\param userdata the user data pointer that was passed to GEOS when"] +#[doc = " registering this message handler."] +#[doc = ""] +#[doc = " \\see GEOSContext_setErrorMessageHandler"] +#[doc = " \\see GEOSContext_setNoticeMessageHandler"] +pub type GEOSMessageHandler_r = ::std::option::Option< + unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeom_t { + _unused: [u8; 0], +} +#[doc = " Geometry generic type. Geometry can be a point, linestring, polygon,"] +#[doc = " multipoint, multilinestring, multipolygon, or geometrycollection."] +#[doc = " Geometry type can be read with \\ref GEOSGeomTypeId. Most functions"] +#[doc = " in GEOS either have GEOSGeometry* as a parameter or a return type."] +#[doc = " \\see GEOSGeom_createPoint"] +#[doc = " \\see GEOSGeom_createLineString"] +#[doc = " \\see GEOSGeom_createPolygon"] +#[doc = " \\see GEOSGeom_createCollection"] +#[doc = " \\see GEOSGeom_destroy"] +pub type GEOSGeometry = GEOSGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSPrepGeom_t { + _unused: [u8; 0], +} +#[doc = " Prepared geometry type."] +#[doc = " \\see GEOSPrepare()"] +#[doc = " \\see GEOSPreparedGeom_destroy()"] +pub type GEOSPreparedGeometry = GEOSPrepGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSCoordSeq_t { + _unused: [u8; 0], +} +#[doc = " Coordinate sequence."] +#[doc = " \\see GEOSCoordSeq_create()"] +#[doc = " \\see GEOSCoordSeq_destroy()"] +pub type GEOSCoordSequence = GEOSCoordSeq_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSSTRtree_t { + _unused: [u8; 0], +} +#[doc = " STRTree index."] +#[doc = " \\see GEOSSTRtree_create()"] +#[doc = " \\see GEOSSTRtree_destroy()"] +pub type GEOSSTRtree = GEOSSTRtree_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSBufParams_t { + _unused: [u8; 0], +} +#[doc = " Parameter object for buffering."] +#[doc = " \\see GEOSBufferParams_create()"] +#[doc = " \\see GEOSBufferParams_destroy()"] +pub type GEOSBufferParams = GEOSBufParams_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSMakeValidParams_t { + _unused: [u8; 0], +} +#[doc = " Parameter object for validity enforcement."] +#[doc = " \\see GEOSMakeValidParams_create()"] +#[doc = " \\see GEOSMakeValidParams_destroy()"] +pub type GEOSMakeValidParams = GEOSMakeValidParams_t; +#[doc = " \\cond"] +pub type GEOSGeom = *mut GEOSGeometry; +pub type GEOSCoordSeq = *mut GEOSCoordSequence; +#[doc = " Point"] +pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; +#[doc = " Linestring"] +pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; +#[doc = " Linear ring, used within polygons"] +pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; +#[doc = " Polygon"] +pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; +#[doc = " Multipoint, a homogeneous collection of points"] +pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; +#[doc = " Multilinestring, a homogeneous collection of linestrings"] +pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; +#[doc = " Multipolygon, a homogeneous collection of polygons"] +pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; +#[doc = " Geometry collection, a heterogeneous collection of geometry"] +pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; +#[doc = " Geometry type number, used by functions returning or"] +#[doc = " consuming geometry types."] +#[doc = ""] +#[doc = " \\see GEOSGeomType"] +#[doc = " \\see GEOSGeomTypeId"] +pub type GEOSGeomTypes = libc::c_uint; +#[doc = " Big Endian"] +pub const GEOSWKBByteOrders_GEOS_WKB_XDR: GEOSWKBByteOrders = 0; +#[doc = " Little Endian"] +pub const GEOSWKBByteOrders_GEOS_WKB_NDR: GEOSWKBByteOrders = 1; +#[doc = " Well-known binary byte orders used when"] +#[doc = " writing to WKB."] +#[doc = ""] +#[doc = " \\see GEOSWKBWriter_setByteOrder"] +pub type GEOSWKBByteOrders = libc::c_uint; +#[doc = " Extended"] +pub const GEOSWKBFlavors_GEOS_WKB_EXTENDED: GEOSWKBFlavors = 1; +#[doc = " ISO"] +pub const GEOSWKBFlavors_GEOS_WKB_ISO: GEOSWKBFlavors = 2; +#[doc = " Well-known binary flavors to use"] +#[doc = " when writing to WKB. ISO flavour is"] +#[doc = " more standard. Extended flavour supports"] +#[doc = " 3D and SRID embedding. GEOS reads both"] +#[doc = " transparently."] +#[doc = ""] +#[doc = " \\see GEOSWKBWriter_setFlavor"] +pub type GEOSWKBFlavors = libc::c_uint; +#[doc = " Callback function for use in spatial index search calls. Pass into"] +#[doc = " the query function and handle query results as the index"] +#[doc = " returns them."] +#[doc = ""] +#[doc = " \\see GEOSSTRtree_query"] +pub type GEOSQueryCallback = ::std::option::Option< + unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), +>; +#[doc = " Callback function for use in spatial index nearest neighbor calculations."] +#[doc = " Allows custom distance to be calculated between items in the"] +#[doc = " index. Is passed two items, and sets the calculated distance"] +#[doc = " between the items into the distance pointer. Extra data for the"] +#[doc = " calculation can be passed via the userdata."] +#[doc = ""] +#[doc = " \\param item1 first of the pair of items to calculate distance between"] +#[doc = " \\param item2 second of the pair of items to calculate distance between"] +#[doc = " \\param distance the distance between the items here"] +#[doc = " \\param userdata extra data for the calculation"] +#[doc = ""] +#[doc = " \\return zero if distance calculation succeeded, non-zero otherwise"] +#[doc = ""] +#[doc = " \\see GEOSSTRtree_nearest_generic"] +#[doc = " \\see GEOSSTRtree_iterate"] +pub type GEOSDistanceCallback = ::std::option::Option< + unsafe extern "C" fn( + item1: *const libc::c_void, + item2: *const libc::c_void, + distance: *mut f64, + userdata: *mut libc::c_void, + ) -> libc::c_int, +>; +#[doc = " Callback function for use in GEOSGeom_transformXY."] +#[doc = " Allows custom function to be applied to x and y values for each coordinate"] +#[doc = " in a geometry. Z values are unchanged by this function."] +#[doc = " Extra data for the calculation can be passed via the userdata."] +#[doc = ""] +#[doc = " \\param x coordinate value to be updated"] +#[doc = " \\param y coordinate value to be updated"] +#[doc = " \\param userdata extra data for the calculation"] +#[doc = ""] +#[doc = " \\return 1 if calculation succeeded, 0 on failure"] +pub type GEOSTransformXYCallback = ::std::option::Option< + unsafe extern "C" fn(x: *mut f64, y: *mut f64, userdata: *mut libc::c_void) -> libc::c_int, +>; +#[doc = " Callback function for use in interruption. The callback will be invoked _before_ checking for"] +#[doc = " interruption, so can be used to request it."] +#[doc = ""] +#[doc = " \\see GEOS_interruptRegisterCallback"] +#[doc = " \\see GEOS_interruptRequest"] +#[doc = " \\see GEOS_interruptCancel"] +pub type GEOSInterruptCallback = ::std::option::Option; +extern "C" { + #[doc = " Register a function to be called when processing is interrupted."] + #[doc = " \\param cb Callback function to invoke"] + #[doc = " \\return the previously configured callback"] + #[doc = " \\see GEOSInterruptCallback"] + pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; +} +extern "C" { + #[doc = " Request safe interruption of operations"] + pub fn GEOS_interruptRequest(); +} +extern "C" { + #[doc = " Cancel a pending interruption request"] + pub fn GEOS_interruptCancel(); +} +extern "C" { + #[doc = " Initialize a context for this thread. Pass this context into"] + #[doc = " your other calls of `*_r` functions."] + #[doc = " \\return a GEOS context for this thread"] + pub fn GEOS_init_r() -> GEOSContextHandle_t; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSContextHandle_t"] + #[doc = " when you are finished calling GEOS functions."] + #[doc = " \\param handle to be freed"] + pub fn GEOS_finish_r(handle: GEOSContextHandle_t); +} +extern "C" { + #[doc = " Set the notice handler callback function for run-time notice messages."] + #[doc = " \\param extHandle the context returned by \\ref GEOS_init_r."] + #[doc = " \\param nf the handler callback"] + #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] + pub fn GEOSContext_setNoticeHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + #[doc = " Set the notice handler callback function for run-time error messages."] + #[doc = " \\param extHandle the GEOS context from \\ref GEOS_init_r"] + #[doc = " \\param ef the handler callback"] + #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] + pub fn GEOSContext_setErrorHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + #[doc = " Sets a notice message handler on the given GEOS context."] + #[doc = " \\param extHandle the GEOS context from \\ref GEOS_init_r"] + #[doc = " \\param nf the message handler"] + #[doc = " \\param userData optional user data pointer that will be passed to the message handler"] + #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] + pub fn GEOSContext_setNoticeMessageHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + #[doc = " Sets an error message handler on the given GEOS context."] + #[doc = ""] + #[doc = " \\param extHandle the GEOS context"] + #[doc = " \\param ef the message handler"] + #[doc = " \\param userData optional user data pointer that will be passed to the message handler"] + #[doc = ""] + #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] + pub fn GEOSContext_setErrorMessageHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_create"] + pub fn GEOSCoordSeq_create_r( + handle: GEOSContextHandle_t, + size: libc::c_uint, + dims: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_copyFromBuffer"] + pub fn GEOSCoordSeq_copyFromBuffer_r( + handle: GEOSContextHandle_t, + buf: *const f64, + size: libc::c_uint, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_copyFromArrays"] + pub fn GEOSCoordSeq_copyFromArrays_r( + handle: GEOSContextHandle_t, + x: *const f64, + y: *const f64, + z: *const f64, + m: *const f64, + size: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_copyToBuffer"] + pub fn GEOSCoordSeq_copyToBuffer_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + buf: *mut f64, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_copyToArrays"] + pub fn GEOSCoordSeq_copyToArrays_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + x: *mut f64, + y: *mut f64, + z: *mut f64, + m: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_clone"] + pub fn GEOSCoordSeq_clone_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_destroy"] + pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setX"] + pub fn GEOSCoordSeq_setX_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setY"] + pub fn GEOSCoordSeq_setY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setZ"] + pub fn GEOSCoordSeq_setZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setXY"] + pub fn GEOSCoordSeq_setXY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setXYZ"] + pub fn GEOSCoordSeq_setXYZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + z: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_setOrdinate"] + pub fn GEOSCoordSeq_setOrdinate_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getX"] + pub fn GEOSCoordSeq_getX_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getY"] + pub fn GEOSCoordSeq_getY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getZ"] + pub fn GEOSCoordSeq_getZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getXY"] + pub fn GEOSCoordSeq_getXY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getXYZ"] + pub fn GEOSCoordSeq_getXYZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getOrdinate"] + pub fn GEOSCoordSeq_getOrdinate_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getSize"] + pub fn GEOSCoordSeq_getSize_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_getDimensions"] + pub fn GEOSCoordSeq_getDimensions_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSCoordSeq_isCCW"] + pub fn GEOSCoordSeq_isCCW_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSProject"] + pub fn GEOSProject_r( + handle: GEOSContextHandle_t, + line: *const GEOSGeometry, + point: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + #[doc = " \\see GEOSInterpolate"] + pub fn GEOSInterpolate_r( + handle: GEOSContextHandle_t, + line: *const GEOSGeometry, + d: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSProjectNormalized"] + pub fn GEOSProjectNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + #[doc = " \\see GEOSInterpolateNormalized"] + pub fn GEOSInterpolateNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSBuffer"] + pub fn GEOSBuffer_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +#[doc = " End is rounded, with end point of original line in the centre of the round cap."] +pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; +#[doc = " End is flat, with end point of original line at the end of the buffer"] +pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; +#[doc = " End is flat, with end point of original line in the middle of a square enclosing that point"] +pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; +#[doc = " Cap styles control the ends of buffered lines."] +#[doc = " \\see GEOSBuffer"] +pub type GEOSBufCapStyles = libc::c_uint; +#[doc = " Join is rounded, essentially each line is terminated"] +#[doc = " in a round cap. Form round corner."] +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; +#[doc = " Join is flat, with line between buffer edges,"] +#[doc = " through the join point. Forms flat corner."] +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; +#[doc = " Join is the point at which the two buffer edges intersect."] +#[doc = " Forms sharp corner."] +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; +#[doc = " Join styles control the buffer shape at bends in a line."] +#[doc = " \\see GEOSBuffer"] +pub type GEOSBufJoinStyles = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSBufferParams_create"] + pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_destroy"] + pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setEndCapStyle"] + pub fn GEOSBufferParams_setEndCapStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setJoinStyle"] + pub fn GEOSBufferParams_setJoinStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setMitreLimit"] + pub fn GEOSBufferParams_setMitreLimit_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + mitreLimit: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setQuadrantSegments"] + pub fn GEOSBufferParams_setQuadrantSegments_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferParams_setSingleSided"] + pub fn GEOSBufferParams_setSingleSided_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSBufferWithParams"] + pub fn GEOSBufferWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSBufferWithStyle"] + pub fn GEOSBufferWithStyle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSDensify"] + pub fn GEOSDensify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSOffsetCurve"] + pub fn GEOSOffsetCurve_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createPoint"] + pub fn GEOSGeom_createPoint_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createPointFromXY"] + pub fn GEOSGeom_createPointFromXY_r( + handle: GEOSContextHandle_t, + x: f64, + y: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createEmptyPoint"] + pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createLinearRing"] + pub fn GEOSGeom_createLinearRing_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createLineString"] + pub fn GEOSGeom_createLineString_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createEmptyLineString"] + pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createEmptyPolygon"] + pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createPolygon"] + pub fn GEOSGeom_createPolygon_r( + handle: GEOSContextHandle_t, + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createCollection"] + pub fn GEOSGeom_createCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createEmptyCollection"] + pub fn GEOSGeom_createEmptyCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_createRectangle"] + pub fn GEOSGeom_createRectangle_r( + handle: GEOSContextHandle_t, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_clone"] + pub fn GEOSGeom_clone_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_destroy"] + pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " \\see GEOSEnvelope"] + pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSIntersection"] + pub fn GEOSIntersection_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSIntersectionPrec"] + pub fn GEOSIntersectionPrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSConvexHull"] + pub fn GEOSConvexHull_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSConcaveHull"] + pub fn GEOSConcaveHull_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ratio: f64, + allowHoles: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonHullSimplify"] + pub fn GEOSPolygonHullSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + isOuter: libc::c_uint, + vertexNumFraction: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonHullSimplifyByArea"] + pub fn GEOSPolygonHullSimplifyMode_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + isOuter: libc::c_uint, + parameterMode: libc::c_uint, + parameter: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSConcaveHullOfPolygons"] + pub fn GEOSConcaveHullOfPolygons_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + lengthRatio: f64, + isTight: libc::c_uint, + isHolesAllowed: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumRotatedRectangle"] + pub fn GEOSMinimumRotatedRectangle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMaximumInscribedCircle"] + pub fn GEOSMaximumInscribedCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSLargestEmptyCircle"] + pub fn GEOSLargestEmptyCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + boundary: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumWidth"] + pub fn GEOSMinimumWidth_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumClearanceLine"] + pub fn GEOSMinimumClearanceLine_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumClearance"] + pub fn GEOSMinimumClearance_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + distance: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSDifference"] + pub fn GEOSDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSDifferencePrec"] + pub fn GEOSDifferencePrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSymDifference"] + pub fn GEOSSymDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSymDifferencePrec"] + pub fn GEOSSymDifferencePrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSBoundary"] + pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSUnion"] + pub fn GEOSUnion_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSUnionPrec"] + pub fn GEOSUnionPrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSUnaryUnion"] + pub fn GEOSUnaryUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSUnaryUnionPrec"] + pub fn GEOSUnaryUnionPrec_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSCoverageUnion"] + pub fn GEOSCoverageUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPointOnSurface"] + pub fn GEOSPointOnSurface_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGetCentroid"] + pub fn GEOSGetCentroid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMinimumBoundingCircle"] + pub fn GEOSMinimumBoundingCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + radius: *mut f64, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSNode"] + pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSClipByRect"] + pub fn GEOSClipByRect_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonize"] + pub fn GEOSPolygonize_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonize_valid"] + pub fn GEOSPolygonize_valid_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngems: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonizer_getCutEdges"] + pub fn GEOSPolygonizer_getCutEdges_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSPolygonize_full"] + pub fn GEOSPolygonize_full_r( + handle: GEOSContextHandle_t, + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalidRings: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSBuildArea"] + pub fn GEOSBuildArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSLineMerge"] + pub fn GEOSLineMerge_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSLineMergeDirected"] + pub fn GEOSLineMergeDirected_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSReverse"] + pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSimplify"] + pub fn GEOSSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSTopologyPreserveSimplify"] + pub fn GEOSTopologyPreserveSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_extractUniquePoints"] + pub fn GEOSGeom_extractUniquePoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSharedPaths"] + pub fn GEOSSharedPaths_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSnap"] + pub fn GEOSSnap_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSDelaunayTriangulation"] + pub fn GEOSDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSConstrainedDelaunayTriangulation"] + pub fn GEOSConstrainedDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSVoronoiDiagram"] + pub fn GEOSVoronoiDiagram_r( + extHandle: GEOSContextHandle_t, + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSegmentIntersection"] + pub fn GEOSSegmentIntersection_r( + extHandle: GEOSContextHandle_t, + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSDisjoint"] + pub fn GEOSDisjoint_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSTouches"] + pub fn GEOSTouches_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSIntersects"] + pub fn GEOSIntersects_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSCrosses"] + pub fn GEOSCrosses_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSWithin"] + pub fn GEOSWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSContains"] + pub fn GEOSContains_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSOverlaps"] + pub fn GEOSOverlaps_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSEquals"] + pub fn GEOSEquals_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSEqualsExact"] + pub fn GEOSEqualsExact_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSCovers"] + pub fn GEOSCovers_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSCoveredBy"] + pub fn GEOSCoveredBy_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPrepare"] + pub fn GEOSPrepare_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSPreparedGeometry; +} +extern "C" { + #[doc = " \\see GEOSPreparedGeom_destroy"] + pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); +} +extern "C" { + #[doc = " \\see GEOSPreparedContains"] + pub fn GEOSPreparedContains_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedContainsProperly"] + pub fn GEOSPreparedContainsProperly_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedCoveredBy"] + pub fn GEOSPreparedCoveredBy_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedCovers"] + pub fn GEOSPreparedCovers_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedCrosses"] + pub fn GEOSPreparedCrosses_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedDisjoint"] + pub fn GEOSPreparedDisjoint_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedIntersects"] + pub fn GEOSPreparedIntersects_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedOverlaps"] + pub fn GEOSPreparedOverlaps_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedTouches"] + pub fn GEOSPreparedTouches_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedWithin"] + pub fn GEOSPreparedWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSPreparedNearestPoints"] + pub fn GEOSPreparedNearestPoints_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSPreparedDistance"] + pub fn GEOSPreparedDistance_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSPreparedDistanceWithin"] + pub fn GEOSPreparedDistanceWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_create"] + pub fn GEOSSTRtree_create_r( + handle: GEOSContextHandle_t, + nodeCapacity: usize, + ) -> *mut GEOSSTRtree; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_insert"] + pub fn GEOSSTRtree_insert_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " \\see GEOSSTRtree_query"] + pub fn GEOSSTRtree_query_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " \\see GEOSSTRtree_nearest"] + pub fn GEOSSTRtree_nearest_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_nearest_generic"] + pub fn GEOSSTRtree_nearest_generic_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_iterate"] + pub fn GEOSSTRtree_iterate_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " \\see GEOSSTRtree_remove"] + pub fn GEOSSTRtree_remove_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSSTRtree_destroy"] + pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " \\see GEOSisEmpty"] + pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisSimple"] + pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisRing"] + pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSHasZ"] + pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisClosed"] + pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryRuleMod2()"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; +#[doc = " Same as \\ref GEOSRELATE_BNR_MOD2"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; +#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryEndPoint()"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; +#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint()"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 3; +#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryMonovalentEndPoint()"] +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 4; +#[doc = " Controls the behavior of the result of GEOSRelate when returning"] +#[doc = " DE9IM results for two geometries."] +pub type GEOSRelateBoundaryNodeRules = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSRelatePattern"] + pub fn GEOSRelatePattern_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSRelate"] + pub fn GEOSRelate_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSRelatePatternMatch"] + pub fn GEOSRelatePatternMatch_r( + handle: GEOSContextHandle_t, + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSRelateBoundaryNodeRule"] + pub fn GEOSRelateBoundaryNodeRule_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +#[doc = " Allow self-touching rings to form a hole in a polygon."] +pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; +#[doc = " Change behaviour of validity testing in \\ref GEOSisValidDetail"] +pub type GEOSValidFlags = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSisValid"] + pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisValidReason"] + pub fn GEOSisValidReason_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSisValidDetail"] + pub fn GEOSisValidDetail_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +#[doc = " Original method, combines all rings into"] +#[doc = "a set of noded lines and then extracts valid"] +#[doc = "polygons from that linework."] +pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_LINEWORK: GEOSMakeValidMethods = 0; +#[doc = " Structured method, first makes all rings valid"] +#[doc = "then merges shells and subtracts holes from"] +#[doc = "shells to generate valid result. Assumes that"] +#[doc = "holes and shells are correctly categorized."] +pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_STRUCTURE: GEOSMakeValidMethods = 1; +#[doc = " Algorithm to use when repairing invalid geometries."] +#[doc = ""] +#[doc = " \\see GEOSMakeValidWithParams"] +pub type GEOSMakeValidMethods = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSMakeValidParams_create"] + pub fn GEOSMakeValidParams_create_r(extHandle: GEOSContextHandle_t) + -> *mut GEOSMakeValidParams; +} +extern "C" { + #[doc = " \\see GEOSMakeValidParams_destroy"] + pub fn GEOSMakeValidParams_destroy_r( + handle: GEOSContextHandle_t, + parms: *mut GEOSMakeValidParams, + ); +} +extern "C" { + #[doc = " \\see GEOSMakeValidParams_setKeepCollapsed"] + pub fn GEOSMakeValidParams_setKeepCollapsed_r( + handle: GEOSContextHandle_t, + p: *mut GEOSMakeValidParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSMakeValidParams_setMethod"] + pub fn GEOSMakeValidParams_setMethod_r( + handle: GEOSContextHandle_t, + p: *mut GEOSMakeValidParams, + method: GEOSMakeValidMethods, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSMakeValid"] + pub fn GEOSMakeValid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + makeValidParams: *const GEOSMakeValidParams, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSRemoveRepeatedPoints"] + pub fn GEOSRemoveRepeatedPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeomType"] + pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSGeomTypeId"] + pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGetSRID"] + pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSSetSRID"] + pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + #[doc = " \\see GEOSGeom_getUserData"] + pub fn GEOSGeom_getUserData_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_void; +} +extern "C" { + #[doc = " \\see GEOSGeom_setUserData"] + pub fn GEOSGeom_setUserData_r( + handle: GEOSContextHandle_t, + g: *mut GEOSGeometry, + userData: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " \\see GEOSGetNumGeometries"] + pub fn GEOSGetNumGeometries_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGetGeometryN"] + pub fn GEOSGetGeometryN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSNormalize"] + pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; +} +#[doc = " The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed."] +pub const GEOSPrecisionRules_GEOS_PREC_VALID_OUTPUT: GEOSPrecisionRules = 0; +#[doc = " Precision reduction is performed pointwise. Output geometry may be invalid due to collapse or self-intersection. (This might be better called \"GEOS_PREC_POINTWISE\" - the current name is historical.)"] +pub const GEOSPrecisionRules_GEOS_PREC_NO_TOPO: GEOSPrecisionRules = 1; +#[doc = " Like the default mode, except that collapsed linear geometry elements are preserved. Collapsed polygonal input elements are removed."] +pub const GEOSPrecisionRules_GEOS_PREC_KEEP_COLLAPSED: GEOSPrecisionRules = 2; +#[doc = " Controls the behavior of GEOSGeom_setPrecision()"] +#[doc = " when altering the precision of a geometry."] +pub type GEOSPrecisionRules = libc::c_uint; +extern "C" { + #[doc = " \\see GEOSGeom_setPrecision"] + pub fn GEOSGeom_setPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeom_getPrecision"] + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; +} +extern "C" { + #[doc = " \\see GEOSGetNumInteriorRings"] + pub fn GEOSGetNumInteriorRings_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetNumPoints"] + pub fn GEOSGeomGetNumPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetX"] + pub fn GEOSGeomGetX_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + x: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetY"] + pub fn GEOSGeomGetY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetZ"] + pub fn GEOSGeomGetZ_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGetInteriorRingN"] + pub fn GEOSGetInteriorRingN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGetExteriorRing"] + pub fn GEOSGetExteriorRing_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGetNumCoordinates"] + pub fn GEOSGetNumCoordinates_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getCoordSeq"] + pub fn GEOSGeom_getCoordSeq_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSGeom_getDimensions"] + pub fn GEOSGeom_getDimensions_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getCoordinateDimension"] + pub fn GEOSGeom_getCoordinateDimension_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getXMin"] + pub fn GEOSGeom_getXMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getYMin"] + pub fn GEOSGeom_getYMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getXMax"] + pub fn GEOSGeom_getXMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getYMax"] + pub fn GEOSGeom_getYMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeom_getExtent"] + pub fn GEOSGeom_getExtent_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + xmin: *mut f64, + ymin: *mut f64, + xmax: *mut f64, + ymax: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetPointN"] + pub fn GEOSGeomGetPointN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeomGetStartPoint"] + pub fn GEOSGeomGetStartPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeomGetEndPoint"] + pub fn GEOSGeomGetEndPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSArea"] + pub fn GEOSArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + area: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSLength"] + pub fn GEOSLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSDistance"] + pub fn GEOSDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSDistanceWithin"] + pub fn GEOSDistanceWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSDistanceIndexed"] + pub fn GEOSDistanceIndexed_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSHausdorffDistance"] + pub fn GEOSHausdorffDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSHausdorffDistanceDensify"] + pub fn GEOSHausdorffDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSFrechetDistance"] + pub fn GEOSFrechetDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSFrechetDistanceDensify"] + pub fn GEOSFrechetDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSHilbertCode"] + pub fn GEOSHilbertCode_r( + handle: GEOSContextHandle_t, + geom: *const GEOSGeometry, + extent: *const GEOSGeometry, + level: libc::c_uint, + code: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSGeomGetLength"] + pub fn GEOSGeomGetLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSNearestPoints"] + pub fn GEOSNearestPoints_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " \\see GEOSGeom_transformXY"] + pub fn GEOSGeom_transformXY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + callback: GEOSTransformXYCallback, + userdata: *mut libc::c_void, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSOrientationIndex"] + pub fn GEOSOrientationIndex_r( + handle: GEOSContextHandle_t, + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTReader_t { + _unused: [u8; 0], +} +#[doc = " Reader object to read Well-Known Text (WKT) format and construct Geometry."] +#[doc = " \\see GEOSWKTReader_create"] +#[doc = " \\see GEOSWKTReader_create_r"] +pub type GEOSWKTReader = GEOSWKTReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTWriter_t { + _unused: [u8; 0], +} +#[doc = " Writer object to turn Geometry into Well-Known Text (WKT)."] +#[doc = " \\see GEOSWKTWriter_create"] +#[doc = " \\see GEOSWKTWriter_create_r"] +pub type GEOSWKTWriter = GEOSWKTWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBReader_t { + _unused: [u8; 0], +} +#[doc = " Reader object to read Well-Known Binary (WKB) format and construct Geometry."] +#[doc = " \\see GEOSWKBReader_create"] +#[doc = " \\see GEOSWKBReader_create_r"] +pub type GEOSWKBReader = GEOSWKBReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBWriter_t { + _unused: [u8; 0], +} +#[doc = " Writer object to turn Geometry into Well-Known Binary (WKB)."] +#[doc = " \\see GEOSWKBWriter_create"] +#[doc = " \\see GEOSWKBWriter_create_r"] +pub type GEOSWKBWriter = GEOSWKBWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeoJSONReader_t { + _unused: [u8; 0], +} +#[doc = " Reader object to read GeoJSON format and construct a Geometry."] +#[doc = " \\see GEOSGeoJSONReader_create"] +#[doc = " \\see GEOSGeoJSONReader_create_r"] +pub type GEOSGeoJSONReader = GEOSGeoJSONReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeoJSONWriter_t { + _unused: [u8; 0], +} +#[doc = " Writer object to turn a Geometry into GeoJSON."] +#[doc = " \\see GEOSGeoJSONReader_create"] +#[doc = " \\see GEOSGeoJSONReader_create_r"] +pub type GEOSGeoJSONWriter = GEOSGeoJSONWriter_t; +extern "C" { + #[doc = " \\see GEOSWKTReader_create"] + pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; +} +extern "C" { + #[doc = " \\see GEOSWKTReader_destroy"] + pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); +} +extern "C" { + #[doc = " \\see GEOSWKTReader_read"] + pub fn GEOSWKTReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSWKTReader_create"] + pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_destroy"] + pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_write"] + pub fn GEOSWKTWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_setTrim"] + pub fn GEOSWKTWriter_setTrim_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + trim: libc::c_char, + ); +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_setRoundingPrecision"] + pub fn GEOSWKTWriter_setRoundingPrecision_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + precision: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_setOutputDimension"] + pub fn GEOSWKTWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + dim: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_getOutputDimension"] + pub fn GEOSWKTWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSWKTWriter_setOld3D"] + pub fn GEOSWKTWriter_setOld3D_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + useOld3D: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKBReader_create"] + pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; +} +extern "C" { + #[doc = " \\see GEOSWKBReader_destroy"] + pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); +} +extern "C" { + #[doc = " \\see GEOSWKBReader_read"] + pub fn GEOSWKBReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSWKBReader_readHEX"] + pub fn GEOSWKBReader_readHEX_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_create"] + pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_destroy"] + pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_write"] + pub fn GEOSWKBWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_writeHEX"] + pub fn GEOSWKBWriter_writeHEX_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_getOutputDimension"] + pub fn GEOSWKBWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_setOutputDimension"] + pub fn GEOSWKBWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + newDimension: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_getByteOrder"] + pub fn GEOSWKBWriter_getByteOrder_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_setByteOrder"] + pub fn GEOSWKBWriter_setByteOrder_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + byteOrder: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_getFlavor"] + pub fn GEOSWKBWriter_getFlavor_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_setFlavor"] + pub fn GEOSWKBWriter_setFlavor_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + flavor: libc::c_int, + ); +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_getIncludeSRID"] + pub fn GEOSWKBWriter_getIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSWKBWriter_setIncludeSRID"] + pub fn GEOSWKBWriter_setIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + writeSRID: libc::c_char, + ); +} +extern "C" { + #[doc = " \\see GEOSGeoJSONReader_create"] + pub fn GEOSGeoJSONReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONReader; +} +extern "C" { + #[doc = " \\see GEOSGeoJSONReader_destroy"] + pub fn GEOSGeoJSONReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSGeoJSONReader); +} +extern "C" { + #[doc = " \\see GEOSWKTReader_read"] + pub fn GEOSGeoJSONReader_readGeometry_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSGeoJSONReader, + geojson: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\see GEOSGeoJSONWriter_create"] + pub fn GEOSGeoJSONWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONWriter; +} +extern "C" { + #[doc = " \\see GEOSGeoJSONWriter_destroy"] + pub fn GEOSGeoJSONWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSGeoJSONWriter); +} +extern "C" { + #[doc = " \\see GEOSGeoJSONWriter_writeGeometry"] + pub fn GEOSGeoJSONWriter_writeGeometry_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSGeoJSONWriter, + g: *const GEOSGeometry, + indent: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\see GEOSFree"] + pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); +} +extern "C" { + #[doc = " Returns the current GEOS version string. eg: \"3.10.0\""] + #[doc = " This function does not have a reentrant variant and is"] + #[doc = " available if `GEOS_USE_ONLY_R_API` is defined."] + #[doc = " \\return version string"] + pub fn GEOSversion() -> *const libc::c_char; +} +extern "C" { + #[doc = " For non-reentrant code, set up an execution contact, and associate"] + #[doc = " \\ref GEOSMessageHandler functions with it, to pass error and notice"] + #[doc = " messages back to the calling application."] + #[doc = "
"]
+    #[doc = " typedef void (*GEOSMessageHandler)(const char *fmt, ...);"]
+    #[doc = " 
"] + #[doc = ""] + #[doc = " \\param notice_function Handle notice messages"] + #[doc = " \\param error_function Handle error messages"] + pub fn initGEOS(notice_function: GEOSMessageHandler, error_function: GEOSMessageHandler); +} +extern "C" { + #[doc = " For non-reentrant code, call when all GEOS operations are complete,"] + #[doc = " cleans up global resources."] + pub fn finishGEOS(); +} +extern "C" { + #[doc = " Free strings and byte buffers returned by functions such"] + #[doc = " as GEOSWKBWriter_write(),"] + #[doc = " GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(), etc."] + #[doc = " \\param buffer The memory to free"] + pub fn GEOSFree(buffer: *mut libc::c_void); +} +extern "C" { + #[doc = " Create a coordinate sequence."] + #[doc = " \\param size number of coordinates in the sequence"] + #[doc = " \\param dims dimensionality of the coordinates (2 or 3)"] + #[doc = " \\return the sequence or NULL on exception"] + pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Create a coordinate sequence by copying from a buffer of doubles (XYXY or XYZXYZ)"] + #[doc = " \\param buf pointer to buffer"] + #[doc = " \\param size number of coordinates in the sequence"] + #[doc = " \\param hasZ does buffer have Z values?"] + #[doc = " \\param hasM does buffer have M values? (they will be ignored)"] + #[doc = " \\return the sequence or NULL on exception"] + pub fn GEOSCoordSeq_copyFromBuffer( + buf: *const f64, + size: libc::c_uint, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Create a coordinate sequence by copying from arrays of doubles"] + #[doc = " \\param x array of x coordinates"] + #[doc = " \\param y array of y coordinates"] + #[doc = " \\param z array of z coordinates, or NULL"] + #[doc = " \\param m array of m coordinates, (must be NULL)"] + #[doc = " \\param size length of each array"] + #[doc = " \\return the sequence or NULL on exception"] + pub fn GEOSCoordSeq_copyFromArrays( + x: *const f64, + y: *const f64, + z: *const f64, + m: *const f64, + size: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Copy the contents of a coordinate sequence to a buffer of doubles (XYXY or XYZXYZ)"] + #[doc = " \\param s sequence to copy"] + #[doc = " \\param buf buffer to which coordinates should be copied"] + #[doc = " \\param hasZ copy Z values to buffer?"] + #[doc = " \\param hasM copy M values to buffer? (will be NaN)"] + #[doc = " \\return 1 on success, 0 on error"] + pub fn GEOSCoordSeq_copyToBuffer( + s: *const GEOSCoordSequence, + buf: *mut f64, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Copy the contents of a coordinate sequence to a buffer of doubles (XYZY or XYZXYZ)"] + #[doc = " \\param s sequence to copy"] + #[doc = " \\param x array to which x values should be copied"] + #[doc = " \\param y array to which y values should be copied"] + #[doc = " \\param z array to which z values should be copied, or NULL"] + #[doc = " \\param m array to which m values should be copied (will all be NAN)"] + #[doc = " \\return 1 on success, 0 on error"] + pub fn GEOSCoordSeq_copyToArrays( + s: *const GEOSCoordSequence, + x: *mut f64, + y: *mut f64, + z: *mut f64, + m: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Clone a coordinate sequence."] + #[doc = " \\param s the coordinate sequence to clone"] + #[doc = " \\return a copy of the coordinate sequence or NULL on exception"] + pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Destroy a coordinate sequence, freeing all memory."] + #[doc = " \\param s the coordinate sequence to destroy"] + pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); +} +extern "C" { + #[doc = " Set X ordinate values in a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val the value to set the ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + #[doc = " Set Y ordinate values in a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val the value to set the ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + #[doc = " Set Z ordinate values in a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val the value to set the ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + #[doc = " Set X and Y ordinate values in a coordinate sequence simultaneously."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param x the value to set the X ordinate to"] + #[doc = " \\param y the value to set the Y ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setXY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Set X, Y and Z ordinate values in a coordinate sequence simultaneously."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param x the value to set the X ordinate to"] + #[doc = " \\param y the value to set the Y ordinate to"] + #[doc = " \\param z the value to set the Z ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setXYZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + z: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Set Nth ordinate value in a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param dim the dimension number of the ordinate to alter, zero based"] + #[doc = " \\param val the value to set the ordinate to"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_setOrdinate( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read X ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val pointer where ordinate value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getX( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read Y ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val pointer where ordinate value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read Z ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param val pointer where ordinate value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read X and Y ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param x pointer where ordinate X value will be placed"] + #[doc = " \\param y pointer where ordinate Y value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getXY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read X and Y ordinate values from a coordinate sequence."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param idx the index of the coordinate to alter, zero based"] + #[doc = " \\param x pointer where ordinate X value will be placed"] + #[doc = " \\param y pointer where ordinate Y value will be placed"] + #[doc = " \\param z pointer where ordinate Z value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getXYZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Read Nth ordinate value from a coordinate sequence."] + #[doc = " \\param[in] s the coordinate sequence"] + #[doc = " \\param[in] idx the index of the coordinate to alter, zero based"] + #[doc = " \\param[in] dim the dimension number of the ordinate to read, zero based"] + #[doc = " \\param[out] val pointer where ordinate value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getOrdinate( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Get size info from a coordinate sequence."] + #[doc = " \\param[in] s the coordinate sequence"] + #[doc = " \\param[out] size pointer where size value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getSize( + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Get dimension info from a coordinate sequence."] + #[doc = " \\param[in] s the coordinate sequence"] + #[doc = " \\param[out] dims pointer where dimension value will be placed"] + #[doc = " \\return 0 on exception"] + pub fn GEOSCoordSeq_getDimensions( + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Check orientation of a coordinate sequence. Closure of the sequence is"] + #[doc = " assumed. Invalid (collapsed) sequences will return false. Short (less"] + #[doc = " than 4 points) sequences will return exception."] + #[doc = " \\param s the coordinate sequence"] + #[doc = " \\param is_ccw pointer for ccw value, 1 if counter-clockwise orientation, 0 otherwise"] + #[doc = " \\return 0 on exception, 1 on success"] + pub fn GEOSCoordSeq_isCCW( + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Creates a point geometry from a coordinate sequence."] + #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] + #[doc = " \\return A newly allocated point geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a point geometry from a pair of coordinates."] + #[doc = " \\param x The X coordinate"] + #[doc = " \\param y The Y coordinate"] + #[doc = " \\return A newly allocated point geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createPointFromXY(x: f64, y: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates an empty point."] + #[doc = " \\return A newly allocated empty point geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a linear ring geometry, for use in a polygon."] + #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] + #[doc = " \\return A newly allocated linear ring geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a linestring geometry."] + #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] + #[doc = " \\return A newly allocated linestring geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates an emptylinestring geometry."] + #[doc = " \\return A newly allocated linestring geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates an empty polygon geometry."] + #[doc = " \\return A newly allocated empty polygon geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Creates a polygon geometry from line ring geometries."] + #[doc = " \\param shell A linear ring that is the exterior ring of the polygon."] + #[doc = " \\param holes An array of linear rings that are the holes."] + #[doc = " \\param nholes The number of rings in the holes array."] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\note The holes argument is an array of GEOSGeometry* objects."] + #[doc = " The caller **retains ownership** of the containing array,"] + #[doc = " but the ownership of the pointed-to objects is transferred"] + #[doc = " to the returned \\ref GEOSGeometry."] + pub fn GEOSGeom_createPolygon( + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a geometry collection."] + #[doc = " \\param type The geometry type, enumerated by \\ref GEOSGeomTypes"] + #[doc = " \\param geoms A list of geometries that will form the collection"] + #[doc = " \\param ngeoms The number of geometries in the geoms list"] + #[doc = " \\return A newly allocated geometry collection. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\note The holes argument is an array of GEOSGeometry* objects."] + #[doc = " The caller **retains ownership** of the containing array,"] + #[doc = " but the ownership of the pointed-to objects is transferred"] + #[doc = " to the returned \\ref GEOSGeometry."] + pub fn GEOSGeom_createCollection( + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create an empty geometry collection."] + #[doc = " \\param type The geometry type, enumerated by \\ref GEOSGeomTypes"] + #[doc = " \\return A newly allocated empty geometry collection. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a rectangular polygon from bounding coordinates."] + #[doc = " Will return a point geometry if width and height are 0."] + #[doc = " \\param xmin Left bound of envelope"] + #[doc = " \\param ymin Lower bound of envelope"] + #[doc = " \\param xmax Right bound of envelope"] + #[doc = " \\param ymax Upper bound of envelope"] + pub fn GEOSGeom_createRectangle( + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a new copy of the input geometry."] + #[doc = " \\param g The geometry to copy"] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Release the memory associated with a geometry."] + #[doc = " \\param g The geometry to be destroyed."] + pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " Returns the geometry type string for this geometry."] + #[doc = " eg: \"GeometryCollection\", \"LineString\""] + #[doc = " \\param g Input geometry"] + #[doc = " \\return A string with the geometry type."] + #[doc = " Caller must free with GEOSFree()."] + #[doc = " NULL on exception."] + pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Returns the \\ref GEOSGeomTypeId number for this geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return The geometry type number, or -1 on exception."] + pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the \"spatial reference id\" (SRID) for this geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return SRID number or 0 if unknown / not set."] + pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Return the anonymous \"user data\" for this geometry."] + #[doc = " User data must be managed by the caller, and freed before"] + #[doc = " the geometry is freed."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return A void* to the user data, caller is responsible for"] + #[doc = " casting to the appropriate type and freeing."] + pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; +} +extern "C" { + #[doc = " Returns the number of sub-geometries immediately under a"] + #[doc = " multi-geometry or collection or 1 for a simple geometry."] + #[doc = " For nested collections, remember to check if returned"] + #[doc = " sub-geometries are **themselves** also collections."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return Number of direct children in this collection"] + #[doc = " \\warning For GEOS < 3.2 this function may crash when fed simple geometries"] + pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the specified sub-geometry of a collection. For"] + #[doc = " a simple geometry, returns a pointer to the input."] + #[doc = " Returned object is a pointer to internal storage:"] + #[doc = " it must NOT be destroyed directly."] + #[doc = " \\param g Input geometry"] + #[doc = " \\param n Sub-geometry index, zero-base"] + #[doc = " \\return A const \\ref GEOSGeometry, do not free!"] + #[doc = "It will be freed when the parent is freed."] + #[doc = "Returns NULL on exception."] + #[doc = " \\note Up to GEOS 3.2.0 the input geometry must be a Collection, in"] + #[doc = " later versions it doesn't matter (getGeometryN(0) for a single will"] + #[doc = " return the input)."] + pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " Read the currently set precision value from the"] + #[doc = " geometry and returns the grid size if it is a fixed"] + #[doc = " precision or 0.0 if it is full floating point precision."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return The grid size, or -1 on exception"] + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; +} +extern "C" { + #[doc = " Returns the number of interior rings, for a Polygon input, or"] + #[doc = " an exception otherwise."] + #[doc = " \\param g Input Polygon geometry"] + #[doc = " \\return Number of interior rings, -1 on exception"] + pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the number of points, for a LineString input, or"] + #[doc = " an exception otherwise."] + #[doc = " \\param g Input LineString geometry"] + #[doc = " \\return Number of points, -1 on exception"] + pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the X coordinate, for a Point input, or an"] + #[doc = " exception otherwise."] + #[doc = " \\param[in] g Input Point geometry"] + #[doc = " \\param[out] x Pointer to hold return value"] + #[doc = " \\returns 1 on success, 0 on exception"] + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the Y coordinate, for a Point input, or an"] + #[doc = " exception otherwise."] + #[doc = " \\param[in] g Input Point geometry"] + #[doc = " \\param[out] y Pointer to hold return value"] + #[doc = " \\returns 1 on success, 0 on exception"] + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the Z coordinate, for a Point input, or an"] + #[doc = " exception otherwise."] + #[doc = " \\param[in] g Input Point geometry"] + #[doc = " \\param[out] z Pointer to hold return value"] + #[doc = " \\returns 1 on success, 0 on exception"] + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Returns the N'th ring for a Polygon input."] + #[doc = " \\note Returned object is a pointer to internal storage:"] + #[doc = " it must NOT be destroyed directly."] + #[doc = " \\param g Input Polygon geometry"] + #[doc = " \\param n Index of the desired ring"] + #[doc = " \\return LinearRing geometry. Owned by parent geometry, do not free. NULL on exception."] + pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " Get the external ring of a Polygon."] + #[doc = " \\note Returned object is a pointer to internal storage:"] + #[doc = " it must NOT be destroyed directly."] + #[doc = " \\param g Input Polygon geometry"] + #[doc = " \\return LinearRing geometry. Owned by parent geometry, do not free. NULL on exception."] + pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " Get the total number of points in a geometry,"] + #[doc = " of any type."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return Number of points in the geometry. -1 on exception."] + pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Return the coordinate sequence underlying the"] + #[doc = " given geometry (Must be a LineString, LinearRing or Point)."] + #[doc = " Do not directly free the coordinate sequence, it is owned by"] + #[doc = " the parent geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return Coordinate sequence or NULL on exception."] + pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; +} +extern "C" { + #[doc = " Return the planar dimensionality of the geometry."] + #[doc = ""] + #[doc = " - 0 for point, multipoint"] + #[doc = " - 1 for linestring, multilinestring"] + #[doc = " - 2 for polygon, multipolygon"] + #[doc = ""] + #[doc = " \\see geos::geom::Dimension::DimensionType"] + #[doc = " \\param g Input geometry"] + #[doc = " \\return The dimensionality"] + pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Return the cartesian dimension of the geometry."] + #[doc = ""] + #[doc = " - 2 for XY data"] + #[doc = " - 3 for XYZ data"] + #[doc = ""] + #[doc = " \\param g Input geometry"] + #[doc = " \\return The dimension"] + pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the minimum X value in the geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] value Pointer to place result"] + #[doc = " \\return 0 on exception"] + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the minimum Y value in the geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] value Pointer to place result"] + #[doc = " \\return 0 on exception"] + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the maximum X value in the geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] value Pointer to place result"] + #[doc = " \\return 0 on exception"] + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the maximum Y value in the geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] value Pointer to place result"] + #[doc = " \\return 0 on exception"] + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Finds the extent (minimum and maximum X and Y value) of the geometry."] + #[doc = " Raises an exception for empty geometry input."] + #[doc = ""] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] xmin Pointer to place result for minimum X value"] + #[doc = " \\param[out] ymin Pointer to place result for minimum Y value"] + #[doc = " \\param[out] xmax Pointer to place result for maximum X value"] + #[doc = " \\param[out] ymax Pointer to place result for maximum Y value"] + #[doc = " \\return 1 on success, 0 on exception"] + pub fn GEOSGeom_getExtent( + g: *const GEOSGeometry, + xmin: *mut f64, + ymin: *mut f64, + xmax: *mut f64, + ymax: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Return the N'th point of a LineString"] + #[doc = " \\param g Input geometry, must be a LineString"] + #[doc = " \\param n Index of desired point (zero based)"] + #[doc = " \\return A Point geometry."] + #[doc = " Caller must free with GEOSGeom_destroy()"] + #[doc = " NULL on exception."] + pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return the first point of a LineString"] + #[doc = " \\param g Input geometry, must be a LineString"] + #[doc = " \\return A Point geometry."] + #[doc = " Caller must free with GEOSGeom_destroy()"] + #[doc = " NULL on exception."] + pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return the last point of a LineString"] + #[doc = " \\param g Input geometry, must be a LineString"] + #[doc = " \\return A Point geometry."] + #[doc = " Caller must free with GEOSGeom_destroy()"] + #[doc = " NULL on exception."] + pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Tests whether the input geometry is empty. If the geometry or any"] + #[doc = " component is non-empty, the geometry is non-empty. An empty geometry"] + #[doc = " has no boundary or interior."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Tests whether the input geometry is a ring. Rings are"] + #[doc = " linestrings, without self-intersections,"] + #[doc = " with start and end point being identical."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Tests whether the input geometry has z coordinates."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Tests whether the input geometry is closed."] + #[doc = " A closed geometry is a linestring or multilinestring"] + #[doc = " with the start and end points being the same."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Set the \"spatial reference id\" (SRID) for this geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\param SRID SRID number or 0 for unknown SRID."] + pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + #[doc = " Set the anonymous \"user data\" for this geometry."] + #[doc = " Don't forget to free the user data before freeing the geometry."] + #[doc = " \\param g Input geometry"] + #[doc = " \\param userData Void pointer to user data"] + pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); +} +extern "C" { + #[doc = " Organize the elements, rings, and coordinate order"] + #[doc = " of geometries in a consistent way,"] + #[doc = " so that geometries that represent the same"] + #[doc = " object can be easily compared."] + #[doc = " Modifies the geometry in-place."] + #[doc = ""] + #[doc = " Normalization ensures the following:"] + #[doc = " - Lines are oriented to have smallest coordinate first (apart from duplicate endpoints)"] + #[doc = " - Rings start with their smallest coordinate"] + #[doc = " (using XY ordering)"] + #[doc = " - Polygon shell rings are oriented CW, and holes CCW"] + #[doc = " - Collection elements are sorted by their first coordinate"] + #[doc = ""] + #[doc = " Use before calling \\ref GEOSEqualsExact to avoid false \"not equal\" results."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return 0 on success or -1 on exception"] + pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Tests whether the input geometry is \"simple\". Mostly relevant for"] + #[doc = " linestrings. A \"simple\" linestring has no self-intersections."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Check the validity of the provided geometry."] + #[doc = " - All points are valid."] + #[doc = " - All non-zero-length linestrings are valid."] + #[doc = " - Polygon rings must be non-self-intersecting, and interior rings"] + #[doc = " contained within exterior rings."] + #[doc = " - Multi-polygon components may not touch or overlap."] + #[doc = ""] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::operation::valid::isValidOp"] + pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Return the human readable reason a geometry is invalid,"] + #[doc = " \"Valid Geometry\" string otherwise, or NULL on exception."] + #[doc = " \\param g The geometry to test"] + #[doc = " \\return A string with the reason, NULL on exception."] + #[doc = "Caller must GEOSFree() their result."] + pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + #[doc = " In one step, calculate and return the validity, the"] + #[doc = " human readable validity reason and a point at which validity"] + #[doc = " rules are broken."] + #[doc = " Caller has the responsibility to destroy 'reason' with GEOSFree()"] + #[doc = " and 'location' with GEOSGeom_destroy()"] + #[doc = " \\param g The geometry to test"] + #[doc = " \\param flags A value from the \\ref GEOSValidFlags enum"] + #[doc = " \\param reason A pointer in which the reason string will be places"] + #[doc = " \\param location A pointer in which the location GEOSGeometry will be placed"] + #[doc = " \\return 1 when valid, 0 when invalid, 2 on exception"] + pub fn GEOSisValidDetail( + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Repair an invalid geometry, returning a valid output."] + #[doc = " \\param g The geometry to repair"] + #[doc = " \\return The repaired geometry. Caller must free with GEOSGeom_destroy()."] + pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Repair an invalid geometry, returning a valid output, using the"] + #[doc = " indicated GEOSMakeValidMethods algorithm and options."] + #[doc = " \\param g is the geometry to test."] + #[doc = " \\param makeValidParams is a GEOSMakeValidParams with the desired parameters set on it."] + #[doc = " \\return A repaired geometry. Caller must free with GEOSGeom_destroy()."] + #[doc = " \\see GEOSMakeValidParams_create"] + #[doc = " \\see GEOSMakeValidParams_destroy"] + #[doc = " \\see GEOSMakeValidParams_setMethod"] + #[doc = " \\see GEOSMakeValidParams_setKeepCollapsed"] + pub fn GEOSMakeValidWithParams( + g: *const GEOSGeometry, + makeValidParams: *const GEOSMakeValidParams, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a GEOSMakeValidParams to hold the desired parameters"] + #[doc = " to control the algorithm and behavior of the validation process."] + #[doc = " \\return a parameter object"] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidParams_create() -> *mut GEOSMakeValidParams; +} +extern "C" { + #[doc = " Destroy a GEOSMakeValidParams."] + #[doc = " \\param parms the object to destroy"] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidParams_destroy(parms: *mut GEOSMakeValidParams); +} +extern "C" { + #[doc = " Set the GEOSMakeValidMethods to use in making the geometry"] + #[doc = " valid."] + #[doc = " \\return 0 on exception, 1 on success."] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidParams_setMethod( + p: *mut GEOSMakeValidParams, + method: GEOSMakeValidMethods, + ) -> libc::c_int; +} +extern "C" { + #[doc = " When this parameter is not set to 0, the GEOS_MAKE_VALID_STRUCTURE method will drop"] + #[doc = " any component that has collapsed into a lower dimensionality."] + #[doc = " For example, a ring collapsing to a line, or a line collapsing"] + #[doc = " to a point."] + #[doc = " \\return 0 on exception, 1 on success."] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSMakeValidParams_setKeepCollapsed( + p: *mut GEOSMakeValidParams, + keepCollapsed: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Computes the minimum clearance of a geometry. The minimum clearance is the smallest amount by which"] + #[doc = " a vertex could be move to produce an invalid polygon, a non-simple linestring, or a multipoint with"] + #[doc = " repeated points. If a geometry has a minimum clearance of 'eps', it can be said that:"] + #[doc = ""] + #[doc = " - No two distinct vertices in the geometry are separated by less than 'eps'"] + #[doc = " - No vertex is closer than 'eps' to a line segment of which it is not an endpoint."] + #[doc = ""] + #[doc = " If the minimum clearance cannot be defined for a geometry (such as with a single point, or a multipoint"] + #[doc = " whose points are identical, a value of Infinity will be calculated."] + #[doc = ""] + #[doc = " \\param g the input geometry"] + #[doc = " \\param d a double to which the result can be stored"] + #[doc = " \\return 0 if no exception occurred."] + #[doc = " 2 if an exception occurred."] + #[doc = " \\see geos::precision::MinimumClearance"] + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Returns a LineString whose endpoints define the minimum clearance of a geometry."] + #[doc = " If the geometry has no minimum clearance, an empty LineString will be returned."] + #[doc = ""] + #[doc = " \\param g the input geometry"] + #[doc = " \\return a linestring geometry, or NULL if an exception occurred."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::precision::MinimumClearance"] + pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Works from start of each coordinate sequence in the"] + #[doc = " geometry, retaining points that are further away from the"] + #[doc = " previous retained point than the tolerance value."] + #[doc = ""] + #[doc = " Removing repeated points with a non-zero tolerance may"] + #[doc = " result in an invalid geometry being returned. Be sure"] + #[doc = " to check and repair validity."] + #[doc = ""] + #[doc = " \\return A geometry with all points within the tolerance of each other removed."] + #[doc = " \\param g The geometry to filter"] + #[doc = " \\param tolerance Remove all points within this distance of each other. Use 0.0 to remove only exactly repeated points."] + #[doc = ""] + #[doc = " \\see GEOSMakeValidWithParams"] + pub fn GEOSRemoveRepeatedPoints(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Calculate the area of a geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] area Pointer to be filled in with area result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the length of a geometry."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] length Pointer to be filled in with length result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the length of a LineString."] + #[doc = " Only works for LineString inputs, returns exception otherwise."] + #[doc = ""] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[out] length Pointer to be filled in with length result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the distance between two geometries."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Test whether the distance between two geometries is"] + #[doc = " within the given dist."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\param dist The max distance"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + pub fn GEOSDistanceWithin( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Calculate the distance between two geometries, using the"] + #[doc = " indexed facet distance, which first indexes the geometries"] + #[doc = " internally, then calculates the distance. Useful when one"] + #[doc = " or both geometries is very large."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::operation::distance:;IndexedFacetDistance"] + pub fn GEOSDistanceIndexed( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " The closest points of the two geometries."] + #[doc = " The first point comes from g1 geometry and the second point comes from g2."] + #[doc = ""] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\return A coordinate sequence with the two points, or NULL on exception."] + #[doc = " Caller must free with GEOSCoordSeq_destroy()."] + pub fn GEOSNearestPoints( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Calculate the Hausdorff distance between two geometries."] + #[doc = " [Hausdorff distance](https://en.wikipedia.org/wiki/Hausdorff_distance)"] + #[doc = " is the largest distance between two geometries."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::algorithm::distance::DiscreteHausdorffDistance"] + pub fn GEOSHausdorffDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate a more precise Hausdorff distance between two geometries,"] + #[doc = " by densifying the inputs before computation."] + #[doc = " [Hausdorff distance](https://en.wikipedia.org/wiki/Hausdorff_distance)"] + #[doc = " is the largest distance between two geometries."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[in] densifyFrac The largest % of the overall line length that"] + #[doc = " any given two-point segment should be"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::algorithm::distance::DiscreteHausdorffDistance"] + pub fn GEOSHausdorffDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the"] + #[doc = " [Frechet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance)"] + #[doc = " between two geometries,"] + #[doc = " a similarity measure for linear features."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::algorithm::distance::DiscreteFrechetDistance"] + pub fn GEOSFrechetDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Calculate the"] + #[doc = " [Frechet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance)"] + #[doc = " between two geometries,"] + #[doc = " a similarity measure for linear features. For more precision, first"] + #[doc = " densify the inputs."] + #[doc = " \\param[in] g1 Input geometry"] + #[doc = " \\param[in] g2 Input geometry"] + #[doc = " \\param[in] densifyFrac The largest % of the overall line length that"] + #[doc = " any given two-point segment should be"] + #[doc = " \\param[out] dist Pointer to be filled in with distance result"] + #[doc = " \\return 1 on success, 0 on exception."] + #[doc = " \\see geos::algorithm::distance::DiscreteFrechetDistance"] + pub fn GEOSFrechetDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Distance of point projected onto line from the start of the line."] + #[doc = " \\param line linear target of projection"] + #[doc = " \\param point point to be projected onto 'g'"] + #[doc = " \\return distance along line that point projects to, -1 on exception"] + #[doc = ""] + #[doc = " \\note Line parameter must be a LineString."] + pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; +} +extern "C" { + #[doc = " Measuring from start of line, return point that is distance"] + #[doc = " the start. Line parameter must be a LineString."] + #[doc = " The returned point is not guaranteed to intersect the line due to limitations"] + #[doc = " of floating point calculations."] + #[doc = " \\param line linear target of projection"] + #[doc = " \\param d distance from start of line to created point"] + #[doc = " \\return The point \\ref GEOSGeometry that is distance from the start of line."] + #[doc = " Caller takes ownership of returned geometry."] + pub fn GEOSInterpolate(line: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Project point to line and calculate the **proportion** of"] + #[doc = " the line the point is from the start. For example, a point that"] + #[doc = " projects to the middle of a line would be return 0.5."] + #[doc = " \\param line linear target of projection"] + #[doc = " \\param point the point to project"] + #[doc = " \\return The proportion of the overall line length that the projected"] + #[doc = " point falls at."] + pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; +} +extern "C" { + #[doc = " Measuring from start of line, return point that is a proportion"] + #[doc = " the start. Line parameter must be a LineString."] + #[doc = " \\param line linear target of projection"] + #[doc = " \\param proportion The proportion from the start of line to created point"] + #[doc = " \\return The point \\ref GEOSGeometry that is distance from the start of line."] + #[doc = " Caller takes ownership of returned geometry."] + pub fn GEOSInterpolateNormalized( + line: *const GEOSGeometry, + proportion: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the intersection of two geometries: the set of points"] + #[doc = " that fall within **both** geometries."] + #[doc = " \\param g1 one of the geometries"] + #[doc = " \\param g2 the other geometry"] + #[doc = " \\return A newly allocated geometry of the intersection. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the intersection of two geometries: the set of points"] + #[doc = " that fall within **both** geometries. All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param g1 one of the geometries"] + #[doc = " \\param g2 the other geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the intersection. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSIntersectionPrec( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the difference of two geometries A and B: the set of points"] + #[doc = " that fall within A but **not** within B."] + #[doc = " \\param ga the base geometry"] + #[doc = " \\param gb the geometry to subtract from it"] + #[doc = " \\return A newly allocated geometry of the difference. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the difference of two geometries A and B: the set of points"] + #[doc = " that fall within A but **not** within B."] + #[doc = " All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param ga one of the geometries"] + #[doc = " \\param gb the other geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the difference. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSDifferencePrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the symmetric difference of two geometries A and B: the set of points"] + #[doc = " that fall in A but **not** within B and the set of points that fall in B but"] + #[doc = " **not** in A."] + #[doc = " \\param ga geometry A"] + #[doc = " \\param gb geometry B"] + #[doc = " \\return A newly allocated geometry of the symmetric difference. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSSymDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the symmetric difference of two geometries A and B: the set of points"] + #[doc = " that fall in A but **not** within B and the set of points that fall in B but"] + #[doc = " **not** in A."] + #[doc = " All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param ga one of the geometries"] + #[doc = " \\param gb the other geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the symmetric difference. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSSymDifferencePrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the union of two geometries A and B: the set of points"] + #[doc = " that fall in A **or** within B."] + #[doc = " \\param ga geometry A"] + #[doc = " \\param gb geometry B"] + #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSUnion(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the union of two geometries A and B: the set of points"] + #[doc = " that fall in A **or** within B."] + #[doc = " All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param ga one of the geometries"] + #[doc = " \\param gb the other geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSUnionPrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the union of all components of a single geometry. Usually"] + #[doc = " used to convert a collection into the smallest set of polygons"] + #[doc = " that cover the same area."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the union of all components of a single geometry. Usually"] + #[doc = " used to convert a collection into the smallest set of polygons"] + #[doc = " that cover the same area."] + #[doc = " All the vertices of the output"] + #[doc = " geometry must fall on the grid defined by the gridSize, and the"] + #[doc = " output will be a valid geometry."] + #[doc = " \\param g input geometry"] + #[doc = " \\param gridSize the cell size of the precision grid"] + #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Optimized union algorithm for polygonal inputs that are correctly"] + #[doc = " noded and do not overlap. It will generate an error (return NULL)"] + #[doc = " for inputs that do not satisfy this constraint."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A geometry that covers all the points of the input geometry."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Intersection optimized for a rectangular clipping polygon."] + #[doc = " Supposed to be faster than using GEOSIntersection(). Not"] + #[doc = " guaranteed to return valid results."] + #[doc = " \\param g The input geometry to be clipped"] + #[doc = " \\param xmin Left bound of clipping rectangle"] + #[doc = " \\param ymin Lower bound of clipping rectangle"] + #[doc = " \\param xmax Right bound of clipping rectangle"] + #[doc = " \\param ymax Upper bound of clipping rectangle"] + #[doc = " \\return The clipped geometry or NULL on exception"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::intersection::RectangleIntersection"] + pub fn GEOSClipByRect( + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Find paths shared between the two given lineal geometries."] + #[doc = ""] + #[doc = " Returns a GeometryCollection having two elements:"] + #[doc = ""] + #[doc = " - first element is a MultiLineString containing shared paths"] + #[doc = " having the _same_ direction on both inputs"] + #[doc = " - second element is a MultiLineString containing shared paths"] + #[doc = " having the _opposite_ direction on the two inputs"] + #[doc = ""] + #[doc = " \\param g1 An input geometry"] + #[doc = " \\param g2 An input geometry"] + #[doc = " \\return The shared paths"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::sharedpaths::SharedPathsOp"] + pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Buffer a geometry."] + #[doc = " \\param g The input geometry to be buffered."] + #[doc = " \\param width The distance by which to expand the geometry (or contract)"] + #[doc = " if the value is negative."] + #[doc = " \\param quadsegs The number of segments per quadrant to generate. More"] + #[doc = " segments provides a more \"precise\" buffer at the expense of size."] + #[doc = " \\return A \\ref GEOSGeometry of the buffered result."] + #[doc = " NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSBuffer( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Create a default GEOSBufferParams object for controlling the shape"] + #[doc = " of buffered generated by \\ref GEOSBuffer."] + #[doc = " \\return A newly allocated GEOSBufferParams. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSBufferParams_destroy()."] + pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; +} +extern "C" { + #[doc = " Destroy a GEOSBufferParams and free all associated memory."] + #[doc = " \\param parms The object to destroy."] + pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); +} +extern "C" { + #[doc = " Set the end cap type of a GEOSBufferParams to the desired style,"] + #[doc = " which must be one enumerated in \\ref GEOSBufCapStyles."] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setEndCapStyle( + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Set the join type of a GEOSBufferParams to the desired style,"] + #[doc = " which must be one enumerated in \\ref GEOSBufJoinStyles."] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setJoinStyle( + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Set the mitre limit of a GEOSBufferParams to the desired size."] + #[doc = " For acute angles, a mitre join can extend very very far from"] + #[doc = " the input geometry, which is probably not desired. The"] + #[doc = " mitre limit places an upper bound on that."] + #[doc = " \\param p The GEOSBufferParams to operate on"] + #[doc = " \\param mitreLimit The limit to set"] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + -> libc::c_int; +} +extern "C" { + #[doc = " Set the number of segments to use to stroke each quadrant"] + #[doc = " of circular arcs generated by the buffering process. More"] + #[doc = " segments means a smoother output, but with larger size."] + #[doc = " \\param p The GEOSBufferParams to operate on"] + #[doc = " \\param quadSegs Number of segments per quadrant"] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setQuadrantSegments( + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Sets whether the computed buffer should be single-sided."] + #[doc = " A single-sided buffer is constructed on only one side of each input line."] + #[doc = " \\see geos::operation::buffer::BufferParameters::setSingleSided"] + #[doc = " \\param p The GEOSBufferParams to operate on"] + #[doc = " \\param singleSided Set to 1 for single-sided output 0 otherwise"] + #[doc = " \\return 0 on exception, 1 on success."] + pub fn GEOSBufferParams_setSingleSided( + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Generates a buffer using the special parameters in the GEOSBufferParams"] + #[doc = " \\param g The geometry to buffer"] + #[doc = " \\param p The parameters to apply to the buffer process"] + #[doc = " \\param width The buffer distance"] + #[doc = " \\return The buffered geometry, or NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSBufferWithParams( + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Generate a buffer using the provided style parameters."] + #[doc = " \\param g The geometry to buffer"] + #[doc = " \\param width Width of the buffer"] + #[doc = " \\param quadsegs Number of segments per quadrant"] + #[doc = " \\param endCapStyle See \\ref GEOSBufCapStyles"] + #[doc = " \\param joinStyle See \\ref GEOSBufJoinStyles"] + #[doc = " \\param mitreLimit See GEOSBufferParams_setMitreLimit"] + #[doc = " \\return The buffered geometry, or NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSBufferWithStyle( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Generates offset curve line(s) for a geometry."] + #[doc = " Handles all geometry types as input."] + #[doc = ""] + #[doc = " - For a LineString the result is a LineString."] + #[doc = " - For a Point the result is an empty LineString."] + #[doc = " - For a Polygon the result is the boundary lines(s) of the polygon buffered to the offset distance"] + #[doc = " (which may be a MultiLineString)."] + #[doc = " - For a collection the result is a collection of the element offset curves."] + #[doc = " \\param g The linear geometry to offset from"] + #[doc = " \\param width Distance to offset from the curve."] + #[doc = " Negative for a right-side offset."] + #[doc = " Positive for a left-side offset."] + #[doc = " \\param quadsegs Number of segments per quadrant"] + #[doc = " \\param joinStyle See \\ref GEOSBufJoinStyles"] + #[doc = " \\param mitreLimit See GEOSBufferParams_setMitreLimit"] + #[doc = " \\return The offset geometry. Returns NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::buffer::BufferBuilder::bufferLineSingleSided"] + pub fn GEOSOffsetCurve( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns minimum rectangular polygon that contains the geometry."] + #[doc = " \\param g The geometry to calculate an envelope for"] + #[doc = " \\return A newly allocated polygonal envelope. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the \"boundary\" of a geometry, as defined by the DE9IM:"] + #[doc = ""] + #[doc = " - the boundary of a polygon is the linear rings dividing the exterior"] + #[doc = " from the interior"] + #[doc = " - the boundary of a linestring is the end points"] + #[doc = " - the boundary of a point is the point"] + #[doc = ""] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the boundary. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns convex hull of a geometry. The smallest convex Geometry"] + #[doc = " that contains all the points in the input Geometry"] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the convex hull. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::overlayng::OverlayNG"] + pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns \"concave hull\" of a geometry. The concave hull is fully"] + #[doc = " contained within the convex hull and also contains all the"] + #[doc = " points of the input, but in a smaller area."] + #[doc = " The area ratio is the ratio"] + #[doc = " of the area of the convex hull and the concave hull. Frequently"] + #[doc = " used to convert a multi-point into a polygonal area."] + #[doc = " that contains all the points in the input Geometry"] + #[doc = " \\param g The input geometry"] + #[doc = " \\param ratio The ratio value, between 0 and 1."] + #[doc = " \\param allowHoles When non-zero, the polygonal output may contain holes."] + #[doc = " \\return A newly allocated geometry of the concave hull. NULL on exception."] + #[doc = " The area ratio is the ratio of the concave hull area to the convex hull area."] + #[doc = " 1 produces the convex hull; 0 produces maximum concaveness."] + #[doc = " The Length Ratio is a fraction determining the length of the longest"] + #[doc = " edge in the computed hull. 1 produces the convex hull;"] + #[doc = " 0 produces a hull with maximum concaveness"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::hull::ConcaveHull"] + pub fn GEOSConcaveHull( + g: *const GEOSGeometry, + ratio: f64, + allowHoles: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Computes a boundary-respecting hull of a polygonal geometry,"] + #[doc = " with hull shape determined by a target parameter"] + #[doc = " specifying the fraction of the input vertices retained in the result."] + #[doc = " Larger values produce less concave results."] + #[doc = " A value of 1 produces the convex hull; a value of 0 produces the original geometry."] + #[doc = " An outer hull is computed if the parameter is positive,"] + #[doc = " an inner hull is computed if it is negative."] + #[doc = ""] + #[doc = " \\param g the polygonal geometry to process"] + #[doc = " \\param isOuter indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner)"] + #[doc = " \\param vertexNumFraction the target fraction of the count of input vertices to retain in result"] + #[doc = " \\return A newly allocated geometry of the concave hull. NULL on exception."] + #[doc = ""] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::simplify::PolygonHullSimplifier"] + pub fn GEOSPolygonHullSimplify( + g: *const GEOSGeometry, + isOuter: libc::c_uint, + vertexNumFraction: f64, + ) -> *mut GEOSGeometry; +} +#[doc = " See geos::simplify::PolygonHullSimplifier::hull()"] +pub const GEOSPolygonHullParameterModes_GEOSHULL_PARAM_VERTEX_RATIO: GEOSPolygonHullParameterModes = + 1; +#[doc = " See geos::simplify::PolygonHullSimplifier::hullByAreaDelta()"] +pub const GEOSPolygonHullParameterModes_GEOSHULL_PARAM_AREA_RATIO: GEOSPolygonHullParameterModes = + 2; +#[doc = " Controls the behavior of the GEOSPolygonHullSimplify parameter."] +pub type GEOSPolygonHullParameterModes = libc::c_uint; +extern "C" { + #[doc = " Computes a topology-preserving simplified hull of a polygonal geometry,"] + #[doc = " with hull shape determined by the parameter, controlled by a parameter"] + #[doc = " mode, which is one defined in GEOSPolygonHullParameterModes. In general,"] + #[doc = " larger values compute less concave results and value of 0"] + #[doc = " produces the original geometry."] + #[doc = " Either outer or inner hulls can be computed."] + #[doc = ""] + #[doc = " \\param g the polygonal geometry to process"] + #[doc = " \\param isOuter indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner)"] + #[doc = " \\param parameterMode the interpretation to apply to the parameter argument"] + #[doc = " \\param parameter the target ratio of area difference to original area"] + #[doc = " \\return A newly allocated geometry of the concave hull. NULL on exception."] + #[doc = ""] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::simplify::PolygonHullSimplifier"] + pub fn GEOSPolygonHullSimplifyMode( + g: *const GEOSGeometry, + isOuter: libc::c_uint, + parameterMode: libc::c_uint, + parameter: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Constructs a concave hull of a set of polygons, respecting"] + #[doc = " the polygons as constraints."] + #[doc = ""] + #[doc = " A concave hull is a possibly non-convex polygon containing all the input polygons."] + #[doc = " A given set of polygons has a sequence of hulls of increasing concaveness,"] + #[doc = " determined by a numeric target parameter."] + #[doc = " The computed hull \"fills the gap\" between the polygons,"] + #[doc = " and does not intersect their interior."] + #[doc = ""] + #[doc = " The concave hull is constructed by removing the longest outer edges"] + #[doc = " of the Delaunay Triangulation of the space between the polygons,"] + #[doc = " until the target criterion parameter is reached."] + #[doc = ""] + #[doc = " \"Maximum Edge Length\" constrains the length of the longest edge between the polygons to be no larger than this value."] + #[doc = ""] + #[doc = " \\param g the valid MultiPolygon geometry to process"] + #[doc = " \\param lengthRatio determine the Maximum Edge Length as a"] + #[doc = " fraction of the difference between the longest and"] + #[doc = " shortest edge lengths between the polygons."] + #[doc = " This normalizes the Maximum Edge Length to be scale-free."] + #[doc = " A value of 1 produces the convex hull; a value of 0 produces"] + #[doc = " the original polygons."] + #[doc = " \\param isHolesAllowed is the concave hull allowed to contain holes?"] + #[doc = " \\param isTight does the hull follow the outer boundaries of the input polygons."] + #[doc = " \\return A newly allocated geometry of the concave hull. NULL on exception."] + #[doc = ""] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::hull::ConcaveHullOfPolygons"] + #[doc = ""] + #[doc = " The input polygons *must* form a *valid* MultiPolygon"] + #[doc = " (i.e. they must be non-overlapping)."] + pub fn GEOSConcaveHullOfPolygons( + g: *const GEOSGeometry, + lengthRatio: f64, + isTight: libc::c_uint, + isHolesAllowed: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the minimum rotated rectangular POLYGON which encloses"] + #[doc = " the input geometry. The rectangle has width equal to the"] + #[doc = " minimum diameter, and a longer length. If the convex hill of"] + #[doc = " the input is degenerate (a line or point) a linestring or point"] + #[doc = " is returned. The minimum rotated rectangle can be used as an"] + #[doc = " extremely generalized representation for the given geometry."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the rotated envelope. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Constructs the \"maximum inscribed circle\" (MIC) for a polygonal geometry,"] + #[doc = " up to a specified tolerance."] + #[doc = " The MIC is determined by a point in the interior of the area"] + #[doc = " which has the farthest distance from the area boundary, along with a boundary point at that distance."] + #[doc = " In the context of geography the center of the MIC is known as the"] + #[doc = " \"pole of inaccessibility\". A cartographic use case is to determine a suitable point"] + #[doc = " to place a map label within a polygon."] + #[doc = " The radius length of the MIC is a measure of how \"narrow\" a polygon is. It is the"] + #[doc = " distance at which the negative buffer becomes empty."] + #[doc = " The class supports polygons with holes and multipolygons."] + #[doc = " The implementation uses a successive-approximation technique over a grid of square cells covering the area geometry."] + #[doc = " The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant"] + #[doc = " way by using spatial indexes."] + #[doc = " Returns a two-point linestring, with one point at the center of the inscribed circle and the other"] + #[doc = " on the boundary of the inscribed circle."] + #[doc = " \\param g Input geometry"] + #[doc = " \\param tolerance Stop the algorithm when the search area is smaller than this tolerance"] + #[doc = " \\return A newly allocated geometry of the MIC. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::construct::MaximumInscribedCircle"] + pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Constructs the \"largest empty circle\" (LEC) for a set of obstacle geometries, up to a"] + #[doc = " specified tolerance. The obstacles are point and line geometries. Polygonal obstacles willl"] + #[doc = " be treated as linear features."] + #[doc = " The LEC is the largest circle which has its **center** inside the boundary,"] + #[doc = " and whose interior does not intersect with any obstacle. If no boundary is provided, the"] + #[doc = " convex hull of the obstacles is used as the boundary."] + #[doc = " The LEC center is the point in the interior of the boundary which has the farthest distance from"] + #[doc = " the obstacles (up to tolerance). The LEC is determined by the center point and a point lying on an"] + #[doc = " obstacle indicating the circle radius."] + #[doc = " The implementation uses a successive-approximation technique over a grid of square cells covering the obstacles and boundary."] + #[doc = " The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant"] + #[doc = " way by using spatial indexes."] + #[doc = " Returns a two-point linestring, with the start point at the center of the inscribed circle and the end"] + #[doc = " on the boundary of the inscribed circle."] + #[doc = " \\param obstacles The geometries that the LEC must fit within without covering"] + #[doc = " \\param boundary The area within which the LEC must reside"] + #[doc = " \\param tolerance Stop the algorithm when the search area is smaller than this tolerance"] + #[doc = " \\return A newly allocated geometry of the LEC. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::construct::LargestEmptyCircle"] + pub fn GEOSLargestEmptyCircle( + obstacles: *const GEOSGeometry, + boundary: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns a linestring geometry which represents the minimum diameter of the geometry."] + #[doc = " The minimum diameter is defined to be the width of the smallest band that"] + #[doc = " contains the geometry, where a band is a strip of the plane defined"] + #[doc = " by two parallel lines. This can be thought of as the smallest hole that the geometry"] + #[doc = " can be moved through, with a single rotation."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A newly allocated geometry of the LEC. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::MinimumDiameter"] + pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns a point that is inside the boundary of a polygonal geometry."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A point that is inside the input"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::InteriorPointArea"] + pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns a point at the center of mass of the input."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return A point at the center of mass of the input"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::Centroid"] + pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns a geometry which represents the \"minimum bounding circle\","] + #[doc = " the smallest circle that contains the input."] + #[doc = " \\param[in] g The input geometry"] + #[doc = " \\param[out] radius Pointer will be filled with output radius."] + #[doc = " \\param[out] center Pointer will be filled with output circle center. Caller must free."] + #[doc = " \\return The circle geometry or NULL on exception"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::algorithm::MinimumBoundingCircle::getCircle"] + pub fn GEOSMinimumBoundingCircle( + g: *const GEOSGeometry, + radius: *mut f64, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return a Delaunay triangulation of the vertices of the given geometry."] + #[doc = ""] + #[doc = " \\param g the input geometry whose vertices will be used as \"sites\""] + #[doc = " \\param tolerance optional snapping tolerance to use for improved robustness"] + #[doc = " \\param onlyEdges if non-zero will return a MultiLineString, otherwise it will"] + #[doc = " return a GeometryCollection containing triangular Polygons."] + #[doc = ""] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSDelaunayTriangulation( + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return a constrained Delaunay triangulation of the vertices of the"] + #[doc = " given polygon(s)."] + #[doc = " For non-polygonal inputs, returns an empty geometry collection."] + #[doc = ""] + #[doc = " \\param g the input geometry whose rings will be used as input"] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSConstrainedDelaunayTriangulation(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Returns the Voronoi polygons of the vertices of the given geometry."] + #[doc = ""] + #[doc = " \\param g the input geometry whose vertices will be used as sites."] + #[doc = " \\param tolerance snapping tolerance to use for improved robustness"] + #[doc = " \\param onlyEdges whether to return only edges of the voronoi cells"] + #[doc = " \\param env clipping envelope for the returned diagram, automatically"] + #[doc = " determined if env is NULL."] + #[doc = " The diagram will be clipped to the larger"] + #[doc = " of this envelope or an envelope surrounding the sites."] + #[doc = ""] + #[doc = " \\return A newly allocated geometry. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSVoronoiDiagram( + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " For linear inputs, returns a new geometry in which no lines cross"] + #[doc = " each other, and all touching occurs at end points."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return The noded geometry or NULL on exception"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::noding::GeometryNoder::node"] + pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Polygonizes a set of Geometries which contain linework that"] + #[doc = " represents the edges of a planar graph."] + #[doc = ""] + #[doc = " All types of Geometry are accepted as input; the constituent"] + #[doc = " linework is extracted as the edges to be polygonized."] + #[doc = ""] + #[doc = " The edges must be correctly noded; that is, they must only meet"] + #[doc = " at their endpoints. Polygonization will accept incorrectly noded"] + #[doc = " input but will not form polygons from non-noded edges, and reports"] + #[doc = " them as errors."] + #[doc = ""] + #[doc = " The Polygonizer reports the following kinds of errors:"] + #[doc = ""] + #[doc = " - Dangles - edges which have one or both ends which are"] + #[doc = " not incident on another edge endpoint"] + #[doc = " - Cut Edges - edges which are connected at both ends but"] + #[doc = " which do not form part of a polygon"] + #[doc = " - Invalid Ring Lines - edges which form rings which are invalid"] + #[doc = " (e.g. the component lines contain a self-intersection)"] + #[doc = ""] + #[doc = " Errors are reported to output parameters \"cuts\", \"dangles\" and"] + #[doc = " \"invalid\" (if not-null). Formed polygons are returned as a"] + #[doc = " collection. NULL is returned on exception. All returned"] + #[doc = " geometries must be destroyed by caller."] + #[doc = ""] + #[doc = " The GEOSPolygonize_valid() variant allows extracting only polygons"] + #[doc = " which form a valid polygonal result. The set of extracted polygons"] + #[doc = " is guaranteed to be edge-disjoint. This is useful when it is known"] + #[doc = " that the input lines form a valid polygonal geometry (which may"] + #[doc = " include holes or nested polygons)."] + #[doc = ""] + #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] + #[doc = " \\param ngeoms Size of the geoms array."] + #[doc = " \\return The polygonal output geometry."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::Polygonizer"] + pub fn GEOSPolygonize( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Same polygonizing behavior as GEOSPolygonize(), but only returning results"] + #[doc = " that are valid."] + #[doc = ""] + #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] + #[doc = " \\param ngeoms Size of the geoms array."] + #[doc = " \\return The polygonal output geometry."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::Polygonizer"] + pub fn GEOSPolygonize_valid( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Perform the polygonization as GEOSPolygonize() but return only the"] + #[doc = " \"cut edges\", the linear features that are connected at both ends,"] + #[doc = " do *not* participate in the final polygon."] + #[doc = ""] + #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] + #[doc = " \\param ngeoms Size of the geoms array."] + #[doc = " \\return The \"cut edges\""] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::Polygonizer"] + pub fn GEOSPolygonizer_getCutEdges( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Perform the polygonization as GEOSPolygonize() and return the"] + #[doc = " polygonal result as well as all extra ouputs."] + #[doc = ""] + #[doc = " \\param[in] input A single geometry with all the input lines to polygonize."] + #[doc = " \\param[out] cuts Pointer to hold \"cut edges\", connected on both ends but not part of output. Caller must free."] + #[doc = " \\param[out] dangles Pointer to hold \"dangles\", connected one end but not part of output. Caller must free."] + #[doc = " \\param[out] invalid Pointer to hold invalid outputs, polygons formed but not valid. Caller must free."] + #[doc = " \\return The polygonal valid output"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::Polygonizer"] + pub fn GEOSPolygonize_full( + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalid: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Perform a polygonization using all the linework, assuming that"] + #[doc = " rings contained within rings are empty holes, rather then"] + #[doc = " extra polygons."] + #[doc = " \\param g The input linework"] + #[doc = " \\return The polygonal output"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::polygonize::BuildArea"] + pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Densifies a geometry using a given distance tolerance."] + #[doc = " Additional vertices will be added to every line segment"] + #[doc = " that is greater this tolerance; these vertices will"] + #[doc = " evenly subdivide that segment."] + #[doc = " Only linear components of input geometry are densified."] + #[doc = " \\param g The geometry to densify"] + #[doc = " \\param tolerance the distance tolerance to densify"] + #[doc = " \\return The densified geometry, or NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSDensify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Sews together a set of fully noded LineStrings"] + #[doc = " removing any cardinality 2 nodes in the linework."] + #[doc = " \\param g The input linework"] + #[doc = " \\return The merged linework"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::linemerge::LineMerger"] + pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Sews together a set of fully noded LineStrings"] + #[doc = " removing any cardinality 2 nodes in the linework"] + #[doc = " only if possible without changing order of points."] + #[doc = " \\param g The input linework"] + #[doc = " \\return The merged linework"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::operation::linemerge::LineMerger"] + pub fn GEOSLineMergeDirected(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " For geometries with coordinate sequences, reverses the order"] + #[doc = " of the sequences. Converts CCW rings to CW. Reverses direction"] + #[doc = " of LineStrings."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return The reversed geometry"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Apply the"] + #[doc = " [Douglas/Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)"] + #[doc = " to the coordinate sequences of the input geometry."] + #[doc = " Removes \"unnecessary\" vertices, vertices"] + #[doc = " that are co-linear within the tolerance distance."] + #[doc = " \\param g The input geometry"] + #[doc = " \\param tolerance The tolerance to apply. Larger tolerance leads to simpler output."] + #[doc = " \\return The simplified geometry"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::simplify::DouglasPeuckerSimplifier"] + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Apply the"] + #[doc = " [Douglas/Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)"] + #[doc = " to the coordinate sequences of the input geometry."] + #[doc = " Removes \"unnecessary\" vertices, vertices"] + #[doc = " that are co-linear within the tolerance distance."] + #[doc = " Returns a valid output geometry, checking for collapses, ring-intersections, etc"] + #[doc = " and attempting to avoid. More computationally expensive than GEOSSimplify()"] + #[doc = " \\param g The input geometry"] + #[doc = " \\param tolerance The tolerance to apply. Larger tolerance leads to simpler output."] + #[doc = " \\return The simplified geometry"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + #[doc = " \\see geos::simplify::DouglasPeuckerSimplifier"] + pub fn GEOSTopologyPreserveSimplify( + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Return all distinct vertices of input geometry as a MultiPoint."] + #[doc = " Note that only 2 dimensions of the vertices are considered when"] + #[doc = " testing for equality."] + #[doc = " \\param g The input geometry"] + #[doc = " \\return The distinct points"] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Calculate the"] + #[doc = " [Hilbert code](https://en.wikipedia.org/wiki/Hilbert_curve)"] + #[doc = " of the centroid of a geometry relative to an extent."] + #[doc = " This allows sorting geometries in a deterministic way, such that similar Hilbert codes are"] + #[doc = " likely to be near each other in two-dimensional space."] + #[doc = " The caller must ensure that the geometry is contained within the extent."] + #[doc = " \\param[in] geom Input geometry, must be non-empty"] + #[doc = " \\param[in] extent Extent within which to calculate the Hilbert code for geom"] + #[doc = " \\param[in] level The level of precision of the Hilbert curve, up to 16"] + #[doc = " \\param[out] code Pointer to be filled in with Hilbert code result"] + #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSHilbertCode( + geom: *const GEOSGeometry, + extent: *const GEOSGeometry, + level: libc::c_uint, + code: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Apply XY coordinate transform callback to all coordinates in a copy of"] + #[doc = " input geometry. If the callback returns an error, returned geometry will be"] + #[doc = " NULL. Z values, if present, are not modified by this function."] + #[doc = " \\param[in] g Input geometry"] + #[doc = " \\param[in] callback a function to be executed for each coordinate in the"] + #[doc = "geometry. The callback takes 3 parameters: x and y coordinate"] + #[doc = "values to be updated and a void userdata pointer."] + #[doc = " \\param userdata an optional pointer to pe passed to 'callback' as an argument"] + #[doc = " \\return a copy of the input geometry with transformed coordinates."] + #[doc = " Caller must free with GEOSGeom_destroy()."] + pub fn GEOSGeom_transformXY( + g: *const GEOSGeometry, + callback: GEOSTransformXYCallback, + userdata: *mut libc::c_void, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Snap first geometry onto second within the given tolerance."] + #[doc = " \\param input An input geometry"] + #[doc = " \\param snap_target A geometry to snap the input to"] + #[doc = " \\param tolerance Snapping tolerance"] + #[doc = " \\return The snapped verion of the input. NULL on exception."] + #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSSnap( + input: *const GEOSGeometry, + snap_target: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Change the coordinate precision of a geometry. This will"] + #[doc = " affect the precision of the existing geometry as well as"] + #[doc = " any geometries derived from this geometry using overlay"] + #[doc = " functions. The output will be a valid \\ref GEOSGeometry."] + #[doc = ""] + #[doc = " Note that operations will always be performed in the precision"] + #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] + #[doc = " That same precision will be attached to the operation outputs."] + #[doc = ""] + #[doc = " In the Default and GEOS_PREC_KEEP_COLLAPSED modes invalid input"] + #[doc = " may cause an error to occur, unless the invalidity is below"] + #[doc = " the scale of the requested precision"] + #[doc = ""] + #[doc = " There are only 3 modes. The GEOS_PREC_NO_TOPO mode"] + #[doc = " takes precedence over GEOS_PREC_KEEP_COLLAPSED."] + #[doc = " So the combination GEOS_PREC_NO_TOPO || GEOS_PREC_KEEP_COLLAPSED"] + #[doc = " has the same semantics as GEOS_PREC_NO_TOPO"] + #[doc = ""] + #[doc = " \\param g Input geometry"] + #[doc = " \\param gridSize cell size of grid to round coordinates to,"] + #[doc = " or 0 for FLOATING precision"] + #[doc = " \\param flags The bitwise OR of members of the \\ref GEOSPrecisionRules enum"] + #[doc = " \\return The precision reduced result."] + #[doc = " Caller must free with GEOSGeom_destroy()"] + #[doc = " NULL on exception."] + pub fn GEOSGeom_setPrecision( + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " True if no point of either geometry touchess or is within the other."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::disjoint"] + pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries share boundaries at one or more points, but do"] + #[doc = " not have interior overlaps."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::touches"] + pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries are not disjoint."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::intersects"] + pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries interiors interact but their boundares do not."] + #[doc = " Most useful for finding line crosses cases."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::crosses"] + pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometry g1 is completely within g2, and not"] + #[doc = " touching the boundary of g2."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::within"] + pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometry g2 is completely within g1."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::contains"] + pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries share interiors but are neither"] + #[doc = " within nor contained."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::overlaps"] + pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometries cover the same space on the place."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::equals"] + pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometry g1 is completely within g2, including possibly"] + #[doc = " touching the boundary of g2."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::covers"] + pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " True if geometry g2 is completely within g1, including possibly"] + #[doc = " touching the boundary of g1."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see geos::geom::Geometry::coveredby"] + pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Determine pointwise equivalence of two geometries, by"] + #[doc = " checking that they have identical structure"] + #[doc = " and that each vertex of g2 is"] + #[doc = " within the distance tolerance of the corresponding vertex in g1."] + #[doc = " Unlike GEOSEquals(), geometries that are topologically equivalent but have different"] + #[doc = " representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not"] + #[doc = " considered equal by GEOSEqualsExact()."] + #[doc = " \\param g1 Input geometry"] + #[doc = " \\param g2 Input geometry"] + #[doc = " \\param tolerance Tolerance to determine vertex equality"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSNormalize()"] + pub fn GEOSEqualsExact( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Calculate the DE9IM pattern for this geometry pair"] + #[doc = " and compare against the provided pattern to check for"] + #[doc = " consistency. If the result and pattern are consistent"] + #[doc = " return true. The pattern may include glob \"*\" characters"] + #[doc = " for portions that are allowed to match any value."] + #[doc = " \\see geos::geom::Geometry::relate"] + #[doc = " \\param g1 First geometry in pair"] + #[doc = " \\param g2 Second geometry in pair"] + #[doc = " \\param pat DE9IM pattern to check"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSRelatePattern( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Calculate and return the DE9IM pattern for this geometry pair."] + #[doc = " \\see geos::geom::Geometry::relate"] + #[doc = " \\param g1 First geometry in pair"] + #[doc = " \\param g2 Second geometry in pair"] + #[doc = " \\return DE9IM string. Caller is responsible for freeing with GEOSFree()."] + #[doc = " NULL on exception"] + pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Compare two DE9IM patterns and return true if they"] + #[doc = " are consistent."] + #[doc = " \\param mat Complete DE9IM string (does not have \"*\")"] + #[doc = " \\param pat Pattern to match to (may contain \"*\")"] + #[doc = " \\return 1 on true, 0 on false, 2 on exception"] + pub fn GEOSRelatePatternMatch( + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Calculate and return the DE9IM pattern for this geometry pair."] + #[doc = " Apply the supplied \\ref GEOSRelateBoundaryNodeRules."] + #[doc = " \\see geos::geom::Geometry::relate"] + #[doc = " \\see geos::algorithm::BoundaryNodeRule"] + #[doc = " \\param g1 First geometry in pair"] + #[doc = " \\param g2 Second geometry in pair"] + #[doc = " \\param bnr A member of the \\ref GEOSRelateBoundaryNodeRules enum"] + #[doc = " \\return DE9IM string. Caller is responsible for freeing with GEOSFree()."] + #[doc = " NULL on exception"] + pub fn GEOSRelateBoundaryNodeRule( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Create a Prepared Geometry."] + #[doc = " The caller retains ownership of the base geometry, and after"] + #[doc = " processing is complete, must free **both** the prepared and the"] + #[doc = " base geometry. (Ideally, destroy the prepared geometry first, as"] + #[doc = " it has an internal reference to the base geometry.)"] + #[doc = ""] + #[doc = " \\param g The base geometry to wrap in a prepared geometry."] + #[doc = " \\return A prepared geometry. Caller is responsible for freeing with"] + #[doc = " GEOSPreparedGeom_destroy()"] + pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSPreparedGeometry."] + #[doc = " Caller must separately free the base \\ref GEOSGeometry used"] + #[doc = " to create the prepared geometry."] + #[doc = " \\param g Prepared geometry to destroy."] + pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry is contained."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSContains"] + pub fn GEOSPreparedContains( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry is contained properly."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSContainsProperly"] + pub fn GEOSPreparedContainsProperly( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry is covered by."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSCoveredBy"] + pub fn GEOSPreparedCoveredBy( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry covers."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSCovers"] + pub fn GEOSPreparedCovers( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] + #[doc = " calculation of whether the provided geometry crosses."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSCrosses"] + pub fn GEOSPreparedCrosses( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry is disjoint."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSDisjoin"] + pub fn GEOSPreparedDisjoint( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry is disjoint."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSDisjoin"] + pub fn GEOSPreparedIntersects( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry overlaps."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSOverlaps"] + pub fn GEOSPreparedOverlaps( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry touches."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSTouches"] + pub fn GEOSPreparedTouches( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation of whether the provided geometry is within."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] + #[doc = " \\see GEOSWithin"] + pub fn GEOSPreparedWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] + #[doc = " calculation to find the nearest points between the"] + #[doc = " prepared and provided geometry."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\returns A coordinate sequence containing the nearest points, or NULL on exception."] + #[doc = " The first point in the sequence is from the prepared geometry, and the"] + #[doc = " seconds is from the other argument."] + pub fn GEOSPreparedNearestPoints( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDistance do a high performance"] + #[doc = " calculation to find the distance points between the"] + #[doc = " prepared and provided geometry. Useful for situations where"] + #[doc = " one geometry is large and static and needs to be tested"] + #[doc = " against a large number of other geometries."] + #[doc = " \\param[in] pg1 The prepared geometry"] + #[doc = " \\param[in] g2 The geometry to test"] + #[doc = " \\param[out] dist Pointer to store the result in"] + #[doc = " \\return 1 on success"] + pub fn GEOSPreparedDistance( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Using a \\ref GEOSPreparedDistanceWithin do a high performance"] + #[doc = " calculation to find whether the prepared and provided geometry"] + #[doc = " are within the given max distance."] + #[doc = " Useful for situations where"] + #[doc = " one geometry is large and static and needs to be tested"] + #[doc = " against a large number of other geometries."] + #[doc = " \\param pg1 The prepared geometry"] + #[doc = " \\param g2 The geometry to test"] + #[doc = " \\param dist The max distance"] + #[doc = " \\return 1 on success"] + pub fn GEOSPreparedDistanceWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Create a new \\ref GEOSSTRtree using the Sort-Tile-Recursive algorithm"] + #[doc = " ([STRtree](https://en.wikipedia.org/wiki/R-tree))"] + #[doc = " for two-dimensional spatial data."] + #[doc = ""] + #[doc = " \\param nodeCapacity The maximum number of child nodes that a node may have."] + #[doc = " The minimum recommended capacity value is 4."] + #[doc = " If unsure, use a default node capacity of 10."] + #[doc = " \\return a pointer to the created tree"] + pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; +} +extern "C" { + #[doc = " Insert an item into an \\ref GEOSSTRtree"] + #[doc = ""] + #[doc = " \\param tree the \\ref GEOSSTRtree in which the item should be inserted"] + #[doc = " \\param g a GEOSGeometry whose envelope corresponds to the extent of 'item'. As of GEOS 3.9, this envelope will be"] + #[doc = " copied into the tree and the caller may destroy `g` while the tree is still in use. Before GEOS 3.9, `g`"] + #[doc = " must be retained until the tree is destroyed."] + #[doc = " \\param item the item to insert into the tree"] + #[doc = " \\note The tree does **not** take ownership of the geometry or the item."] + pub fn GEOSSTRtree_insert( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " Query an \\ref GEOSSTRtree for items intersecting a specified envelope"] + #[doc = ""] + #[doc = " \\param tree the \\ref GEOSSTRtree to search"] + #[doc = " \\param g a GEOSGeomety from which a query envelope will be extracted"] + #[doc = " \\param callback a function to be executed for each item in the tree whose envelope intersects"] + #[doc = " the envelope of 'g'. The callback function should take two parameters: a void"] + #[doc = " pointer representing the located item in the tree, and a void userdata pointer."] + #[doc = " \\param userdata an optional pointer to pe passed to 'callback' as an argument"] + pub fn GEOSSTRtree_query( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " Returns the nearest item in the \\ref GEOSSTRtree to the supplied geometry."] + #[doc = " All items in the tree MUST be of type \\ref GEOSGeometry."] + #[doc = " If this is not the case, use GEOSSTRtree_nearest_generic() instead."] + #[doc = ""] + #[doc = " \\param tree the \\ref GEOSSTRtree to search"] + #[doc = " \\param geom the geometry with which the tree should be queried"] + #[doc = " \\return a const pointer to the nearest \\ref GEOSGeometry in the tree to 'geom', or NULL in"] + #[doc = " case of exception"] + pub fn GEOSSTRtree_nearest( + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + #[doc = " Returns the nearest item in the \\ref GEOSSTRtree to the supplied item"] + #[doc = ""] + #[doc = " \\param tree the STRtree to search"] + #[doc = " \\param item the item with which the tree should be queried"] + #[doc = " \\param itemEnvelope a GEOSGeometry having the bounding box of 'item'"] + #[doc = " \\param distancefn a function that can compute the distance between two items"] + #[doc = " in the STRtree. The function should return zero in case of error,"] + #[doc = " and should store the computed distance to the location pointed to by"] + #[doc = " the 'distance' argument. The computed distance between two items"] + #[doc = " must not exceed the Cartesian distance between their envelopes."] + #[doc = " \\param userdata optional pointer to arbitrary data; will be passed to distancefn"] + #[doc = " each time it is called."] + #[doc = " \\return a const pointer to the nearest item in the tree to 'item', or NULL in"] + #[doc = " case of exception"] + pub fn GEOSSTRtree_nearest_generic( + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + #[doc = " Iterate over all items in the \\ref GEOSSTRtree."] + #[doc = ""] + #[doc = " \\param tree the STRtree over which to iterate"] + #[doc = " \\param callback a function to be executed for each item in the tree."] + #[doc = " \\param userdata payload to pass the callback function."] + pub fn GEOSSTRtree_iterate( + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + #[doc = " Removes an item from the \\ref GEOSSTRtree"] + #[doc = ""] + #[doc = " \\param tree the STRtree from which to remove an item"] + #[doc = " \\param g the envelope of the item to remove"] + #[doc = " \\param item the item to remove"] + #[doc = " \\return 0 if the item was not removed;"] + #[doc = " 1 if the item was removed;"] + #[doc = " 2 if an exception occurred"] + pub fn GEOSSTRtree_remove( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Frees all the memory associated with a \\ref GEOSSTRtree."] + #[doc = " Only the tree is freed. The geometries and items fed into"] + #[doc = " GEOSSTRtree_insert() are not owned by the tree, and are"] + #[doc = " still left to the caller to manage."] + pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " Computes the coordinate where two line segments intersect, if any"] + #[doc = ""] + #[doc = " \\param[in] ax0 x-coordinate of 1st point in 1st segment"] + #[doc = " \\param[in] ay0 y-coordinate of 1st point in 1st segment"] + #[doc = " \\param[in] ax1 x-coordinate of 2nd point in 1st segment"] + #[doc = " \\param[in] ay1 y-coordinate of 2nd point in 1st segment"] + #[doc = " \\param[in] bx0 x-coordinate of 1st point in 2nd segment"] + #[doc = " \\param[in] by0 y-coordinate of 1st point in 2nd segment"] + #[doc = " \\param[in] bx1 x-coordinate of 2nd point in 2nd segment"] + #[doc = " \\param[in] by1 y-coordinate of 2nd point in 2nd segment"] + #[doc = " \\param[out] cx x-coordinate of intersection point"] + #[doc = " \\param[out] cy y-coordinate of intersection point"] + #[doc = ""] + #[doc = " \\return 0 on error, 1 on success, -1 if segments do not intersect"] + pub fn GEOSSegmentIntersection( + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " For the points formed by the six input ordinates,"] + #[doc = " walking from A to B and then to P."] + #[doc = " \\param Ax X coordinate of A"] + #[doc = " \\param Ay Y coordinate of A"] + #[doc = " \\param Bx X coordinate of B"] + #[doc = " \\param By Y coordinate of B"] + #[doc = " \\param Px X coordinate of P"] + #[doc = " \\param Py Y coordinate of P"] + #[doc = " \\return -1 if reaching P takes a counter-clockwise (left) turn,"] + #[doc = " 1 if reaching P takes a clockwise (right) turn,"] + #[doc = " 0 if P is collinear with A-B"] + pub fn GEOSOrientationIndex( + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSWKTReader."] + #[doc = " \\returns a new reader. Caller must free with GEOSWKTReader_destroy()"] + pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSWKTReader."] + #[doc = " \\param reader The reader to destroy."] + pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); +} +extern "C" { + #[doc = " Use a reader to parse the well-known text representation of"] + #[doc = " a geometry, and return an allocated geometry."] + #[doc = " \\param reader A WKT reader object, caller retains ownership"] + #[doc = " \\param wkt The WKT string to parse, caller retains ownership"] + #[doc = " \\return A \\ref GEOSGeometry, caller to free with GEOSGeom_destroy())"] + pub fn GEOSWKTReader_read( + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSWKTWriter."] + #[doc = " \\returns a new writer. Caller must free with GEOSWKTWriter_destroy()"] + pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSWKTWriter."] + #[doc = " \\param writer The writer to destroy."] + pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); +} +extern "C" { + #[doc = " Writes out the well-known text representation of a geometry,"] + #[doc = " using the trim, rounding and dimension settings of the writer."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param g Input geometry"] + #[doc = " \\return A newly allocated string containing the WKT output or NULL on exception."] + #[doc = " Caller must free with GEOSFree()"] + pub fn GEOSWKTWriter_write( + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Sets the number trimming option on a \\ref GEOSWKTWriter."] + #[doc = " With trim set to 1, the writer will strip trailing 0's from"] + #[doc = " the output coordinates. With 0, all coordinates will be"] + #[doc = " padded with 0's out to the rounding precision."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param trim The trimming behaviour to set, 1 for 'on', 0 for 'off', default 'off'"] + pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); +} +extern "C" { + #[doc = " Sets the number places after the decimal to output in"] + #[doc = " WKT."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param precision The desired precision, default 16."] + pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); +} +extern "C" { + #[doc = " Sets whether or not to write out XY or XYZ coordinates."] + #[doc = " Legal values are 2 or 3."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param dim The desired dimension, default 2."] + pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); +} +extern "C" { + #[doc = " Reads the current output dimension from a \\ref GEOSWKTWriter."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\return The current dimension."] + pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; +} +extern "C" { + #[doc = " Sets the format for 3D outputs. The \"old 3D\" format does not"] + #[doc = " include a dimensionality tag, eg. \"POINT(1 2 3)\" while the new (ISO)"] + #[doc = " format does includes a tag, eg \"POINT Z (1 2 3)\"."] + #[doc = " \\param writer A \\ref GEOSWKTWriter."] + #[doc = " \\param useOld3D True to use the old format, false is the default."] + pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSWKBReader."] + #[doc = " \\returns a new reader. Caller must free with GEOSWKBReader_destroy()"] + pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSWKBReader."] + #[doc = " \\param reader The reader to destroy."] + pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); +} +extern "C" { + #[doc = " Read a geometry from a well-known binary buffer."] + #[doc = " \\param reader A \\ref GEOSWKBReader"] + #[doc = " \\param wkb A pointer to the buffer to read from"] + #[doc = " \\param size The number of bytes of data in the buffer"] + #[doc = " \\return A \\ref GEOSGeometry built from the WKB, or NULL on exception."] + pub fn GEOSWKBReader_read( + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Read a geometry from a **hex encoded** well-known binary buffer."] + #[doc = " \\param reader A \\ref GEOSWKBReader"] + #[doc = " \\param hex A pointer to the buffer to read from"] + #[doc = " \\param size The number of bytes of data in the buffer"] + #[doc = " \\return A \\ref GEOSGeometry built from the HEX WKB, or NULL on exception."] + pub fn GEOSWKBReader_readHEX( + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSWKBWriter."] + #[doc = " \\returns a new writer. Caller must free with GEOSWKBWriter_destroy()"] + pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSWKBWriter."] + #[doc = " \\param writer The writer to destroy."] + pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); +} +extern "C" { + #[doc = " Write out the WKB representation of a geometry."] + #[doc = " \\param writer The \\ref GEOSWKBWriter controlling the"] + #[doc = " writing."] + #[doc = " \\param g Geometry to convert to WKB"] + #[doc = " \\param size Pointer to write the size of the final output WKB to"] + #[doc = " \\return The WKB representation. Caller must free with GEOSFree()"] + pub fn GEOSWKBWriter_write( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Write out the **hex** WKB representation of a geometry."] + #[doc = " \\param writer The \\ref GEOSWKBWriter controlling the"] + #[doc = " writing."] + #[doc = " \\param g Geometry to convert to WKB"] + #[doc = " \\param size Pointer to write the size of the final output WKB to"] + #[doc = " \\return The HEX WKB representation. Caller must free with GEOSFree()"] + pub fn GEOSWKBWriter_writeHEX( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Read the current output dimension of the writer."] + #[doc = " Either 2 or 3 dimensions."] + #[doc = " Return current number of dimensions."] + #[doc = " \\param writer The writer to read from."] + #[doc = " \\return Number of dimensions (2 or 3)"] + pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + #[doc = " Set the output dimensionality of the writer. Either"] + #[doc = " 2 or 3 dimensions."] + #[doc = " \\param writer The writer to read from."] + #[doc = " \\param newDimension The dimensionality desired"] + pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); +} +extern "C" { + #[doc = " Find whether the writer will use WKB"] + #[doc = " [byte order](https://en.wikipedia.org/wiki/Endianness)"] + #[doc = " that is big or little endian."] + #[doc = " The return value is a member of \\ref GEOSWKBByteOrders."] + #[doc = " \\param writer The writer to read byte order from"] + #[doc = " \\return The current byte order"] + pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + #[doc = " Set the output byte order of the writer, using"] + #[doc = " a value from \\ref GEOSWKBByteOrders enum."] + #[doc = " \\param writer The writer to set byte order on"] + #[doc = " \\param byteOrder Desired byte order"] + pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); +} +extern "C" { + #[doc = " Find whether the writer will use"] + #[doc = " [WKB](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary)"] + #[doc = " that is ISO flavor or \"extended\" flavor. The flavor"] + #[doc = " determines how extra dimensionality is encoded with the"] + #[doc = " type number, and whether SRID can be included in the WKB."] + #[doc = " ISO flavor does not support SRID embedding. ISO flavor"] + #[doc = " is \"more standard\" for 3D output. GEOS can read both flavors."] + #[doc = " The return value is a member of \\ref GEOSWKBFlavors."] + #[doc = " \\param writer The writer to read flavor from"] + #[doc = " \\return The current flavor"] + pub fn GEOSWKBWriter_getFlavor(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + #[doc = " Set the output flavor of the writer, using"] + #[doc = " a value from \\ref GEOSWKBFlavors enum."] + #[doc = " \\param writer The writer to set flavor on"] + #[doc = " \\param flavor Desired flavor"] + pub fn GEOSWKBWriter_setFlavor(writer: *mut GEOSWKBWriter, flavor: libc::c_int); +} +extern "C" { + #[doc = " Read the current SRID embedding value from the writer."] + #[doc = " \\param writer The writer to check SRID value on"] + pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; +} +extern "C" { + #[doc = " Specify whether SRID values should be output in WKB."] + #[doc = " Many WKB readers do not support SRID values, use with caution."] + #[doc = " \\param writer The writer to set SRID output on"] + #[doc = " \\param writeSRID Set to 1 to include SRID, 0 otherwise"] + pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSGeoJSONReader."] + #[doc = " \\returns a new reader. Caller must free with GEOSGeoJSONReader_destroy()"] + pub fn GEOSGeoJSONReader_create() -> *mut GEOSGeoJSONReader; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSGeoJSONReader."] + #[doc = " \\param reader The reader to destroy."] + pub fn GEOSGeoJSONReader_destroy(reader: *mut GEOSGeoJSONReader); +} +extern "C" { + #[doc = " Use a reader to parse a GeoJSON. A single geometry or feature is"] + #[doc = " converted into a geometry. A featurecollection is converted into a"] + #[doc = " geometrycollection. Feature properties are not read."] + #[doc = " \\param reader A GeoJSON reader object, caller retains ownership"] + #[doc = " \\param geojson The json string to parse, caller retains ownership"] + #[doc = " \\return A \\ref GEOSGeometry, caller to free with GEOSGeom_destroy())"] + pub fn GEOSGeoJSONReader_readGeometry( + reader: *mut GEOSGeoJSONReader, + geojson: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Allocate a new \\ref GEOSGeoJSONWriter."] + #[doc = " \\returns a new writer. Caller must free with GEOSGeoJSONWriter_destroy()"] + pub fn GEOSGeoJSONWriter_create() -> *mut GEOSGeoJSONWriter; +} +extern "C" { + #[doc = " Free the memory associated with a \\ref GEOSGeoJSONWriter."] + #[doc = " \\param writer The writer to destroy."] + pub fn GEOSGeoJSONWriter_destroy(writer: *mut GEOSGeoJSONWriter); +} +extern "C" { + #[doc = " Write out the GeoJSON representation of a geometry. Note that writing a GeoJSON"] + #[doc = " Feature or FeatureCollection is unsupported through the GEOS C API."] + #[doc = " \\param writer A GeoJSON reader object, caller retains ownership."] + #[doc = " \\param g The geometry to convert, caller retains ownership."] + #[doc = " \\param indent The indentation used. Use -1 for no formatting."] + #[doc = " \\return A char pointer, caller to free with GEOSFree())"] + pub fn GEOSGeoJSONWriter_writeGeometry( + writer: *mut GEOSGeoJSONWriter, + g: *const GEOSGeometry, + indent: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\deprecated in 3.3.0, use GEOSOffsetCurve() instead"] + pub fn GEOSSingleSidedBuffer( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + leftSide: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated in 3.3.0, use GEOSOffsetCurve() instead"] + pub fn GEOSSingleSidedBuffer_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + leftSide: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated in 3.5.0. Use GEOS_init_r() and set the message handlers using"] + #[doc = " GEOSContext_setNoticeHandler_r() and/or GEOSContext_setErrorHandler_r()"] + pub fn initGEOS_r( + notice_function: GEOSMessageHandler, + error_function: GEOSMessageHandler, + ) -> GEOSContextHandle_t; +} +extern "C" { + #[doc = " \\deprecated in 3.5.0, replaced by GEOS_finish_r()"] + pub fn finishGEOS_r(handle: GEOSContextHandle_t); +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKTReader and GEOSWKTReader_read_r()"] + pub fn GEOSGeomFromWKT_r( + handle: GEOSContextHandle_t, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKTWriter and GEOSWKTWriter_write_r()"] + pub fn GEOSGeomToWKT_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getOutputDimension_r()"] + pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setOutputDimension_r()"] + pub fn GEOS_setWKBOutputDims_r( + handle: GEOSContextHandle_t, + newDims: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getByteOrder_r()"] + pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setByteOrder_r()"] + pub fn GEOS_setWKBByteOrder_r( + handle: GEOSContextHandle_t, + byteOrder: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBReader_read_r()"] + pub fn GEOSGeomFromWKB_buf_r( + handle: GEOSContextHandle_t, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_write_r()"] + pub fn GEOSGeomToWKB_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBReader_readHEX_r()"] + pub fn GEOSGeomFromHEX_buf_r( + handle: GEOSContextHandle_t, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_writeHEX_r()"] + pub fn GEOSGeomToHEX_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKTReader and GEOSWKTReader_read_r()"] + pub fn GEOSGeomFromWKT(wkt: *const libc::c_char) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKTWriter and GEOSWKTWriter_write()"] + pub fn GEOSGeomToWKT(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOS_getWKBOutputDims()"] + pub fn GEOS_getWKBOutputDims() -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOS_setWKBOutputDims()"] + pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getByteOrder()"] + pub fn GEOS_getWKBByteOrder() -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setByteOrder()"] + pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBWriter_read()"] + pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_write()"] + pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBWriter_readHEX()"] + pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_writeHEX()"] + pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " \\deprecated in 3.3.0: use GEOSUnaryUnion() instead"] + pub fn GEOSUnionCascaded(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " \\deprecated in 3.3.0: use GEOSUnaryUnion_r() instead"] + pub fn GEOSUnionCascaded_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} diff --git a/sys/src/functions.rs b/sys/prebuilt-bindings/geos_3.7.rs similarity index 51% rename from sys/src/functions.rs rename to sys/prebuilt-bindings/geos_3.7.rs index 1126a04..098b7e0 100644 --- a/sys/src/functions.rs +++ b/sys/prebuilt-bindings/geos_3.7.rs @@ -1,1285 +1,2264 @@ -use crate::types::*; -use libc::{c_char, c_double, c_int, c_uchar, c_uint, c_void, size_t}; +/* automatically generated by rust-bindgen 0.60.1 */ +pub const GEOS_VERSION_MAJOR: u32 = 3; +pub const GEOS_VERSION_MINOR: u32 = 7; +pub const GEOS_VERSION_PATCH: u32 = 3; +pub const GEOS_VERSION: &[u8; 6usize] = b"3.7.3\0"; +pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; +pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; +pub const GEOS_CAPI_VERSION_MINOR: u32 = 11; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 3; +pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.7.3-CAPI-1.11.3\0"; +pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; +pub const GEOS_CAPI_LAST_INTERFACE: u32 = 12; +pub const GEOS_PREC_NO_TOPO: u32 = 1; +pub const GEOS_PREC_KEEP_COLLAPSED: u32 = 2; +pub type wchar_t = libc::c_int; +pub type max_align_t = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSContextHandle_HS { + _unused: [u8; 0], +} +#[doc = " (Abstract) type definitions"] +#[doc = ""] +pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; +pub type GEOSMessageHandler = + ::std::option::Option; +pub type GEOSMessageHandler_r = ::std::option::Option< + unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeom_t { + _unused: [u8; 0], +} +pub type GEOSGeometry = GEOSGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSPrepGeom_t { + _unused: [u8; 0], +} +pub type GEOSPreparedGeometry = GEOSPrepGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSCoordSeq_t { + _unused: [u8; 0], +} +pub type GEOSCoordSequence = GEOSCoordSeq_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSSTRtree_t { + _unused: [u8; 0], +} +pub type GEOSSTRtree = GEOSSTRtree_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSBufParams_t { + _unused: [u8; 0], +} +pub type GEOSBufferParams = GEOSBufParams_t; +pub type GEOSGeom = *mut GEOSGeometry; +pub type GEOSCoordSeq = *mut GEOSCoordSequence; +pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; +pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; +pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; +pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; +pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; +pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; +pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; +pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; +pub type GEOSGeomTypes = libc::c_uint; +pub const GEOSByteOrders_GEOS_WKB_XDR: GEOSByteOrders = 0; +pub const GEOSByteOrders_GEOS_WKB_NDR: GEOSByteOrders = 1; +pub type GEOSByteOrders = libc::c_uint; +pub type GEOSQueryCallback = ::std::option::Option< + unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), +>; +pub type GEOSDistanceCallback = ::std::option::Option< + unsafe extern "C" fn( + item1: *const libc::c_void, + item2: *const libc::c_void, + distance: *mut f64, + userdata: *mut libc::c_void, + ) -> libc::c_int, +>; +pub type GEOSInterruptCallback = ::std::option::Option; +extern "C" { + pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; +} extern "C" { - pub fn initGEOS(nf: GEOSMessageHandler, ef: GEOSMessageHandler); - pub fn GEOSversion() -> *const c_char; - pub fn finishGEOS(); - - // API for reading WKT: - pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; - pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); - pub fn GEOSWKTReader_read(reader: *mut GEOSWKTReader, wkt: *const c_char) -> *mut GEOSGeometry; - - // API for writing WKT: - pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; - pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); - pub fn GEOSWKTWriter_write(writer: *mut GEOSWKTWriter, g: *const GEOSGeometry) -> *mut c_char; - pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: c_int); - pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; - pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); - pub fn GEOSWKTWriter_write_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - g: *const GEOSGeometry, - ) -> *mut c_char; - pub fn GEOSWKTWriter_setRoundingPrecision_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - precision: c_int, - ); - pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> c_int; - pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: c_int); - pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: c_char); - pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: c_int); - - pub fn GEOSFree(buffer: *mut c_void); - pub fn GEOSFree_r(context: GEOSContextHandle_t, buffer: *mut c_void); - - pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; - pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); - pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; - - pub fn GEOSCoordSeq_create(size: c_uint, dims: c_uint) -> *mut GEOSCoordSequence; - pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); - pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: c_uint, val: c_double) -> c_int; - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: c_uint, val: c_double) -> c_int; - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: c_uint, val: c_double) -> c_int; - pub fn GEOSCoordSeq_setOrdinate( - s: *mut GEOSCoordSequence, - idx: c_uint, - dim: c_uint, - val: c_double, - ) -> c_int; - pub fn GEOSCoordSeq_getX(s: *const GEOSCoordSequence, idx: c_uint, val: *mut c_double) - -> c_int; - pub fn GEOSCoordSeq_getY(s: *const GEOSCoordSequence, idx: c_uint, val: *mut c_double) - -> c_int; - pub fn GEOSCoordSeq_getZ(s: *const GEOSCoordSequence, idx: c_uint, val: *mut c_double) - -> c_int; - pub fn GEOSCoordSeq_getOrdinate( - s: *const GEOSCoordSequence, - idx: c_uint, - dim: c_uint, - val: *mut c_double, - ) -> c_int; - pub fn GEOSCoordSeq_getSize(s: *const GEOSCoordSequence, val: *mut c_uint) -> c_int; - pub fn GEOSCoordSeq_getDimensions(s: *const GEOSCoordSequence, val: *mut c_uint) -> c_int; - - // Geometry must be a LineString, LinearRing or Point: - pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; - - // Geometry constructor: - pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; - pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; - pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; - pub fn GEOSGeom_createPolygon( - shell: *mut GEOSGeometry, - holes: *mut *mut GEOSGeometry, - nholes: c_uint, - ) -> *mut GEOSGeometry; - pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; - pub fn GEOSGeom_createCollection( - t: c_int, - geoms: *mut *mut GEOSGeometry, - ngeoms: c_uint, - ) -> *mut GEOSGeometry; - pub fn GEOSGeom_createEmptyCollection(type_: c_int) -> *mut GEOSGeometry; - - // Functions acting on GEOSGeometry: - pub fn GEOSisEmpty(g: *const GEOSGeometry) -> c_char; - pub fn GEOSisSimple(g: *const GEOSGeometry) -> c_char; - pub fn GEOSisRing(g: *const GEOSGeometry) -> c_char; - pub fn GEOSHasZ(g: *const GEOSGeometry) -> c_char; - pub fn GEOSisClosed(g: *const GEOSGeometry) -> c_char; - pub fn GEOSisValid(g: *const GEOSGeometry) -> c_char; - pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut c_char; - - pub fn GEOSGeomFromHEX_buf(hex: *const c_uchar, size: size_t) -> *mut GEOSGeometry; - pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut size_t) -> *mut c_uchar; - pub fn GEOSGeomFromWKB_buf(wkb: *const c_uchar, size: size_t) -> *mut GEOSGeometry; - pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut size_t) -> *mut c_uchar; - pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> c_int; - pub fn GEOSArea(g: *const GEOSGeometry, area: *mut c_double) -> c_int; - pub fn GEOSLength(g: *const GEOSGeometry, distance: *mut c_double) -> c_int; - pub fn GEOSDistance( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSDistanceIndexed( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - pub fn GEOSHausdorffDistance( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - pub fn GEOSHausdorffDistanceDensify( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - density_frac: c_double, - distance: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSFrechetDistance( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSFrechetDistanceDensify( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - density_frace: c_double, - distance: *mut c_double, - ) -> c_int; - pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut c_double) -> c_int; - pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut c_double) -> c_int; - pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut c_double) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut c_double) -> c_int; - pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: c_int) -> *mut GEOSGeometry; - pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSNearestPoints( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSCoordSequence; - pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSEqualsExact( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - tolerance: c_double, - ) -> c_char; - pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> c_char; - - pub fn GEOSBuffer( - g: *const GEOSGeometry, - width: c_double, - quadsegs: c_int, - ) -> *mut GEOSGeometry; - pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; - pub fn GEOSBufferParams_destroy(params: *mut GEOSBufferParams); - pub fn GEOSBufferParams_setEndCapStyle(p: *mut GEOSBufferParams, style: c_int) -> c_int; - pub fn GEOSBufferParams_setJoinStyle(p: *mut GEOSBufferParams, joinStyle: c_int) -> c_int; - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: c_double) -> c_int; - pub fn GEOSBufferParams_setQuadrantSegments(p: *mut GEOSBufferParams, quadSegs: c_int) - -> c_int; - pub fn GEOSBufferParams_setSingleSided(p: *mut GEOSBufferParams, singleSided: c_int) -> c_int; - pub fn GEOSBufferWithParams( - g: *const GEOSGeometry, - p: *const GEOSBufferParams, - width: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSBufferWithStyle( - g: *const GEOSGeometry, - width: c_double, - quadSegs: c_int, - endCapStyle: c_int, - joinStyle: c_int, - mitreLimit: c_double, - ) -> *mut GEOSGeometry; - - pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSSymDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) - -> *mut GEOSGeometry; - pub fn GEOSDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSUnion(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSClipByRect( - g: *const GEOSGeometry, - xmin: c_double, - ymin: c_double, - xmax: c_double, - ymax: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSSnap( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - tolerance: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSVoronoiDiagram( - g: *const GEOSGeometry, - env: *const GEOSGeometry, - tolerance: c_double, - onlyEdges: c_int, - ) -> *mut GEOSGeometry; - pub fn GEOSNormalize(g: *mut GEOSGeometry) -> c_int; - #[cfg(feature = "v3_8_0")] - pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; - #[cfg(feature = "v3_7_0")] - pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: c_double) -> *mut GEOSGeometry; - pub fn GEOSTopologyPreserveSimplify( - g: *const GEOSGeometry, - tolerance: c_double, - ) -> *mut GEOSGeometry; - #[cfg(feature = "v3_8_0")] - pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> c_int; - pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut c_char; - pub fn GEOSGetSRID(g: *const GEOSGeometry) -> c_int; - pub fn GEOSSetSRID(g: *mut GEOSGeometry, srid: c_int); - #[cfg(feature = "v3_7_0")] - pub fn GEOSSegmentIntersection( - ax0: c_double, - ay0: c_double, - ax1: c_double, - ay1: c_double, - bx0: c_double, - by0: c_double, - bx1: c_double, - by1: c_double, - cx: *mut c_double, - cy: *mut c_double, - ) -> c_int; - pub fn GEOSDelaunayTriangulation( - g: *const GEOSGeometry, - tolerance: c_double, - onlyEdges: c_int, - ) -> *mut GEOSGeometry; - - // Functions acting on GEOSPreparedGeometry: - pub fn GEOSPreparedContains( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedContainsProperly( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedCoveredBy( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedCovers(pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSPreparedCrosses(pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry) - -> c_char; - pub fn GEOSPreparedDisjoint( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedIntersects( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedOverlaps( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedTouches(pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry) - -> c_char; - pub fn GEOSPreparedWithin(pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry) -> c_char; - pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); - pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: c_int) -> *const GEOSGeometry; - pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; - pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> c_int; - pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> c_int; - pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> c_int; - pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> c_int; - pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSCoordSeq_isCCW(s: *const GEOSCoordSequence, is_ccw: *mut c_char) -> c_int; - #[cfg(feature = "v3_6_0")] - pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> c_double; - #[cfg(feature = "v3_6_0")] - pub fn GEOSGeom_setPrecision( - g: *const GEOSGeometry, - grid_size: c_double, - flags: c_int, - ) -> *mut GEOSGeometry; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut c_double) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut c_double) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut c_double) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut c_double) -> c_int; - #[cfg(feature = "v3_6_0")] - pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut c_double) -> c_int; - #[cfg(feature = "v3_6_0")] - pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; - #[cfg(feature = "v3_6_0")] - pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; - #[cfg(feature = "v3_6_0")] - pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSOrientationIndex( - ax: c_double, - ay: c_double, - bx: c_double, - by: c_double, - px: c_double, - py: c_double, - ) -> c_int; - pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; - pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; - pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut c_void; - pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut c_void); - pub fn GEOSSTRtree_create(nodeCapacity: size_t) -> *mut GEOSSTRtree; - pub fn GEOSSTRtree_insert(tree: *mut GEOSSTRtree, g: *const GEOSGeometry, item: *mut c_void); - pub fn GEOSSTRtree_query( - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - callback: GEOSQueryCallback, - userdata: *mut c_void, - ); - pub fn GEOSSTRtree_nearest( - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - ) -> *const GEOSGeometry; - pub fn GEOSSTRtree_nearest_generic( - tree: *mut GEOSSTRtree, - item: *const c_void, - itemEnvelope: *const GEOSGeometry, - distancefn: GEOSDistanceCallback, - userdata: *mut c_void, - ) -> *const c_void; - pub fn GEOSSTRtree_iterate( - tree: *mut GEOSSTRtree, - callback: GEOSQueryCallback, - userdata: *mut c_void, - ); - pub fn GEOSSTRtree_remove( - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - item: *mut c_void, - ) -> c_char; - pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); - pub fn GEOS_getWKBOutputDims() -> c_int; - pub fn GEOS_setWKBOutputDims(newDims: c_int) -> c_int; - pub fn GEOS_getWKBByteOrder() -> c_int; - pub fn GEOS_setWKBByteOrder(byteOrder: c_int) -> c_int; - pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: c_int) -> *const GEOSGeometry; - pub fn GEOSInterpolate(g: *const GEOSGeometry, d: c_double) -> *mut GEOSGeometry; - pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: c_double) -> *mut GEOSGeometry; - pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> c_double; - pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSOffsetCurve( - g: *const GEOSGeometry, - width: c_double, - quadsegs: c_int, - joinStyle: c_int, - mitreLimit: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSPolygonize(geoms: *const *const GEOSGeometry, ngeoms: c_uint) -> *mut GEOSGeometry; - pub fn GEOSPolygonize_full( - input: *const GEOSGeometry, - cuts: *mut *mut GEOSGeometry, - dangles: *mut *mut GEOSGeometry, - invalidRings: *mut *mut GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSPolygonizer_getCutEdges( - geoms: *const *const GEOSGeometry, - ngeoms: c_uint, - ) -> *mut GEOSGeometry; - pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> c_double; - pub fn GEOSRelatePattern( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - pat: *const c_char, - ) -> c_char; - pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut c_char; - pub fn GEOSRelatePatternMatch(mat: *const c_char, pat: *const c_char) -> c_char; - pub fn GEOSRelateBoundaryNodeRule( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - bnr: c_int, - ) -> *mut c_char; - pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; - pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); - pub fn GEOSWKBReader_read( - reader: *mut GEOSWKBReader, - wkb: *const c_uchar, - size: size_t, - ) -> *mut GEOSGeometry; - pub fn GEOSWKBReader_readHEX( - reader: *mut GEOSWKBReader, - hex: *const c_uchar, - size: size_t, - ) -> *mut GEOSGeometry; - pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; - pub fn GEOSWKBWriter_destroy(reader: *mut GEOSWKBWriter); - pub fn GEOSWKBWriter_write( - writer: *mut GEOSWKBWriter, - g: *const GEOSGeometry, - size: *mut size_t, - ) -> *mut c_uchar; - pub fn GEOSWKBWriter_writeHEX( - writer: *mut GEOSWKBWriter, - g: *const GEOSGeometry, - size: *mut size_t, - ) -> *mut c_uchar; - pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> c_int; - pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: c_int); - pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> c_int; - pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: c_int); - pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> c_char; - pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: c_char); - pub fn GEOSisValidDetail( - g: *const GEOSGeometry, - flags: c_int, - reason: *mut *mut c_char, - location: *mut *mut GEOSGeometry, - ) -> c_char; - pub fn GEOS_interruptCancel(); pub fn GEOS_interruptRequest(); - pub fn GEOS_interruptRegisterCallback( - cb: *mut GEOSInterruptCallback, - ) -> *mut GEOSInterruptCallback; - - /* Thread safe calls */ +} +extern "C" { + pub fn GEOS_interruptCancel(); +} +extern "C" { pub fn GEOS_init_r() -> GEOSContextHandle_t; +} +extern "C" { pub fn GEOS_finish_r(handle: GEOSContextHandle_t); +} +extern "C" { pub fn GEOSContext_setNoticeHandler_r( - handle: GEOSContextHandle_t, + extHandle: GEOSContextHandle_t, nf: GEOSMessageHandler, ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setErrorHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { pub fn GEOSContext_setNoticeMessageHandler_r( - handle: GEOSContextHandle_t, + extHandle: GEOSContextHandle_t, nf: GEOSMessageHandler_r, - userdata: *mut c_void, + userData: *mut libc::c_void, ) -> GEOSMessageHandler_r; - pub fn GEOSContext_setErrorHandler_r( - handle: GEOSContextHandle_t, - nf: GEOSMessageHandler, - ) -> GEOSMessageHandler; +} +extern "C" { pub fn GEOSContext_setErrorMessageHandler_r( - handle: GEOSContextHandle_t, - nf: GEOSMessageHandler_r, - userdata: *mut c_void, + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler_r, + userData: *mut libc::c_void, ) -> GEOSMessageHandler_r; - pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> c_int; - pub fn GEOS_setWKBOutputDims_r(handle: GEOSContextHandle_t, newDims: c_int) -> c_int; - pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> c_int; - pub fn GEOS_setWKBByteOrder_r(handle: GEOSContextHandle_t, byteOrder: c_int) -> c_int; +} +extern "C" { + pub fn GEOSversion() -> *const libc::c_char; +} +extern "C" { + pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims_r( + handle: GEOSContextHandle_t, + newDims: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder_r( + handle: GEOSContextHandle_t, + byteOrder: libc::c_int, + ) -> libc::c_int; +} +extern "C" { pub fn GEOSGeomFromWKB_buf_r( handle: GEOSContextHandle_t, - wkb: *const c_uchar, - size: size_t, + wkb: *const libc::c_uchar, + size: usize, ) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSGeomToWKB_buf_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - size: *mut size_t, - ) -> *mut c_uchar; + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { pub fn GEOSGeomFromHEX_buf_r( handle: GEOSContextHandle_t, - hex: *const c_uchar, - size: size_t, + hex: *const libc::c_uchar, + size: usize, ) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSGeomToHEX_buf_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - size: *mut size_t, - ) -> *mut c_uchar; - pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_char; - pub fn GEOSisValidReason_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut c_char; - pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_int; - pub fn GEOSArea_r( + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Coordinate Sequence functions"] + #[doc = ""] + pub fn GEOSCoordSeq_create_r( handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - area: *mut c_double, - ) -> c_int; - pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_char; - pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_char; - pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_char; - pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_char; - pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_char; - pub fn GEOSIntersects_r( + size: libc::c_uint, + dims: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_clone_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSDisjoint_r( + s: *const GEOSCoordSequence, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSTouches_r( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSCrosses_r( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSWithin_r( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSContains_r( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSOverlaps_r( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSEquals_r( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSEqualsExact_r( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - tolerance: c_double, - ) -> c_char; - pub fn GEOSCovers_r( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSCoveredBy_r( + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSDifference_r( + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_isCCW_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) - -> *mut GEOSGeometry; - pub fn GEOSGetCentroid_r( + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Linear referencing functions -- there are more, but these are"] + #[doc = " probably sufficient for most purposes"] + #[doc = ""] + pub fn GEOSProject_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSUnion_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSSymDifference_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSGeom_createPoint_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - ) -> *mut GEOSGeometry; - pub fn GEOSGeom_createLineString_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - ) -> *mut GEOSGeometry; - pub fn GEOSGeom_createLinearRing_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - ) -> *mut GEOSGeometry; - pub fn GEOSUnaryUnion_r( + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + pub fn GEOSInterpolate_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, + d: f64, ) -> *mut GEOSGeometry; - pub fn GEOSVoronoiDiagram_r( +} +extern "C" { + pub fn GEOSProjectNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - env: *const GEOSGeometry, - tolerance: c_double, - onlyEdges: c_int, - ) -> *mut GEOSGeometry; - pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> c_int; - pub fn GEOSIntersection_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSConvexHull_r( + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + pub fn GEOSInterpolateNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, + d: f64, ) -> *mut GEOSGeometry; - pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) - -> *mut GEOSGeometry; - pub fn GEOSLength_r( +} +extern "C" { + pub fn GEOSBuffer_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - pub fn GEOSDistance_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSDistanceIndexed_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - pub fn GEOSHausdorffDistance_r( + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; +pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; +pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; +pub type GEOSBufCapStyles = libc::c_uint; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; +pub type GEOSBufJoinStyles = libc::c_uint; +extern "C" { + pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - pub fn GEOSHausdorffDistanceDensify_r( + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - density_frac: c_double, - distance: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSFrechetDistance_r( + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - distance: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSFrechetDistanceDensify_r( + p: *mut GEOSBufferParams, + mitreLimit: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - density_frace: c_double, - distance: *mut c_double, - ) -> c_int; - pub fn GEOSGeomGetLength_r( + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided_r( handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - length: *mut c_double, - ) -> c_int; - pub fn GEOSGeomGetX_r( + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - x: *mut c_double, - ) -> c_int; - pub fn GEOSGeomGetY_r( + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - y: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeomGetZ_r( + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - z: *mut c_double, - ) -> c_int; - pub fn GEOSSnap_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - tolerance: c_double, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, ) -> *mut GEOSGeometry; - pub fn GEOSGeom_extractUniquePoints_r( +} +extern "C" { + #[doc = " Geometry Constructors."] + #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] + #[doc = " All functions return NULL on exception."] + #[doc = ""] + pub fn GEOSGeom_createPoint_r( handle: GEOSContextHandle_t, - g: *const GEOSGeometry, + s: *mut GEOSCoordSequence, ) -> *mut GEOSGeometry; - pub fn GEOSNearestPoints_r( +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing_r( handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSCoordSequence; - pub fn GEOSBuffer_r( + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString_r( handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - width: c_double, - quadsegs: c_int, + s: *mut GEOSCoordSequence, ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSGeom_createPolygon_r( handle: GEOSContextHandle_t, shell: *mut GEOSGeometry, holes: *mut *mut GEOSGeometry, - nholes: c_uint, + nholes: libc::c_uint, ) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSGeom_createCollection_r( handle: GEOSContextHandle_t, - t: c_int, + type_: libc::c_int, geoms: *mut *mut GEOSGeometry, - ngeoms: c_uint, + ngeoms: libc::c_uint, ) -> *mut GEOSGeometry; - pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; - pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); - pub fn GEOSWKTReader_read_r( +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection_r( handle: GEOSContextHandle_t, - reader: *mut GEOSWKTReader, - wkt: *const c_char, + type_: libc::c_int, ) -> *mut GEOSGeometry; - pub fn GEOSClipByRect_r( +} +extern "C" { + pub fn GEOSGeom_clone_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - xmin: c_double, - ymin: c_double, - xmax: c_double, - ymax: c_double, ) -> *mut GEOSGeometry; - pub fn GEOSGeom_clone_r( +} +extern "C" { + #[doc = " Memory management"] + #[doc = ""] + pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " Topology operations - return NULL on exception."] + #[doc = ""] + pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; - pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); - pub fn GEOSCoordSeq_create_r( +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle_r( handle: GEOSContextHandle_t, - size: c_uint, - dims: c_uint, - ) -> *mut GEOSCoordSequence; - pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); - pub fn GEOSCoordSeq_clone_r( + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth_r( handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - ) -> *mut GEOSCoordSequence; - pub fn GEOSCoordSeq_setX_r( + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearanceLine_r( handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: c_uint, - val: c_double, - ) -> c_int; - pub fn GEOSCoordSeq_setY_r( + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: c_uint, - val: c_double, - ) -> c_int; - pub fn GEOSCoordSeq_setZ_r( + g: *const GEOSGeometry, + distance: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDifference_r( handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: c_uint, - val: c_double, - ) -> c_int; - pub fn GEOSCoordSeq_getX_r( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference_r( handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: c_uint, - val: *mut c_double, - ) -> c_int; - pub fn GEOSCoordSeq_getY_r( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion_r( handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: c_uint, - val: *mut c_double, - ) -> c_int; - pub fn GEOSCoordSeq_getZ_r( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion_r( handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: c_uint, - val: *mut c_double, - ) -> c_int; - pub fn GEOSCoordSeq_getSize_r( + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface_r( handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - val: *mut c_uint, - ) -> c_int; - pub fn GEOSGeom_getCoordSeq_r( + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - ) -> *const GEOSCoordSequence; - pub fn GEOSCoordSeq_getDimensions_r( + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect_r( handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - dims: *mut c_uint, - ) -> c_int; - pub fn GEOSPrepare_r( + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full_r( + handle: GEOSContextHandle_t, + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalidRings: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - ) -> *const GEOSPreparedGeometry; - pub fn GEOSPreparedContains_r( + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram_r( + extHandle: GEOSContextHandle_t, + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSegmentIntersection_r( + extHandle: GEOSContextHandle_t, + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSDisjoint_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals_r( handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEqualsExact_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSPrepare_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " STRtree functions"] + #[doc = ""] + pub fn GEOSSTRtree_create_r( + handle: GEOSContextHandle_t, + nodeCapacity: usize, + ) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 3; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 4; +#[doc = " Dimensionally Extended 9 Intersection Model related"] +#[doc = ""] +pub type GEOSRelateBoundaryNodeRules = libc::c_uint; +extern "C" { + pub fn GEOSRelatePattern_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch_r( + handle: GEOSContextHandle_t, + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; +#[doc = " Validity checking"] +#[doc = ""] +pub type GEOSValidFlags = libc::c_uint; +extern "C" { + pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Geometry info"] + #[doc = ""] + pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData_r( + handle: GEOSContextHandle_t, + g: *mut GEOSGeometry, + userData: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSGetNumGeometries_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Set the geometry's precision, optionally rounding all its"] + #[doc = " coordinates to the precision grid (if it changes)."] + #[doc = ""] + #[doc = " Note that operations will always be performed in the precision"] + #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] + #[doc = " That same precision will be attached to the operation outputs."] + #[doc = ""] + #[doc = " @param gridSize size of the precision grid, or 0 for FLOATING"] + #[doc = " precision."] + #[doc = " @param flags The bitwise OR of one of more of the"] + #[doc = " @ref GEOS_PREC_NO_TOPO \"precision options\""] + #[doc = " @retuns NULL on exception or a new GEOSGeometry object"] + #[doc = ""] + pub fn GEOSGeom_setPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Get a geometry's precision"] + #[doc = ""] + #[doc = " @return the size of the geometry's precision grid, 0 for FLOATING"] + #[doc = " precision or -1 on exception"] + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSGetNumInteriorRings_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + x: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetZ_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Misc functions"] + #[doc = ""] + pub fn GEOSArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + area: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistanceIndexed_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Algorithms"] + #[doc = ""] + pub fn GEOSOrientationIndex_r( + handle: GEOSContextHandle_t, + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTReader_t { + _unused: [u8; 0], +} +#[doc = " Reader and Writer APIs"] +#[doc = ""] +pub type GEOSWKTReader = GEOSWKTReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKTWriter = GEOSWKTWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBReader_t { + _unused: [u8; 0], +} +pub type GEOSWKBReader = GEOSWKBReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKBWriter = GEOSWKBWriter_t; +extern "C" { + pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + trim: libc::c_char, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + precision: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + dim: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + useOld3D: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + newDimension: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + byteOrder: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + writeSRID: libc::c_char, + ); +} +extern "C" { + pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); +} +extern "C" { + pub fn GEOS_getWKBOutputDims() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Coordinate Sequence functions"] + #[doc = ""] + pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize( + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions( + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_isCCW( + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Linear referencing functions -- there are more, but these are"] + #[doc = " probably sufficient for most purposes"] + #[doc = ""] + pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSInterpolate(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle( + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle( + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments( + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided( + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams( + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry Constructors."] + #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] + #[doc = " All functions return NULL on exception."] + #[doc = ""] + pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon( + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection( + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Memory management"] + #[doc = ""] + pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " Topology operations - return NULL on exception."] + #[doc = ""] + pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect( + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full( + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalid: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify( + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation( + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram( + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSegmentIntersection( + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSEqualsExact( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedContainsProperly_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedCoveredBy_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedCovers_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedCrosses_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedDisjoint_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedIntersects_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedOverlaps_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedTouches_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedWithin_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - ) -> c_char; - pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); - pub fn GEOSCoordSeq_setOrdinate_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: c_uint, - dim: c_uint, - val: c_double, - ) -> c_int; - pub fn GEOSCoordSeq_getOrdinate_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: c_uint, - dim: c_uint, - val: *mut c_double, - ) -> c_int; - pub fn GEOSGeomGetPointN_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - n: c_int, - ) -> *mut GEOSGeometry; - pub fn GEOSGeomGetStartPoint_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSGeomGetEndPoint_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - #[cfg(feature = "v3_8_0")] - pub fn GEOSBuildArea_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSLineMerge_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - #[cfg(feature = "v3_7_0")] - pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSSimplify_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSTopologyPreserveSimplify_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSGetInteriorRingN_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - n: c_int, - ) -> *const GEOSGeometry; - pub fn GEOSGetExteriorRing_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *const GEOSGeometry; - pub fn GEOSGetNumInteriorRings_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_int; - pub fn GEOSGeomGetNumPoints_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_int; - pub fn GEOSGetNumCoordinates_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_int; - pub fn GEOSGeom_getDimensions_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_int; - pub fn GEOSGeom_getCoordinateDimension_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> c_int; - pub fn GEOSMakeValid_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSGetNumGeometries_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_int; - pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut c_char; - pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> c_int; - pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, srid: c_int); - #[cfg(feature = "v3_7_0")] - pub fn GEOSCoordSeq_isCCW_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - is_ccw: *mut c_char, - ) -> c_int; - #[cfg(feature = "v3_6_0")] - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) - -> c_double; - #[cfg(feature = "v3_6_0")] - pub fn GEOSGeom_setPrecision_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - grid_size: c_double, - flags: c_int, - ) -> *mut GEOSGeometry; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeom_getXMax_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - value: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeom_getXMin_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - value: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeom_getYMax_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - value: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_7_0")] - pub fn GEOSGeom_getYMin_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - value: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_6_0")] - pub fn GEOSMinimumClearance_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - d: *mut c_double, - ) -> c_int; - #[cfg(feature = "v3_6_0")] - pub fn GEOSMinimumClearanceLine_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - #[cfg(feature = "v3_6_0")] - pub fn GEOSMinimumRotatedRectangle_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - #[cfg(feature = "v3_6_0")] - pub fn GEOSMinimumWidth_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - #[cfg(feature = "v3_7_0")] - pub fn GEOSSegmentIntersection_r( - handle: GEOSContextHandle_t, - ax0: c_double, - ay0: c_double, - ax1: c_double, - ay1: c_double, - bx0: c_double, - by0: c_double, - bx1: c_double, - by1: c_double, - cx: *mut c_double, - cy: *mut c_double, - ) -> c_int; - pub fn GEOSDelaunayTriangulation_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: c_double, - onlyEdges: c_int, - ) -> *mut GEOSGeometry; - pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; - pub fn GEOSGeom_createEmptyCollection_r( - handle: GEOSContextHandle_t, - type_: c_int, - ) -> *mut GEOSGeometry; - pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; - pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; - pub fn GEOSGeom_getUserData_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut c_void; - pub fn GEOSGeom_setUserData_r( - handle: GEOSContextHandle_t, - g: *mut GEOSGeometry, - userData: *mut c_void, - ); - pub fn GEOSSTRtree_create_r( - handle: GEOSContextHandle_t, - nodeCapacity: size_t, - ) -> *mut GEOSSTRtree; - pub fn GEOSSTRtree_insert_r( - handle: GEOSContextHandle_t, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, - item: *mut c_void, + item: *mut libc::c_void, ); - pub fn GEOSSTRtree_query_r( - handle: GEOSContextHandle_t, +} +extern "C" { + pub fn GEOSSTRtree_query( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, callback: GEOSQueryCallback, - userdata: *mut c_void, + userdata: *mut libc::c_void, ); - pub fn GEOSSTRtree_nearest_r( - handle: GEOSContextHandle_t, +} +extern "C" { + pub fn GEOSSTRtree_nearest( tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, + geom: *const GEOSGeometry, ) -> *const GEOSGeometry; - pub fn GEOSSTRtree_nearest_generic_r( - handle: GEOSContextHandle_t, +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic( tree: *mut GEOSSTRtree, - item: *const c_void, + item: *const libc::c_void, itemEnvelope: *const GEOSGeometry, distancefn: GEOSDistanceCallback, - userdata: *mut c_void, - ) -> *const c_void; - pub fn GEOSSTRtree_iterate_r( - handle: GEOSContextHandle_t, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate( tree: *mut GEOSSTRtree, callback: GEOSQueryCallback, - userdata: *mut c_void, + userdata: *mut libc::c_void, ); - pub fn GEOSSTRtree_remove_r( - handle: GEOSContextHandle_t, +} +extern "C" { + pub fn GEOSSTRtree_remove( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, - item: *mut c_void, - ) -> c_char; - pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); - pub fn GEOSGetGeometryN_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - n: c_int, - ) -> *const GEOSGeometry; - pub fn GEOSInterpolate_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - d: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSInterpolateNormalized_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - d: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSProjectNormalized_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - p: *const GEOSGeometry, - ) -> c_double; - pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; - pub fn GEOSOffsetCurve_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - width: c_double, - quadsegs: c_int, - joinStyle: c_int, - mitreLimit: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSOrientationIndex_r( - handle: GEOSContextHandle_t, - ax: c_double, - ay: c_double, - bx: c_double, - by: c_double, - px: c_double, - py: c_double, - ) -> c_int; - pub fn GEOSPointOnSurface_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSPolygonize_r( - handle: GEOSContextHandle_t, - geoms: *const *const GEOSGeometry, - ngeoms: c_uint, - ) -> *mut GEOSGeometry; - pub fn GEOSPolygonize_full_r( - handle: GEOSContextHandle_t, - input: *const GEOSGeometry, - cuts: *mut *mut GEOSGeometry, - dangles: *mut *mut GEOSGeometry, - invalidRings: *mut *mut GEOSGeometry, - ) -> *mut GEOSGeometry; - pub fn GEOSPolygonizer_getCutEdges_r( - handle: GEOSContextHandle_t, - geoms: *const *const GEOSGeometry, - ngeoms: c_uint, - ) -> *mut GEOSGeometry; - pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; - pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, params: *mut GEOSBufferParams); - pub fn GEOSBufferParams_setEndCapStyle_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - style: c_int, - ) -> c_int; - pub fn GEOSBufferParams_setJoinStyle_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - joinStyle: c_int, - ) -> c_int; - pub fn GEOSBufferParams_setMitreLimit_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - mitreLimit: c_double, - ) -> c_int; - pub fn GEOSBufferParams_setQuadrantSegments_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - quadSegs: c_int, - ) -> c_int; - pub fn GEOSBufferParams_setSingleSided_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - singleSided: c_int, - ) -> c_int; - pub fn GEOSBufferWithParams_r( - handle: GEOSContextHandle_t, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Dimensionally Extended 9 Intersection Model related"] + #[doc = ""] + pub fn GEOSRelatePattern( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch( + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Validity checking"] + #[doc = ""] + pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail( g: *const GEOSGeometry, - p: *const GEOSBufferParams, - width: c_double, - ) -> *mut GEOSGeometry; - pub fn GEOSBufferWithStyle_r( - handle: GEOSContextHandle_t, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Geometry info"] + #[doc = ""] + pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); +} +extern "C" { + pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_setPrecision( g: *const GEOSGeometry, - width: c_double, - quadSegs: c_int, - endCapStyle: c_int, - joinStyle: c_int, - mitreLimit: c_double, + gridSize: f64, + flags: libc::c_int, ) -> *mut GEOSGeometry; - pub fn GEOSProject_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - p: *const GEOSGeometry, - ) -> c_double; - pub fn GEOSRelatePattern_r( - handle: GEOSContextHandle_t, +} +extern "C" { + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Misc functions"] + #[doc = ""] + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - pat: *const c_char, - ) -> c_char; - pub fn GEOSRelate_r( - handle: GEOSContextHandle_t, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistanceIndexed( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - ) -> *mut c_char; - pub fn GEOSRelatePatternMatch_r( - handle: GEOSContextHandle_t, - mat: *const c_char, - pat: *const c_char, - ) -> c_char; - pub fn GEOSRelateBoundaryNodeRule_r( - handle: GEOSContextHandle_t, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - bnr: c_int, - ) -> *mut c_char; - pub fn GEOSSharedPaths_r( - handle: GEOSContextHandle_t, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Algorithms"] + #[doc = ""] + pub fn GEOSOrientationIndex( + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Reader and Writer APIs"] + #[doc = ""] + pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read( + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, ) -> *mut GEOSGeometry; - pub fn GEOSWKTWriter_getOutputDimension_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - ) -> c_int; - pub fn GEOSWKTWriter_setOutputDimension_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - dim: c_int, - ); - pub fn GEOSWKTWriter_setTrim_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - trim: c_char, - ); - pub fn GEOSWKTWriter_setOld3D_r( - handle: GEOSContextHandle_t, +} +extern "C" { + pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write( writer: *mut GEOSWKTWriter, - useOld3D: c_int, - ); - - pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; - pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); - pub fn GEOSWKBReader_read_r( - handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); +} +extern "C" { + pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_read( reader: *mut GEOSWKBReader, - wkb: *const c_uchar, - size: size_t, + wkb: *const libc::c_uchar, + size: usize, ) -> *mut GEOSGeometry; - pub fn GEOSWKBReader_readHEX_r( - handle: GEOSContextHandle_t, +} +extern "C" { + pub fn GEOSWKBReader_readHEX( reader: *mut GEOSWKBReader, - hex: *const c_uchar, - size: size_t, + hex: *const libc::c_uchar, + size: usize, ) -> *mut GEOSGeometry; - pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; - pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); - pub fn GEOSWKBWriter_write_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - g: *const GEOSGeometry, - size: *mut size_t, - ) -> *mut c_uchar; - pub fn GEOSWKBWriter_writeHEX_r( - handle: GEOSContextHandle_t, +} +extern "C" { + pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write( writer: *mut GEOSWKBWriter, g: *const GEOSGeometry, - size: *mut size_t, - ) -> *mut c_uchar; - pub fn GEOSWKBWriter_getOutputDimension_r( - handle: GEOSContextHandle_t, - writer: *const GEOSWKBWriter, - ) -> c_int; - pub fn GEOSWKBWriter_setOutputDimension_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - newDimension: c_int, - ); - pub fn GEOSWKBWriter_getByteOrder_r( - handle: GEOSContextHandle_t, - writer: *const GEOSWKBWriter, - ) -> c_int; - pub fn GEOSWKBWriter_setByteOrder_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - byteOrder: c_int, - ); - pub fn GEOSWKBWriter_getIncludeSRID_r( - handle: GEOSContextHandle_t, - writer: *const GEOSWKBWriter, - ) -> c_char; - pub fn GEOSWKBWriter_setIncludeSRID_r( - handle: GEOSContextHandle_t, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX( writer: *mut GEOSWKBWriter, - writeSRID: c_char, - ); - pub fn GEOSisValidDetail_r( - handle: GEOSContextHandle_t, g: *const GEOSGeometry, - flags: c_int, - reason: *mut *mut c_char, - location: *mut *mut GEOSGeometry, - ) -> c_char; + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); +} +extern "C" { + pub fn GEOSFree(buffer: *mut libc::c_void); } diff --git a/sys/prebuilt-bindings/geos_3.8.rs b/sys/prebuilt-bindings/geos_3.8.rs new file mode 100644 index 0000000..220ff98 --- /dev/null +++ b/sys/prebuilt-bindings/geos_3.8.rs @@ -0,0 +1,2407 @@ +/* automatically generated by rust-bindgen 0.60.1 */ + +pub const GEOS_VERSION_MAJOR: u32 = 3; +pub const GEOS_VERSION_MINOR: u32 = 8; +pub const GEOS_VERSION_PATCH: u32 = 3; +pub const GEOS_VERSION: &[u8; 6usize] = b"3.8.3\0"; +pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; +pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; +pub const GEOS_CAPI_VERSION_MINOR: u32 = 13; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 4; +pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.8.3-CAPI-1.13.4\0"; +pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; +pub const GEOS_CAPI_LAST_INTERFACE: u32 = 14; +pub const GEOS_PREC_NO_TOPO: u32 = 1; +pub const GEOS_PREC_KEEP_COLLAPSED: u32 = 2; +pub type wchar_t = libc::c_int; +pub type max_align_t = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSContextHandle_HS { + _unused: [u8; 0], +} +#[doc = " (Abstract) type definitions"] +#[doc = ""] +pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; +pub type GEOSMessageHandler = + ::std::option::Option; +pub type GEOSMessageHandler_r = ::std::option::Option< + unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeom_t { + _unused: [u8; 0], +} +pub type GEOSGeometry = GEOSGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSPrepGeom_t { + _unused: [u8; 0], +} +pub type GEOSPreparedGeometry = GEOSPrepGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSCoordSeq_t { + _unused: [u8; 0], +} +pub type GEOSCoordSequence = GEOSCoordSeq_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSSTRtree_t { + _unused: [u8; 0], +} +pub type GEOSSTRtree = GEOSSTRtree_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSBufParams_t { + _unused: [u8; 0], +} +pub type GEOSBufferParams = GEOSBufParams_t; +pub type GEOSGeom = *mut GEOSGeometry; +pub type GEOSCoordSeq = *mut GEOSCoordSequence; +pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; +pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; +pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; +pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; +pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; +pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; +pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; +pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; +pub type GEOSGeomTypes = libc::c_uint; +pub const GEOSByteOrders_GEOS_WKB_XDR: GEOSByteOrders = 0; +pub const GEOSByteOrders_GEOS_WKB_NDR: GEOSByteOrders = 1; +pub type GEOSByteOrders = libc::c_uint; +pub type GEOSQueryCallback = ::std::option::Option< + unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), +>; +pub type GEOSDistanceCallback = ::std::option::Option< + unsafe extern "C" fn( + item1: *const libc::c_void, + item2: *const libc::c_void, + distance: *mut f64, + userdata: *mut libc::c_void, + ) -> libc::c_int, +>; +pub type GEOSInterruptCallback = ::std::option::Option; +extern "C" { + pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; +} +extern "C" { + pub fn GEOS_interruptRequest(); +} +extern "C" { + pub fn GEOS_interruptCancel(); +} +extern "C" { + pub fn GEOS_init_r() -> GEOSContextHandle_t; +} +extern "C" { + pub fn GEOS_finish_r(handle: GEOSContextHandle_t); +} +extern "C" { + pub fn GEOSContext_setNoticeHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setErrorHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setNoticeMessageHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + pub fn GEOSContext_setErrorMessageHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + pub fn GEOSversion() -> *const libc::c_char; +} +extern "C" { + pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims_r( + handle: GEOSContextHandle_t, + newDims: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder_r( + handle: GEOSContextHandle_t, + byteOrder: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf_r( + handle: GEOSContextHandle_t, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf_r( + handle: GEOSContextHandle_t, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Coordinate Sequence functions"] + #[doc = ""] + pub fn GEOSCoordSeq_create_r( + handle: GEOSContextHandle_t, + size: libc::c_uint, + dims: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_clone_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXYZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + z: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXYZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_isCCW_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Linear referencing functions -- there are more, but these are"] + #[doc = " probably sufficient for most purposes"] + #[doc = ""] + pub fn GEOSProject_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + pub fn GEOSInterpolate_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + pub fn GEOSInterpolateNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; +pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; +pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; +pub type GEOSBufCapStyles = libc::c_uint; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; +pub type GEOSBufJoinStyles = libc::c_uint; +extern "C" { + pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + mitreLimit: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry Constructors."] + #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] + #[doc = " All functions return NULL on exception."] + #[doc = ""] + pub fn GEOSGeom_createPoint_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPointFromXY_r( + handle: GEOSContextHandle_t, + x: f64, + y: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon_r( + handle: GEOSContextHandle_t, + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Memory management"] + #[doc = ""] + pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " Topology operations - return NULL on exception."] + #[doc = ""] + pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearanceLine_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + distance: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSCoverageUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumBoundingCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + radius: *mut f64, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_valid_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngems: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full_r( + handle: GEOSContextHandle_t, + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalidRings: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuildArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram_r( + extHandle: GEOSContextHandle_t, + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSegmentIntersection_r( + extHandle: GEOSContextHandle_t, + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSDisjoint_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEqualsExact_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSPrepare_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " STRtree functions"] + #[doc = ""] + pub fn GEOSSTRtree_create_r( + handle: GEOSContextHandle_t, + nodeCapacity: usize, + ) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 3; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 4; +#[doc = " Dimensionally Extended 9 Intersection Model related"] +#[doc = ""] +pub type GEOSRelateBoundaryNodeRules = libc::c_uint; +extern "C" { + pub fn GEOSRelatePattern_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch_r( + handle: GEOSContextHandle_t, + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; +#[doc = " Validity checking"] +#[doc = ""] +pub type GEOSValidFlags = libc::c_uint; +extern "C" { + pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSMakeValid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry info"] + #[doc = ""] + pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData_r( + handle: GEOSContextHandle_t, + g: *mut GEOSGeometry, + userData: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSGetNumGeometries_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Set the geometry's precision, optionally rounding all its"] + #[doc = " coordinates to the precision grid (if it changes)."] + #[doc = ""] + #[doc = " Note that operations will always be performed in the precision"] + #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] + #[doc = " That same precision will be attached to the operation outputs."] + #[doc = ""] + #[doc = " @param gridSize size of the precision grid, or 0 for FLOATING"] + #[doc = " precision."] + #[doc = " @param flags The bitwise OR of one of more of the"] + #[doc = " @ref GEOS_PREC_NO_TOPO \"precision options\""] + #[doc = " @retuns NULL on exception or a new GEOSGeometry object"] + #[doc = ""] + pub fn GEOSGeom_setPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Get a geometry's precision"] + #[doc = ""] + #[doc = " @return the size of the geometry's precision grid, 0 for FLOATING"] + #[doc = " precision or -1 on exception"] + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSGetNumInteriorRings_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + x: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetZ_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Misc functions"] + #[doc = ""] + pub fn GEOSArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + area: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistanceIndexed_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Algorithms"] + #[doc = ""] + pub fn GEOSOrientationIndex_r( + handle: GEOSContextHandle_t, + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTReader_t { + _unused: [u8; 0], +} +#[doc = " Reader and Writer APIs"] +#[doc = ""] +pub type GEOSWKTReader = GEOSWKTReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKTWriter = GEOSWKTWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBReader_t { + _unused: [u8; 0], +} +pub type GEOSWKBReader = GEOSWKBReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKBWriter = GEOSWKBWriter_t; +extern "C" { + pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + trim: libc::c_char, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + precision: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + dim: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + useOld3D: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + newDimension: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + byteOrder: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + writeSRID: libc::c_char, + ); +} +extern "C" { + pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); +} +extern "C" { + pub fn GEOS_getWKBOutputDims() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Coordinate Sequence functions"] + #[doc = ""] + pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXYZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + z: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXYZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize( + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions( + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_isCCW( + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Linear referencing functions -- there are more, but these are"] + #[doc = " probably sufficient for most purposes"] + #[doc = ""] + pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSInterpolate(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle( + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle( + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments( + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided( + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams( + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry Constructors."] + #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] + #[doc = " All functions return NULL on exception."] + #[doc = ""] + pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPointFromXY(x: f64, y: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon( + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection( + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Memory management"] + #[doc = ""] + pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " Topology operations - return NULL on exception."] + #[doc = ""] + pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumBoundingCircle( + g: *const GEOSGeometry, + radius: *mut f64, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect( + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_valid( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full( + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalid: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify( + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation( + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram( + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSegmentIntersection( + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Determine pointwise equivalence of two geometries, by checking if each vertex of g2 is"] + #[doc = " within tolerance of the corresponding vertex in g1."] + #[doc = " Unlike GEOSEquals, geometries that are topologically equivalent but have different"] + #[doc = " representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not"] + #[doc = " considered equivalent by GEOSEqualsExact."] + #[doc = " returns 2 on exception, 1 on true, 0 on false"] + pub fn GEOSEqualsExact( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest( + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic( + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate( + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Dimensionally Extended 9 Intersection Model related"] + #[doc = ""] + pub fn GEOSRelatePattern( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch( + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Validity checking"] + #[doc = ""] + pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail( + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry info"] + #[doc = ""] + pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); +} +extern "C" { + pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_setPrecision( + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Misc functions"] + #[doc = ""] + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistanceIndexed( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Algorithms"] + #[doc = ""] + pub fn GEOSOrientationIndex( + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Reader and Writer APIs"] + #[doc = ""] + pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read( + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write( + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); +} +extern "C" { + pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_read( + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX( + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); +} +extern "C" { + pub fn GEOSFree(buffer: *mut libc::c_void); +} diff --git a/sys/prebuilt-bindings/geos_3.9.rs b/sys/prebuilt-bindings/geos_3.9.rs new file mode 100644 index 0000000..c549225 --- /dev/null +++ b/sys/prebuilt-bindings/geos_3.9.rs @@ -0,0 +1,2528 @@ +/* automatically generated by rust-bindgen 0.60.1 */ + +pub const GEOS_VERSION_MAJOR: u32 = 3; +pub const GEOS_VERSION_MINOR: u32 = 9; +pub const GEOS_VERSION_PATCH: u32 = 3; +pub const GEOS_VERSION: &[u8; 6usize] = b"3.9.3\0"; +pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.17.0\0"; +pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; +pub const GEOS_CAPI_VERSION_MINOR: u32 = 14; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 3; +pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.9.3-CAPI-1.14.3\0"; +pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; +pub const GEOS_CAPI_LAST_INTERFACE: u32 = 15; +pub const GEOS_PREC_NO_TOPO: u32 = 1; +pub const GEOS_PREC_KEEP_COLLAPSED: u32 = 2; +pub type wchar_t = libc::c_int; +pub type max_align_t = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSContextHandle_HS { + _unused: [u8; 0], +} +#[doc = " (Abstract) type definitions"] +#[doc = ""] +pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; +pub type GEOSMessageHandler = + ::std::option::Option; +pub type GEOSMessageHandler_r = ::std::option::Option< + unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeom_t { + _unused: [u8; 0], +} +pub type GEOSGeometry = GEOSGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSPrepGeom_t { + _unused: [u8; 0], +} +pub type GEOSPreparedGeometry = GEOSPrepGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSCoordSeq_t { + _unused: [u8; 0], +} +pub type GEOSCoordSequence = GEOSCoordSeq_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSSTRtree_t { + _unused: [u8; 0], +} +pub type GEOSSTRtree = GEOSSTRtree_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSBufParams_t { + _unused: [u8; 0], +} +pub type GEOSBufferParams = GEOSBufParams_t; +pub type GEOSGeom = *mut GEOSGeometry; +pub type GEOSCoordSeq = *mut GEOSCoordSequence; +pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; +pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; +pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; +pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; +pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; +pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; +pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; +pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; +pub type GEOSGeomTypes = libc::c_uint; +pub const GEOSByteOrders_GEOS_WKB_XDR: GEOSByteOrders = 0; +pub const GEOSByteOrders_GEOS_WKB_NDR: GEOSByteOrders = 1; +pub type GEOSByteOrders = libc::c_uint; +pub type GEOSQueryCallback = ::std::option::Option< + unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), +>; +pub type GEOSDistanceCallback = ::std::option::Option< + unsafe extern "C" fn( + item1: *const libc::c_void, + item2: *const libc::c_void, + distance: *mut f64, + userdata: *mut libc::c_void, + ) -> libc::c_int, +>; +pub type GEOSInterruptCallback = ::std::option::Option; +extern "C" { + pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; +} +extern "C" { + pub fn GEOS_interruptRequest(); +} +extern "C" { + pub fn GEOS_interruptCancel(); +} +extern "C" { + pub fn GEOS_init_r() -> GEOSContextHandle_t; +} +extern "C" { + pub fn GEOS_finish_r(handle: GEOSContextHandle_t); +} +extern "C" { + pub fn GEOSContext_setNoticeHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setErrorHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setNoticeMessageHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + pub fn GEOSContext_setErrorMessageHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + pub fn GEOSversion() -> *const libc::c_char; +} +extern "C" { + pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims_r( + handle: GEOSContextHandle_t, + newDims: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder_r( + handle: GEOSContextHandle_t, + byteOrder: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf_r( + handle: GEOSContextHandle_t, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf_r( + handle: GEOSContextHandle_t, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Coordinate Sequence functions"] + #[doc = ""] + pub fn GEOSCoordSeq_create_r( + handle: GEOSContextHandle_t, + size: libc::c_uint, + dims: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_clone_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXYZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + z: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXYZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_isCCW_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Linear referencing functions -- there are more, but these are"] + #[doc = " probably sufficient for most purposes"] + #[doc = ""] + pub fn GEOSProject_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + pub fn GEOSInterpolate_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + pub fn GEOSInterpolateNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; +pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; +pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; +pub type GEOSBufCapStyles = libc::c_uint; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; +pub type GEOSBufJoinStyles = libc::c_uint; +extern "C" { + pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + mitreLimit: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry Constructors."] + #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] + #[doc = " All functions return NULL on exception."] + #[doc = ""] + pub fn GEOSGeom_createPoint_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPointFromXY_r( + handle: GEOSContextHandle_t, + x: f64, + y: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon_r( + handle: GEOSContextHandle_t, + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Memory management"] + #[doc = ""] + pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " Topology operations - return NULL on exception."] + #[doc = ""] + pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersectionPrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMaximumInscribedCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLargestEmptyCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + boundary: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearanceLine_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + distance: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifferencePrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifferencePrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnionPrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnionPrec_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSCoverageUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumBoundingCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + radius: *mut f64, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_valid_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngems: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full_r( + handle: GEOSContextHandle_t, + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalidRings: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuildArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram_r( + extHandle: GEOSContextHandle_t, + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSegmentIntersection_r( + extHandle: GEOSContextHandle_t, + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSDisjoint_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEqualsExact_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSPrepare_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedNearestPoints_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSPreparedDistance_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " STRtree functions"] + #[doc = ""] + pub fn GEOSSTRtree_create_r( + handle: GEOSContextHandle_t, + nodeCapacity: usize, + ) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 3; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 4; +#[doc = " Dimensionally Extended 9 Intersection Model related"] +#[doc = ""] +pub type GEOSRelateBoundaryNodeRules = libc::c_uint; +extern "C" { + pub fn GEOSRelatePattern_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch_r( + handle: GEOSContextHandle_t, + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; +#[doc = " Validity checking"] +#[doc = ""] +pub type GEOSValidFlags = libc::c_uint; +extern "C" { + pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSMakeValid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry info"] + #[doc = ""] + pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData_r( + handle: GEOSContextHandle_t, + g: *mut GEOSGeometry, + userData: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSGetNumGeometries_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + #[doc = " Set the geometry's precision, optionally rounding all its"] + #[doc = " coordinates to the precision grid (if it changes)."] + #[doc = ""] + #[doc = " Note that operations will always be performed in the precision"] + #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] + #[doc = " That same precision will be attached to the operation outputs."] + #[doc = ""] + #[doc = " @param gridSize size of the precision grid, or 0 for FLOATING"] + #[doc = " precision."] + #[doc = " @param flags The bitwise OR of one of more of the"] + #[doc = " @ref GEOS_PREC_NO_TOPO \"precision options\""] + #[doc = " @retuns NULL on exception or a new GEOSGeometry object"] + #[doc = ""] + pub fn GEOSGeom_setPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Get a geometry's precision"] + #[doc = ""] + #[doc = " @return the size of the geometry's precision grid, 0 for FLOATING"] + #[doc = " precision or -1 on exception"] + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSGetNumInteriorRings_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + x: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetZ_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Misc functions"] + #[doc = ""] + pub fn GEOSArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + area: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistanceIndexed_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Algorithms"] + #[doc = ""] + pub fn GEOSOrientationIndex_r( + handle: GEOSContextHandle_t, + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTReader_t { + _unused: [u8; 0], +} +pub type GEOSWKTReader = GEOSWKTReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKTWriter = GEOSWKTWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBReader_t { + _unused: [u8; 0], +} +pub type GEOSWKBReader = GEOSWKBReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKBWriter = GEOSWKBWriter_t; +extern "C" { + pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + trim: libc::c_char, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + precision: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + dim: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + useOld3D: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + newDimension: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + byteOrder: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + writeSRID: libc::c_char, + ); +} +extern "C" { + pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); +} +extern "C" { + pub fn GEOS_getWKBOutputDims() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + #[doc = " Coordinate Sequence functions"] + #[doc = ""] + pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXYZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: f64, + y: f64, + z: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXYZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut f64, + y: *mut f64, + z: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize( + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions( + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_isCCW( + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Linear referencing functions -- there are more, but these are"] + #[doc = " probably sufficient for most purposes"] + #[doc = ""] + pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSInterpolate(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle( + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle( + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments( + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided( + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams( + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve( + g: *const GEOSGeometry, + width: f64, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry Constructors."] + #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] + #[doc = " All functions return NULL on exception."] + #[doc = ""] + pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPointFromXY(x: f64, y: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon( + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection( + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Memory management"] + #[doc = ""] + pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); +} +extern "C" { + #[doc = " Topology operations - return NULL on exception."] + #[doc = ""] + pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersectionPrec( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLargestEmptyCircle( + g: *const GEOSGeometry, + boundary: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifferencePrec( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifferencePrec( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnionPrec( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumBoundingCircle( + g: *const GEOSGeometry, + radius: *mut f64, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect( + g: *const GEOSGeometry, + xmin: f64, + ymin: f64, + xmax: f64, + ymax: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_valid( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full( + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalid: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify( + g: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation( + g: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram( + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: f64, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSegmentIntersection( + ax0: f64, + ay0: f64, + ax1: f64, + ay1: f64, + bx0: f64, + by0: f64, + bx1: f64, + by1: f64, + cx: *mut f64, + cy: *mut f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Determine pointwise equivalence of two geometries, by checking if each vertex of g2 is"] + #[doc = " within tolerance of the corresponding vertex in g1."] + #[doc = " Unlike GEOSEquals, geometries that are topologically equivalent but have different"] + #[doc = " representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not"] + #[doc = " considered equivalent by GEOSEqualsExact."] + #[doc = " returns 2 on exception, 1 on true, 0 on false"] + pub fn GEOSEqualsExact( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: f64, + ) -> libc::c_char; +} +extern "C" { + #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedNearestPoints( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSPreparedDistance( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest( + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic( + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate( + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); +} +extern "C" { + #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] + #[doc = ""] + pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + #[doc = " Dimensionally Extended 9 Intersection Model related"] + #[doc = ""] + pub fn GEOSRelatePattern( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch( + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + #[doc = " Validity checking"] + #[doc = ""] + pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail( + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Geometry info"] + #[doc = ""] + pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); +} +extern "C" { + pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_setPrecision( + g: *const GEOSGeometry, + gridSize: f64, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + #[doc = " Misc functions"] + #[doc = ""] + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistanceIndexed( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: f64, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + #[doc = " Algorithms"] + #[doc = ""] + pub fn GEOSOrientationIndex( + Ax: f64, + Ay: f64, + Bx: f64, + By: f64, + Px: f64, + Py: f64, + ) -> libc::c_int; +} +extern "C" { + #[doc = " Reader and Writer APIs"] + #[doc = ""] + pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read( + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write( + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); +} +extern "C" { + pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_read( + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX( + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); +} +extern "C" { + pub fn GEOSFree(buffer: *mut libc::c_void); +} diff --git a/sys/src/types.rs b/sys/src/types.rs deleted file mode 100644 index 501cf56..0000000 --- a/sys/src/types.rs +++ /dev/null @@ -1,63 +0,0 @@ -use libc::{c_char, c_double, c_void}; - -#[repr(C)] -pub struct GEOSWKTReader { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSWKBReader { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSWKTWriter { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSWKBWriter { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSPreparedGeometry { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSCoordSequence { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSGeometry { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSContextHandle_HS { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSSTRtree { - private: [u8; 0], -} -#[repr(C)] -pub struct GEOSBufferParams { - private: [u8; 0], -} - -#[allow(non_camel_case_types)] -pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; -#[allow(non_camel_case_types)] -pub type GEOSMessageHandler = Option; -#[allow(non_camel_case_types)] -pub type GEOSMessageHandler_r = - Option; -#[allow(non_camel_case_types)] -pub type GEOSQueryCallback = Option; -#[allow(non_camel_case_types)] -pub type GEOSDistanceCallback = Option< - unsafe extern "C" fn( - item1: *const c_void, - item2: *const c_void, - distance: *mut c_double, - userdata: *mut c_void, - ), ->; -#[allow(non_camel_case_types)] -pub type GEOSInterruptCallback = Option; diff --git a/sys/wrapper.h b/sys/wrapper.h deleted file mode 100644 index 9f1ddb4..0000000 --- a/sys/wrapper.h +++ /dev/null @@ -1 +0,0 @@ -#include \ No newline at end of file From d8602f6cb8f66d7a262e8874113edb8bfcbb9454 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 18:05:59 -0700 Subject: [PATCH 04/31] Try to fix CI, fix clippy errors --- .github/workflows/CI.yml | 76 ++++++++++++++++++++++++---------------- sys/build.rs | 5 ++- sys/src/lib.rs | 5 +-- 3 files changed, 51 insertions(+), 35 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d30b42e..96a54b9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,9 +1,10 @@ +name: CI + on: push: branches: [master] pull_request: - -name: CI + workflow_dispatch: jobs: rustfmt: @@ -29,6 +30,10 @@ jobs: toolchain: nightly override: true components: clippy + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y libgeos-dev - run: cargo clippy -- -D warnings - run: cd sys && cargo clippy -- -D warnings @@ -47,27 +52,17 @@ jobs: profile: minimal toolchain: stable override: true + components: clippy - name: Install dependencies run: | sudo apt update sudo apt install valgrind sudo apt remove libgeos-dev -y - - name: Install geos - # First we install the 3.8 version of libgeos and then checkout the 3.8.1 version - run: | - git clone https://github.com/libgeos/geos - cd geos - git checkout 24650422b3982f17cc493fe92a70228f2ad624b4 - ./autogen.sh - ./configure - make - sudo make install - sudo ldconfig - name: Build static geos crate run: cargo build --features static check: - name: Check ${{ matrix.toolchain }} / ${{ matrix.triple.target }} + name: Check ${{ matrix.toolchain }} / ${{ matrix.geos }} - ${{ matrix.triple.target }} runs-on: ubuntu-latest env: LD_LIBRARY_PATH: /usr/local/lib @@ -77,49 +72,69 @@ jobs: toolchain: - stable - nightly + geos: + - "3.7.3" + - "3.8.3" + - "3.9.3" + - "3.10.3" + - "3.11.0beta2" + steps: - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: Install toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.toolchain }} override: true + - name: Install dependencies run: | sudo apt update - sudo apt install valgrind + sudo apt install build-essential ninja pkg-config valgrind sudo apt remove libgeos-dev -y - - name: Install geos - # First we install the 3.8 version of libgeos and then checkout the 3.8.1 version + + - name: Install GEOS run: | - git clone https://github.com/libgeos/geos - cd geos - git checkout 24650422b3982f17cc493fe92a70228f2ad624b4 - ./autogen.sh - ./configure - make - sudo make install - sudo ldconfig + cd sys/geos-src/source + git checkout tags/${{ matrix.geos }} + mkdir build + cd build + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. + sudo ninja install + - name: Build geos crate run: | cargo build - cargo build --features v3_8_0 - cargo build --features v3_7_0 cargo build --features v3_6_0 + cargo build --features v3_7_0 + + - name: Build geos crate GEOS >= 3.8 + if: ${{ matrix.geos == "3.8.3" || matrix.geos == "3.9.3" || matrix.geos == "3.10.3"}} + run: cargo build --features v3_8_0 + - name: Run geos tests run: | - cargo test --features v3_8_0 - cargo test --features v3_7_0 cargo test --features v3_6_0 + cargo test --features v3_7_0 cargo test --features geo cargo test --features json - cargo test --features 'v3_8_0,geo,json' cargo test + + - name: Run geos tests GEOS >= 3.8 + if: ${{ matrix.geos == "3.8.3" || matrix.geos == "3.9.3" || matrix.geos == "3.10.3"}} + run: | + cargo test --features v3_8_0 + cargo test --features 'v3_8_0,geo,json' + - name: Check doc generation run: | cargo doc --features dox cargo doc + - name: Run examples run: | cargo run --example verbose_example @@ -127,6 +142,7 @@ jobs: cargo run --features geo --example prepared_geom cargo run --example from_geo cargo run --features geo --example from_geo + - name: Check memory leaks # run valgrind to check that there are no memoryleaks # Note: cargo seems to randomly name the executable, so we use find to find all the tests diff --git a/sys/build.rs b/sys/build.rs index 8c8d8b2..0bacd4a 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -95,7 +95,10 @@ fn main() { println!("cargo:rustc-link-search=native={}", geos_path); println!("cargo:includedir={}/include", geos_path); - include_path = Path::join(Path::parent(&PathBuf::from(geos_path).as_path()).unwrap(), "include"); + include_path = Path::join( + Path::parent(PathBuf::from(geos_path).as_path()).unwrap(), + "include", + ); version = Version::parse(BUNDLED_GEOS_VERSION).unwrap(); } else { diff --git a/sys/src/lib.rs b/sys/src/lib.rs index 2f68ec6..ef5d171 100644 --- a/sys/src/lib.rs +++ b/sys/src/lib.rs @@ -11,17 +11,14 @@ //! will also statically link libgeos to this crate. In order to build GEOS, you //! need to have `cmake` and a C++ compiler. - #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![doc(html_logo_url = "https://raw.githubusercontent.com/georust/meta/master/logo/logo.png")] - -// extern crate libc; // TODO: is this needed +extern crate libc; #[cfg(feature = "static")] extern crate link_cplusplus; -// TODO: look at what GDAL does include!(concat!(env!("OUT_DIR"), "/bindings.rs")); From 898166cb767dbcd5b3cfd8450660d28db40cc9aa Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 18:09:46 -0700 Subject: [PATCH 05/31] Try to fix CI syntax error --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 96a54b9..709e314 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -113,7 +113,7 @@ jobs: cargo build --features v3_7_0 - name: Build geos crate GEOS >= 3.8 - if: ${{ matrix.geos == "3.8.3" || matrix.geos == "3.9.3" || matrix.geos == "3.10.3"}} + if: matrix.geos == "3.8.3" || matrix.geos == "3.9.3" || matrix.geos == "3.10.3" run: cargo build --features v3_8_0 - name: Run geos tests @@ -125,7 +125,7 @@ jobs: cargo test - name: Run geos tests GEOS >= 3.8 - if: ${{ matrix.geos == "3.8.3" || matrix.geos == "3.9.3" || matrix.geos == "3.10.3"}} + if: matrix.geos == "3.8.3" || matrix.geos == "3.9.3" || matrix.geos == "3.10.3" run: | cargo test --features v3_8_0 cargo test --features 'v3_8_0,geo,json' From e3c1236964363e4d1f3dbc035df70adc9e4e1ce8 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 18:14:49 -0700 Subject: [PATCH 06/31] Try again to fix CI syntax --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 709e314..e958df0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -45,7 +45,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: 'true' + submodules: "true" - name: Install toolchain uses: actions-rs/toolchain@v1 with: @@ -82,7 +82,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: 'true' + submodules: "true" - name: Install toolchain uses: actions-rs/toolchain@v1 @@ -113,7 +113,7 @@ jobs: cargo build --features v3_7_0 - name: Build geos crate GEOS >= 3.8 - if: matrix.geos == "3.8.3" || matrix.geos == "3.9.3" || matrix.geos == "3.10.3" + if: ${{ startsWith(matrix.geos, '3.8') || startsWith(matrix.geos, '3.9') || startsWith(matrix.geos == '3.10') }} run: cargo build --features v3_8_0 - name: Run geos tests @@ -125,7 +125,7 @@ jobs: cargo test - name: Run geos tests GEOS >= 3.8 - if: matrix.geos == "3.8.3" || matrix.geos == "3.9.3" || matrix.geos == "3.10.3" + if: ${{ startsWith(matrix.geos, '3.8') || startsWith(matrix.geos, '3.9') || startsWith(matrix.geos == '3.10') }} run: | cargo test --features v3_8_0 cargo test --features 'v3_8_0,geo,json' From 976279b59809026ae93b6911eb226b33faf27647 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 18:15:59 -0700 Subject: [PATCH 07/31] Fix typo --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e958df0..a9ac2c0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -113,7 +113,7 @@ jobs: cargo build --features v3_7_0 - name: Build geos crate GEOS >= 3.8 - if: ${{ startsWith(matrix.geos, '3.8') || startsWith(matrix.geos, '3.9') || startsWith(matrix.geos == '3.10') }} + if: ${{ startsWith(matrix.geos, '3.8') || startsWith(matrix.geos, '3.9') || startsWith(matrix.geos, '3.10') }} run: cargo build --features v3_8_0 - name: Run geos tests @@ -125,7 +125,7 @@ jobs: cargo test - name: Run geos tests GEOS >= 3.8 - if: ${{ startsWith(matrix.geos, '3.8') || startsWith(matrix.geos, '3.9') || startsWith(matrix.geos == '3.10') }} + if: ${{ startsWith(matrix.geos, '3.8') || startsWith(matrix.geos, '3.9') || startsWith(matrix.geos, '3.10') }} run: | cargo test --features v3_8_0 cargo test --features 'v3_8_0,geo,json' From 8223cf69cb1a51ceb92a2ae3bf208c8f38c2b1bd Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 18:17:30 -0700 Subject: [PATCH 08/31] Use correct ninja package --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a9ac2c0..fa7f890 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -94,7 +94,7 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install build-essential ninja pkg-config valgrind + sudo apt install build-essential ninja-build pkg-config valgrind sudo apt remove libgeos-dev -y - name: Install GEOS From 4d2723edaa430ee70f79b5bfaee6cd037bdfd03b Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 19:25:06 -0700 Subject: [PATCH 09/31] Try again to fix CI --- .github/workflows/CI.yml | 23 ++++++++++++++--------- sys/README.md | 16 ++++++++++------ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fa7f890..4246b67 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,7 +21,11 @@ jobs: - run: cd sys && cargo fmt -- --check clippy: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 + env: + GEOS_INCLUDE_DIR: "/usr/include" + GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" + GEOS_VERSION: 3.8.0 steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -30,6 +34,7 @@ jobs: toolchain: nightly override: true components: clippy + - name: Install dependencies run: | sudo apt update @@ -39,25 +44,22 @@ jobs: check_static: name: Check static feature - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: LD_LIBRARY_PATH: /usr/local/lib + steps: - uses: actions/checkout@v2 with: submodules: "true" + - name: Install toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - components: clippy - - name: Install dependencies - run: | - sudo apt update - sudo apt install valgrind - sudo apt remove libgeos-dev -y + - name: Build static geos crate run: cargo build --features static @@ -66,6 +68,9 @@ jobs: runs-on: ubuntu-latest env: LD_LIBRARY_PATH: /usr/local/lib + GEOS_INCLUDE_DIR: "/usr/include" + GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" + GEOS_VERSION: ${{ matrix.geos }} strategy: fail-fast: false matrix: @@ -95,11 +100,11 @@ jobs: run: | sudo apt update sudo apt install build-essential ninja-build pkg-config valgrind - sudo apt remove libgeos-dev -y - name: Install GEOS run: | cd sys/geos-src/source + git fetch origin git checkout tags/${{ matrix.geos }} mkdir build cd build diff --git a/sys/README.md b/sys/README.md index 6890426..3f6c690 100644 --- a/sys/README.md +++ b/sys/README.md @@ -10,13 +10,17 @@ You can also find it on [crates.io](https://crates.io/crates/geos). ## Build -By default, the build will use system-installed GEOS if available. +By default, the build will use system-installed GEOS if available. `pkg-config` +is used to automatically detect GEOS >= 3.9. -If using system-installed GEOS, the build can be configured with a few -environment variables: -* If `GEOS_INCLUDE_DIR`, `GEOS_LIB_DIR`, and `GEOS_VERSION` are set, they will - be used -* otherwise, `pkg-config` (Linux / macOS) is queried to determine these values +If using system-installed GEOS not discoverable by `pkg-config` (GEOS <= 3.8 or +in a custom location), the build can be configured with a few environment +variables (all must be set): +* `GEOS_INCLUDE_DIR` +* `GEOS_LIB_DIR` +* `GEOS_VERSION` + +You may be able to use `geos-config` to discover the locations to use. You can build the included version of GEOS using the `static` feature, which will also statically link libgeos to this crate. In order to build GEOS, you From 82b493eb5c02c47ee96f837ca3ff61f3ae31fa44 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 19:33:47 -0700 Subject: [PATCH 10/31] More logging for git --- .github/workflows/CI.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4246b67..e94df9a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -82,7 +82,7 @@ jobs: - "3.8.3" - "3.9.3" - "3.10.3" - - "3.11.0beta2" + - "3.11.0beta1" steps: - uses: actions/checkout@v2 @@ -105,7 +105,9 @@ jobs: run: | cd sys/geos-src/source git fetch origin - git checkout tags/${{ matrix.geos }} + git status + git ls-remote --tags origin + git checkout refs/tags/${{ matrix.geos }} mkdir build cd build cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. From 36e2036527b7bd75674e1708afdf18feb3e0712d Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 19:40:48 -0700 Subject: [PATCH 11/31] Try without quoting --- .github/workflows/CI.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e94df9a..705094e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -6,6 +6,11 @@ on: pull_request: workflow_dispatch: +# cancel running jobs on new commit to PR +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: rustfmt: runs-on: ubuntu-latest @@ -78,7 +83,7 @@ jobs: - stable - nightly geos: - - "3.7.3" + - 3.7.3 - "3.8.3" - "3.9.3" - "3.10.3" @@ -104,10 +109,8 @@ jobs: - name: Install GEOS run: | cd sys/geos-src/source - git fetch origin - git status - git ls-remote --tags origin - git checkout refs/tags/${{ matrix.geos }} + git fetch --unshallow --tags origin + git checkout "tags/${{ matrix.geos }}" mkdir build cd build cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. From d8ce4174b6da7dfc3e191ed5df89a4dc0f5a1361 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 20:18:38 -0700 Subject: [PATCH 12/31] try to discover GEOS via geos-config --- .github/workflows/CI.yml | 8 ++++---- sys/README.md | 6 +++--- sys/build.rs | 43 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 705094e..e5e63bc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -73,9 +73,9 @@ jobs: runs-on: ubuntu-latest env: LD_LIBRARY_PATH: /usr/local/lib - GEOS_INCLUDE_DIR: "/usr/include" - GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" - GEOS_VERSION: ${{ matrix.geos }} + # GEOS_INCLUDE_DIR: "/usr/include" + # GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" + # GEOS_VERSION: ${{ matrix.geos }} strategy: fail-fast: false matrix: @@ -83,7 +83,7 @@ jobs: - stable - nightly geos: - - 3.7.3 + - "3.7.3" - "3.8.3" - "3.9.3" - "3.10.3" diff --git a/sys/README.md b/sys/README.md index 3f6c690..d8b31bd 100644 --- a/sys/README.md +++ b/sys/README.md @@ -14,14 +14,14 @@ By default, the build will use system-installed GEOS if available. `pkg-config` is used to automatically detect GEOS >= 3.9. If using system-installed GEOS not discoverable by `pkg-config` (GEOS <= 3.8 or -in a custom location), the build can be configured with a few environment +in a custom location), it will attempt to use `geos-config` instead. + +The build can also be configured with a few environment variables (all must be set): * `GEOS_INCLUDE_DIR` * `GEOS_LIB_DIR` * `GEOS_VERSION` -You may be able to use `geos-config` to discover the locations to use. - You can build the included version of GEOS using the `static` feature, which will also statically link libgeos to this crate. In order to build GEOS, you need to have `cmake` and a C++ compiler. Building GEOS may take several minutes. diff --git a/sys/build.rs b/sys/build.rs index 0bacd4a..8158838 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,6 +1,7 @@ use semver::Version; use std::env; use std::path::{Path, PathBuf}; +use std::process::Command; const MINIMUM_GEOS_VERSION: &str = "3.6.0"; const BUNDLED_GEOS_VERSION: &str = "3.11.0"; // TODO: 3.10.0 @@ -171,7 +172,47 @@ fn main() { { panic!("Could not find `pkg-config` in your path. Please install it before building geos-sys."); } else { - panic!("Error while running `pkg-config`: {}", pkg_config_err); + // attempt to run geos-config instead + + let geos_config = Command::new("geos-config") + .args(["--includes", "--ldflags", "--version"]) + .output(); + if let Ok(geos_config) = geos_config { + let geos_config: Vec<&str> = std::str::from_utf8(&geos_config.stdout) + .unwrap() + .trim() + .split_whitespace() + .collect(); + assert!(geos_config.len() == 3); + + // standardize GEOS prerelease versions to match semver format: + let raw_version = geos_config[2] + .trim() + .replace("alpha", "-alpha") + .replace("beta", "-beta") + .replace("dev", "-dev"); + + if let Ok(pkg_version) = Version::parse(&raw_version) { + version = pkg_version; + } + + if version >= Version::new(3, 8, 0) { + println!("cargo:rustc-link-lib=dylib=geos_c"); + } + + println!("cargo:rustc-link-lib=dylib=geos"); + println!( + "cargo:rustc-link-search=native={}", + geos_config[1].replace("-L", "") + ); + + let include_dir = geos_config[0].trim(); + println!("cargo:includedir={}", include_dir); + + include_path = PathBuf::from(include_dir); + } else { + panic!("Could not detect GEOS using pkg-config or geos-config"); + } } } else { panic!("No GEOS version detected"); From ef8428eb8442ce002014e4d35dce1f5f5a8e41d9 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 20:49:26 -0700 Subject: [PATCH 13/31] try just linking to geos_c --- sys/build.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/build.rs b/sys/build.rs index 8158838..9ce5ba8 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -180,7 +180,6 @@ fn main() { if let Ok(geos_config) = geos_config { let geos_config: Vec<&str> = std::str::from_utf8(&geos_config.stdout) .unwrap() - .trim() .split_whitespace() .collect(); assert!(geos_config.len() == 3); @@ -196,11 +195,13 @@ fn main() { version = pkg_version; } - if version >= Version::new(3, 8, 0) { + // if version >= Version::new(3, 8, 0) { println!("cargo:rustc-link-lib=dylib=geos_c"); - } + // } else { + // println!("cargo:rustc-link-lib=dylib=geos"); + // } + - println!("cargo:rustc-link-lib=dylib=geos"); println!( "cargo:rustc-link-search=native={}", geos_config[1].replace("-L", "") From 16f32742b193cbd7ee86a3b1f8cf3ef544857f68 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 20:59:28 -0700 Subject: [PATCH 14/31] Try to use ccache to speed up GEOS builds --- .github/workflows/CI.yml | 32 +++++++++++++++++++++++++------- sys/build.rs | 7 +------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e5e63bc..126bd3f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -71,11 +71,6 @@ jobs: check: name: Check ${{ matrix.toolchain }} / ${{ matrix.geos }} - ${{ matrix.triple.target }} runs-on: ubuntu-latest - env: - LD_LIBRARY_PATH: /usr/local/lib - # GEOS_INCLUDE_DIR: "/usr/include" - # GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" - # GEOS_VERSION: ${{ matrix.geos }} strategy: fail-fast: false matrix: @@ -84,6 +79,7 @@ jobs: - nightly geos: - "3.7.3" + - "3.8.1" # TEMP: since 3.8.1 worked previously - "3.8.3" - "3.9.3" - "3.10.3" @@ -104,7 +100,29 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install build-essential ninja-build pkg-config valgrind + sudo apt install build-essential ccache ninja-build pkg-config valgrind + sudo /usr/sbin/update-ccache-symlinks + + - name: Prepare ccache + run: ccache --clear --set-config cache_dir=~/.ccache + + - name: Cache ccache + uses: actions/cache@v2 + env: + cache-name: ccache-v1 + with: + path: ~/.ccache + key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }} + restore-keys: | + ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }} + ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }} + ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }} + + - name: Clear ccache statistics + run: | + ccache --zero-stats --set-config cache_dir=~/.ccache + ccache --max-size=2G --set-config cache_dir=~/.ccache + ccache --show-stats --set-config cache_dir=~/.ccache - name: Install GEOS run: | @@ -113,7 +131,7 @@ jobs: git checkout "tags/${{ matrix.geos }}" mkdir build cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. + cmake -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release .. sudo ninja install - name: Build geos crate diff --git a/sys/build.rs b/sys/build.rs index 9ce5ba8..7055ef6 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -195,12 +195,7 @@ fn main() { version = pkg_version; } - // if version >= Version::new(3, 8, 0) { - println!("cargo:rustc-link-lib=dylib=geos_c"); - // } else { - // println!("cargo:rustc-link-lib=dylib=geos"); - // } - + println!("cargo:rustc-link-lib=dylib=geos_c"); println!( "cargo:rustc-link-search=native={}", From 125c8968b6c1f9ab67e432791ae592735863c9cb Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 17 Jun 2022 21:14:28 -0700 Subject: [PATCH 15/31] Just use env vars for build again --- .github/workflows/CI.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 126bd3f..443e213 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,7 @@ concurrency: jobs: rustfmt: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -70,7 +70,12 @@ jobs: check: name: Check ${{ matrix.toolchain }} / ${{ matrix.geos }} - ${{ matrix.triple.target }} - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 + env: + LD_LIBRARY_PATH: /usr/local/lib + GEOS_INCLUDE_DIR: "/usr/include" + GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" + GEOS_VERSION: ${{ matrix.geos }} strategy: fail-fast: false matrix: From d441afa9885c1036c8a69c9688deb005a6d77577 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 21 Jun 2022 17:18:13 -0700 Subject: [PATCH 16/31] Move binding generation to separate crate, only use prebuilt bindings when compiling --- .github/workflows/CI.yml | 75 +- .gitignore | 1 + Cargo.toml | 11 +- geos-sys-bind/Cargo.toml | 12 + geos-sys-bind/README.md | 55 + geos-sys-bind/src/main.rs | 231 +++ sys/Cargo.toml | 11 +- sys/README.md | 55 +- sys/build.rs | 365 ++--- sys/prebuilt-bindings/geos_3.10.rs | 2080 ++---------------------- sys/prebuilt-bindings/geos_3.11.rs | 2382 ++-------------------------- sys/prebuilt-bindings/geos_3.6.rs | 2036 ++++++++++++++++++++++++ sys/prebuilt-bindings/geos_3.7.rs | 251 +-- sys/prebuilt-bindings/geos_3.8.rs | 283 ++-- sys/prebuilt-bindings/geos_3.9.rs | 301 ++-- 15 files changed, 3150 insertions(+), 4999 deletions(-) create mode 100644 geos-sys-bind/Cargo.toml create mode 100644 geos-sys-bind/README.md create mode 100644 geos-sys-bind/src/main.rs create mode 100644 sys/prebuilt-bindings/geos_3.6.rs diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 443e213..1eefd37 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,10 +27,6 @@ jobs: clippy: runs-on: ubuntu-20.04 - env: - GEOS_INCLUDE_DIR: "/usr/include" - GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" - GEOS_VERSION: 3.8.0 steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -73,7 +69,6 @@ jobs: runs-on: ubuntu-20.04 env: LD_LIBRARY_PATH: /usr/local/lib - GEOS_INCLUDE_DIR: "/usr/include" GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" GEOS_VERSION: ${{ matrix.geos }} strategy: @@ -83,7 +78,8 @@ jobs: - stable - nightly geos: - - "3.7.3" + - "3.6.5" + - "3.7.5" - "3.8.1" # TEMP: since 3.8.1 worked previously - "3.8.3" - "3.9.3" @@ -142,27 +138,78 @@ jobs: - name: Build geos crate run: | cargo build + + - name: Build GEOS 3.6.0 features + if: ${{ startsWith(matrix.geos, '3.6') + run: | cargo build --features v3_6_0 + + - name: Build GEOS 3.7.0 features + if: ${{ startsWith(matrix.geos, '3.7') + run: | cargo build --features v3_7_0 - - name: Build geos crate GEOS >= 3.8 - if: ${{ startsWith(matrix.geos, '3.8') || startsWith(matrix.geos, '3.9') || startsWith(matrix.geos, '3.10') }} - run: cargo build --features v3_8_0 + - name: Build GEOS 3.8.0 features + if: ${{ startsWith(matrix.geos, '3.8') + run: | + cargo build --features v3_8_0 + + - name: Build GEOS 3.9.0 features + if: ${{ startsWith(matrix.geos, '3.9') + run: | + cargo build --features v3_9_0 + + - name: Build GEOS 3.10.0 features + if: ${{ startsWith(matrix.geos, '3.10') + run: | + cargo build --features v3_10_0 + + - name: Build GEOS 3.11.0 features + if: ${{ startsWith(matrix.geos, '3.11') + run: | + cargo build --features v3_11_0 - name: Run geos tests + run: | + cargo test + cargo test --features 'geo,json' + + - name: Test GEOS 3.6.0 features + if: ${{ startsWith(matrix.geos, '3.6') run: | cargo test --features v3_6_0 + cargo test --features 'v3_6_0,geo,json' + + - name: Test GEOS 3.7.0 features + if: ${{ startsWith(matrix.geos, '3.7') + run: | cargo test --features v3_7_0 - cargo test --features geo - cargo test --features json - cargo test + cargo test --features 'v3_7_0,geo,json' - - name: Run geos tests GEOS >= 3.8 - if: ${{ startsWith(matrix.geos, '3.8') || startsWith(matrix.geos, '3.9') || startsWith(matrix.geos, '3.10') }} + - name: Test GEOS 3.8.0 features + if: ${{ startsWith(matrix.geos, '3.8') run: | cargo test --features v3_8_0 cargo test --features 'v3_8_0,geo,json' + - name: Test GEOS 3.9.0 features + if: ${{ startsWith(matrix.geos, '3.9') + run: | + cargo test --features v3_9_0 + cargo test --features 'v3_9_0,geo,json' + + - name: Test GEOS 3.10.0 features + if: ${{ startsWith(matrix.geos, '3.10') + run: | + cargo test --features v3_10_0 + cargo test --features 'v3_10_0,geo,json' + + - name: Test GEOS 3.11.0 features + if: ${{ startsWith(matrix.geos, '3.11') + run: | + cargo test --features v3_11_0 + cargo test --features 'v3_11_0,geo,json' + - name: Check doc generation run: | cargo doc --features dox diff --git a/.gitignore b/.gitignore index 5d8bb5c..f933467 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /target/ sys/target/ sys/geos-src/target/ +geos-sys-bind/target/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock diff --git a/Cargo.toml b/Cargo.toml index 6030176..2825e5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,14 +17,17 @@ readme = "README.md" edition = "2021" [features] -json = ["geojson"] +dox = ["geo-types", "wkt", "json"] geo = ["geo-types", "wkt"] +json = ["geojson"] +static = ["geos-sys/static"] + v3_6_0 = ["geos-sys/v3_6_0"] v3_7_0 = ["geos-sys/v3_7_0", "v3_6_0"] v3_8_0 = ["geos-sys/v3_8_0", "v3_7_0"] -dox = ["geo-types", "wkt", "json"] -static = ["geos-sys/static"] -bindgen = ["geos-sys/bindgen"] +v3_9_0 = ["geos-sys/v3_9_0", "v3_8_0"] +v3_10_0 = ["geos-sys/v3_10_0", "v3_9_0"] +v3_11_0 = ["geos-sys/v3_11_0", "v3_10_0"] [dependencies] libc = "0.2" diff --git a/geos-sys-bind/Cargo.toml b/geos-sys-bind/Cargo.toml new file mode 100644 index 0000000..cd5145e --- /dev/null +++ b/geos-sys-bind/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "geos-sys-bind" +version = "0.1.0" +edition = "2021" + +description = "Generate GEOS C API bindings" + + +[dependencies] +bindgen = "0.60.1" +pkg-config = "0.3.25" +semver = "1.0" \ No newline at end of file diff --git a/geos-sys-bind/README.md b/geos-sys-bind/README.md new file mode 100644 index 0000000..6f91c20 --- /dev/null +++ b/geos-sys-bind/README.md @@ -0,0 +1,55 @@ +# geos-sys-bin + +This create builds low level [GEOS](https://libgeos.org/) C API bindings for use +in `geos-sys`. + +## Creating bindings + +[bindgen](https://docs.rs/bindgen/latest/bindgen/) is used to automatically +create bindings from the GEOS C API. + +You need to have the GEOS version for which you want to generate bindings +installed on your system. At minimum, you need to have the `geos_c.h` header +file for that version available (this is created by the GEOS build process). + +This crate will attempt to automatically detect your installation of GEOS: + +- `pkg-config` is used to automatically detect GEOS >= 3.9 +- `geos-config` is used to automatically detect GEOS < 3.9 + +If GEOS is in a custom location, you can instead use environment variables to +configure GEOS detection (both must be set): + +- `GEOS_INCLUDE_DIR` +- `GEOS_VERSION` + +## Adding a new GEOS version + +### 1. Generate new bindings + +Install the desired GEOS version on your system and then run: + +```bash +cargo run +``` + +This will produce a new binding in +`geos-sys/prebuilt-bindings/geos_..rs` based on the major and minor +version of your system-installed GEOS. + +Review the contents of this file to determine if there are new bindings that +will be problematic to integrate in Rust, such as data types that vary by +architecture. Common data types are provided using `libc`. You can compare to +bindings from a previous version of GEOS for reference. + +### 2. Add new feature + +Add a new version feature for this GEOS version with the pattern +`"v__0"` to `Cargo.toml` in the root of this repository and +`sys/Cargo.toml`. The feature for each newer version of GEOS depends on the +previous version. + +### 3. Update included version of GEOS + +* update the GEOS submodule to the latest available GEOS version +* update `BUNDLED_GEOS_VERSION` in `sys/build.rs` to match this version \ No newline at end of file diff --git a/geos-sys-bind/src/main.rs b/geos-sys-bind/src/main.rs new file mode 100644 index 0000000..3bb0e7e --- /dev/null +++ b/geos-sys-bind/src/main.rs @@ -0,0 +1,231 @@ +use bindgen::Builder; +use pkg_config::Config; +use semver::Version; +use std::env; +use std::fs; +use std::io; +use std::path::{Path, PathBuf}; +use std::process::{exit, Command}; + +const MINIMUM_GEOS_VERSION: &str = "3.6.0"; + +struct GEOSConfig { + include_dir: PathBuf, + version: Version, +} + +/// standardize GEOS prerelease versions to match semver format: +fn parse_geos_version(raw_version: &str) -> Version { + Version::parse( + &raw_version + .trim() + .replace("alpha", "-alpha") + .replace("beta", "-beta") + .replace("dev", "-dev"), + ) + .expect("Could not parse GEOS version") +} + +/// Detect GEOS config parameters using geos-config tool shipped with all compatible +/// versions of GEOS. +fn detect_geos_via_geos_config() -> Option { + let geos_config = Command::new("geos-config") + .args(["--includes", "--version"]) + .output(); + + match geos_config { + Ok(config_output) => { + let geos_config: Vec<&str> = std::str::from_utf8(&config_output.stdout) + .unwrap() + .split_whitespace() + .collect(); + assert!(geos_config.len() == 2); + + Some(GEOSConfig { + include_dir: PathBuf::from(geos_config[0].trim()), + version: parse_geos_version(&geos_config[1]), + }) + } + Err(_) => None, + } +} + +/// Detect GEOS config parameters using pkg-config (not available for all GEOS +/// versions) +fn detect_geos_via_pkg_config() -> Option { + let geos_pkg_config = Config::new() + .atleast_version(MINIMUM_GEOS_VERSION) + .cargo_metadata(false) + .env_metadata(false) + .probe("geos"); + + match &geos_pkg_config { + Ok(geos) => { + // GEOS should only have one include path for geos_c.h header + // include_path = PathBuf::from(geos.include_paths.first().unwrap()); + // version = parse_geos_version(&geos.version); + Some(GEOSConfig { + include_dir: PathBuf::from(geos.include_paths.first().unwrap()), + version: parse_geos_version(&geos.version), + }) + } + Err(pkg_config_err) => { + if matches!(pkg_config_err, pkg_config::Error::Command { cause, .. } if cause.kind() == std::io::ErrorKind::NotFound) + { + println!("Could not find `pkg-config` in your path. Please install it before running geos-sys-bind."); + exit(1); + } + + None + } + } +} + +/// Generate bindings based on GEOS header file +fn write_bindings(include_dir: &Path, out_path: &Path) { + let geos_header = include_dir.join("geos_c.h").to_str().unwrap().to_string(); + + println!("Generating bindings using GEOS header: {}", geos_header); + + Builder::default() + .size_t_is_usize(true) + .header(geos_header) + .clang_arg("-I") + .clang_arg(include_dir.to_str().unwrap()) + // use libc instead of default std::os::raw + .ctypes_prefix("libc") + // drop GEOS comments due to license constraints + .generate_comments(false) + // block deprecated APIs (both plain and "_r" variants) + .blocklist_function("initGEOS") + .blocklist_function("initGEOS_r") + .blocklist_function("finishGEOS") + .blocklist_function("finishGEOS_r") + .blocklist_function("GEOSGeomFromWKT") + .blocklist_function("GEOSGeomFromWKT_r") + .blocklist_function("GEOSGeomToWKT") + .blocklist_function("GEOSGeomToWKT_r") + .blocklist_function("GEOSSingleSidedBuffer") + .blocklist_function("GEOSSingleSidedBuffer_r") + .blocklist_function("GEOSUnionCascaded") + .blocklist_function("GEOSUnionCascaded_r") + // TODO: remove; these were deprecated a long time ago but are still used here + // .blocklist_function("GEOS_getWKBOutputDims") + // .blocklist_function("GEOS_getWKBOutputDims_r") + // .blocklist_function("GEOS_setWKBOutputDims") + // .blocklist_function("GEOS_setWKBOutputDims_r") + // .blocklist_function("GEOS_getWKBByteOrder") + // .blocklist_function("GEOS_getWKBByteOrder_r") + // .blocklist_function("GEOS_setWKBByteOrder") + // .blocklist_function("GEOS_setWKBByteOrder_r") + // .blocklist_function("GEOSGeomFromWKB_buf") + // .blocklist_function("GEOSGeomFromWKB_buf_r") + // .blocklist_function("GEOSGeomToWKB_buf") + // .blocklist_function("GEOSGeomToWKB_buf_r") + // .blocklist_function("GEOSGeomFromHEX_buf") + // .blocklist_function("GEOSGeomFromHEX_buf_r") + .generate() + .expect("Unable to generate bindings") + .write_to_file(out_path) + .expect("Unable to write bindings to file"); + + // replace f64 => c_double, f32 => c_float + let mut content = fs::read_to_string(out_path).expect("Could not read generated bindings"); + content = content + .replace(": f64", ": libc::c_double") + .replace(": f32", ": libc::c_float"); + fs::write(out_path, content).expect("Unable to write bindings to file"); + + println!("Bindings generated successfully; please review the results"); +} + +fn main() { + let mut config: Option; + + let include_dir_env = env::var_os("GEOS_INCLUDE_DIR"); + let version_env = env::var_os("GEOS_VERSION"); + + if include_dir_env.is_some() || version_env.is_some() { + let version: Version; + let include_dir: PathBuf; + + // GEOS_INCLUDE_DIR + match include_dir_env { + Some(path) => { + include_dir = PathBuf::from(path); + } + None => { + println!("GEOS_INCLUDE_DIR must be set"); + exit(1); + } + } + + // GEOS_VERSION + match version_env { + Some(raw_version) => { + version = parse_geos_version(&raw_version.to_string_lossy().to_string()); + } + None => { + println!("GEOS_VERSION must be set"); + exit(1); + } + } + + config = Some(GEOSConfig { + include_dir, + version, + }) + } else { + // try to detect using pkg-config, if available + config = detect_geos_via_pkg_config(); + + // fall back to try using geos-config + if config.is_none() { + config = detect_geos_via_geos_config(); + } + + if config.is_none() { + println!("ERROR: could not detect GEOS using pkg-config or geos-config"); + exit(1); + } + } + + let detected = config.unwrap(); + let version = detected.version; + + let min_geos_version = Version::parse(MINIMUM_GEOS_VERSION).unwrap(); + if version < min_geos_version { + println!( + "ERROR: GEOS version {}.{}.{} is older than the minimum supported version {}.{}.{}", + version.major, + version.minor, + version.patch, + min_geos_version.major, + min_geos_version.minor, + min_geos_version.patch + ); + exit(1); + } + + let out_path = PathBuf::from(format!( + "../sys/prebuilt-bindings/geos_{}.{}.rs", + version.major, version.minor + )); + + // confirm if output already exists + if out_path.exists() { + println!("\n\n======================="); + println!( + "Prebuilt bindings already exist for GEOS {}.{}\nDo you want to overwrite it (y/n)?", + version.major, version.minor + ); + let mut input = String::new(); + io::stdin().read_line(&mut input).unwrap(); + if input.to_string().to_lowercase().trim() != "y" { + println!("exiting..."); + exit(0); + } + } + + write_bindings(&detected.include_dir, &out_path); +} diff --git a/sys/Cargo.toml b/sys/Cargo.toml index 2d1a5a1..fdbe925 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -21,7 +21,6 @@ link-cplusplus = { version = "1.0", optional = true } geos-src = { path = "./geos-src", version = "0.2.1", optional = true } [build-dependencies] -bindgen = "0.60.1" pkg-config = "0.3.25" semver = "1.0" @@ -30,9 +29,11 @@ name = "geos_sys" [features] default = [] -bindgen = [] static = ["geos-src", "link-cplusplus"] -v3_6_0 = [] # Deprecated: does nothing -v3_7_0 = [] # Deprecated: does nothing -v3_8_0 = [] # Deprecated: does nothing +v3_6_0 = [] +v3_7_0 = ["v3_6_0"] +v3_8_0 = ["v3_7_0"] +v3_9_0 = ["v3_8_0"] +v3_10_0 = ["v3_9_0"] +v3_11_0 = ["v3_10_0"] diff --git a/sys/README.md b/sys/README.md index d8b31bd..17d5108 100644 --- a/sys/README.md +++ b/sys/README.md @@ -1,60 +1,31 @@ # geos-sys -Low level [GEOS](https://libgeos.org/) C API bindings for GEOS >= 3.7.0. +Low level [GEOS](https://libgeos.org/) C API bindings for GEOS >= 3.6.0. It provides C-interface as is. If you want to use a more Rust-friendly crate, use the [georust/geos](https://github.com/georust/geos) crate. You can also find it on [crates.io](https://crates.io/crates/geos). - ## Build -By default, the build will use system-installed GEOS if available. `pkg-config` -is used to automatically detect GEOS >= 3.9. +By default, the build will use system-installed GEOS if available: -If using system-installed GEOS not discoverable by `pkg-config` (GEOS <= 3.8 or -in a custom location), it will attempt to use `geos-config` instead. +- `pkg-config` is used to automatically detect GEOS >= 3.9 +- `geos-config` is used to automatically detect GEOS < 3.9 -The build can also be configured with a few environment -variables (all must be set): -* `GEOS_INCLUDE_DIR` -* `GEOS_LIB_DIR` -* `GEOS_VERSION` +If GEOS is in a custom location, you can instead use environment variables to +configure GEOS detection (both must be set): -You can build the included version of GEOS using the `static` feature, which -will also statically link libgeos to this crate. In order to build GEOS, you -need to have `cmake` and a C++ compiler. Building GEOS may take several minutes. +- `GEOS_LIB_DIR` +- `GEOS_VERSION` +You can build the included version of GEOS using the `static` feature, which +will also statically link libgeos to this crate. In order to build GEOS, you +need to have `cmake` and a C++ compiler. Building GEOS may take several minutes. ## Bindings -By default, prebuilt bindings are used if they match your version of GEOS. - -If a prebuilt binding is not available, you can generate your own bindings using -the `bindgen` feature. - -### Adding a new GEOS version - -Install the desired GEOS version on your system and then run - -```bash -cargo build --features bindgen -``` - -This will produce a new binding in `target/debug/build/geos-sys-/out/bindings.rs`. - -Copy this to `prebuilt-bindings/geos_..rs`. - - -Alternatively, you can check the GEOS submodule in out `geos-src/source` out -to a particular version, and then use the `static` feature: - -```bash -cargo build --features bindgen,static -``` +Pre-built bindings are available for all supported GEOS versions. -Note that this may encounter build errors depending on the version of GEOS due -to CMake configuration issues. You may need to switch -`.define("BUILD_TESTING", "OFF")` in `geos-src/src/build.rs` to `"ON"` in order -to successfully build using CMake. \ No newline at end of file +New bindings can be created using the sibling `geos-sys-bind` crate. diff --git a/sys/build.rs b/sys/build.rs index 7055ef6..a216b7e 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,10 +1,82 @@ use semver::Version; use std::env; -use std::path::{Path, PathBuf}; +use std::path::{PathBuf}; use std::process::Command; const MINIMUM_GEOS_VERSION: &str = "3.6.0"; -const BUNDLED_GEOS_VERSION: &str = "3.11.0"; // TODO: 3.10.0 +const BUNDLED_GEOS_VERSION: &str = "3.10.0"; + +/// standardize GEOS prerelease versions to match semver format: +fn parse_geos_version(raw_version: &str) -> Version { + Version::parse( + &raw_version + .trim() + .replace("alpha", "-alpha") + .replace("beta", "-beta") + .replace("dev", "-dev"), + ) + .expect("Could not parse GEOS version") +} + +/// Detect GEOS config parameters using geos-config tool shipped with all compatible +/// versions of GEOS. +fn detect_geos_via_geos_config() -> Option { + let geos_config = Command::new("geos-config") + .args(["--ldflags", "--version"]) + .output(); + + match geos_config { + Ok(config_output) => { + let geos_config: Vec<&str> = std::str::from_utf8(&config_output.stdout) + .unwrap() + .split_whitespace() + .collect(); + assert!(geos_config.len() == 2); + + println!("cargo:rustc-link-lib=dylib=geos_c"); + + println!( + "cargo:rustc-link-search=native={}", + geos_config[0].replace("-L", "") + ); + + Some(parse_geos_version(&geos_config[1])) + } + Err(_) => None, + } +} + +/// Detect GEOS config parameters using pkg-config (not available for all GEOS +/// versions) +fn detect_geos_via_pkg_config() -> Option { + use pkg_config::Config; + + let geos_pkg_config = Config::new() + .atleast_version(MINIMUM_GEOS_VERSION) + .probe("geos"); + + match &geos_pkg_config { + Ok(geos) => { + // GEOS should only have one include path for geos_c.h header + // include_path = PathBuf::from(geos.include_paths.first().unwrap()); + // version = parse_geos_version(&geos.version); + // Some(GEOSConfig { + // include_dir: PathBuf::from(geos.include_paths.first().unwrap()), + // version: parse_geos_version(&geos.version), + // }) + Some(parse_geos_version(&geos.version)) + } + Err(pkg_config_err) => { + if matches!(pkg_config_err, pkg_config::Error::Command { cause, .. } if cause.kind() == std::io::ErrorKind::NotFound) + { + panic!("Could not find `pkg-config` in your path. Please install it before running geos-sys-bind."); + } + + None + } + } +} + /// Hardcode a prebuilt binding version while generating docs. /// Otherwise docs.rs will explode due to not actually having libgeos installed. @@ -27,66 +99,28 @@ fn set_bindings_for_docs(out_path: &PathBuf) { std::fs::copy(&binding_path, &out_path).expect("Can't copy bindings to output directory"); } -fn write_bindings(include_path: &Path, out_path: &Path) { - let geos_header = include_path.join("geos_c.h").to_str().unwrap().to_string(); - - bindgen::Builder::default() - .size_t_is_usize(true) - .header(geos_header) - .clang_arg("-I") - .clang_arg(include_path.to_str().unwrap()) - // use libc instead of default std::os::raw - .ctypes_prefix("libc") - // block deprecated APIs (both plain and "_r" variants) - .blocklist_function("initGEOS") - .blocklist_function("initGEOS_r") - .blocklist_function("finishGEOS") - .blocklist_function("finishGEOS_r") - .blocklist_function("GEOSGeomFromWKT") - .blocklist_function("GEOSGeomFromWKT_r") - .blocklist_function("GEOSGeomToWKT") - .blocklist_function("GEOSGeomToWKT_r") - .blocklist_function("GEOSSingleSidedBuffer") - .blocklist_function("GEOSSingleSidedBuffer_r") - .blocklist_function("GEOSUnionCascaded") - .blocklist_function("GEOSUnionCascaded_r") - // TODO: remove; these were deprecated a long time ago but are still used here - // .blocklist_function("GEOS_getWKBOutputDims") - // .blocklist_function("GEOS_getWKBOutputDims_r") - // .blocklist_function("GEOS_setWKBOutputDims") - // .blocklist_function("GEOS_setWKBOutputDims_r") - // .blocklist_function("GEOS_getWKBByteOrder") - // .blocklist_function("GEOS_getWKBByteOrder_r") - // .blocklist_function("GEOS_setWKBByteOrder") - // .blocklist_function("GEOS_setWKBByteOrder_r") - // .blocklist_function("GEOSGeomFromWKB_buf") - // .blocklist_function("GEOSGeomFromWKB_buf_r") - // .blocklist_function("GEOSGeomToWKB_buf") - // .blocklist_function("GEOSGeomToWKB_buf_r") - // .blocklist_function("GEOSGeomFromHEX_buf") - // .blocklist_function("GEOSGeomFromHEX_buf_r") - .generate() - .expect("Unable to generate bindings") - .write_to_file(out_path) - .expect("Unable to write bindings to file"); -} - fn main() { println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-env-changed=GEOS_INCLUDE_DIR"); println!("cargo:rerun-if-env-changed=GEOS_LIB_DIR"); - println!("cargo:rerun-if-env-changed=GEOS_VERSION"); + // println!("cargo:rerun-if-env-changed=GEOS_VERSION"); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs"); - let mut version = Version::new(0, 0, 0); - let include_path: PathBuf; + // let mut version = Version::new(0, 0, 0); + // let include_path: PathBuf; if env::var("DOCS_RS").is_ok() { set_bindings_for_docs(&out_path); return; } - // static feature includes building the included GEOS prior to this build step + let mut version: Option; + let lib_dir_env = env::var_os("GEOS_LIB_DIR"); + let version_env = env::var_os("GEOS_VERSION"); + + // static feature includes building the included GEOS prior to this build step. + // The statically-linked GEOS is the version pinned in the GEOS submodule + // in geos-src/source if cfg!(feature = "static") { let geos_path = std::env::var("DEP_GEOSSRC_SEARCH").unwrap(); @@ -96,158 +130,111 @@ fn main() { println!("cargo:rustc-link-search=native={}", geos_path); println!("cargo:includedir={}/include", geos_path); - include_path = Path::join( - Path::parent(PathBuf::from(geos_path).as_path()).unwrap(), - "include", - ); + version = Some(Version::parse(BUNDLED_GEOS_VERSION).expect("Could not parse bundled GEOS version")); - version = Version::parse(BUNDLED_GEOS_VERSION).unwrap(); - } else { - use pkg_config::Config; + } else if lib_dir_env.is_some() || version_env.is_some() { + // if any env vars are set, all must be set + println!("cargo:rustc-link-lib=dylib=geos_c"); - let include_dir_env = env::var_os("GEOS_INCLUDE_DIR"); - let lib_dir_env = env::var_os("GEOS_LIB_DIR"); - let version_env = env::var_os("GEOS_VERSION"); - - if include_dir_env.is_some() || lib_dir_env.is_some() || version_env.is_some() { - // if any env vars are set, all must be set - println!("cargo:rustc-link-lib=dylib=geos_c"); - - // GEOS_INCLUDE_DIR - match include_dir_env { - Some(path) => { - include_path = PathBuf::from(path); - } - None => { - panic!("GEOS_INCLUDE_DIR must be set"); - } + // GEOS_LIB_DIR + match lib_dir_env { + Some(path) => { + let lib_dir = PathBuf::from(path).as_path().to_str().unwrap().to_string(); + println!("cargo:rustc-link-search={}", lib_dir); } - - // GEOS_LIB_DIR - match lib_dir_env { - Some(path) => { - let lib_dir = PathBuf::from(path).as_path().to_str().unwrap().to_string(); - println!("cargo:rustc-link-search={}", lib_dir); - } - None => { - panic!("GEOS_LIB_DIR must be set"); - } + None => { + panic!("GEOS_LIB_DIR must be set"); } + } - // GEOS_VERSION - match version_env { - Some(raw_version) => { - match Version::parse(raw_version.to_string_lossy().to_string().trim()) { - Ok(parsed_version) => { - version = parsed_version; - } - Err(_) => panic!("Could not parse version: {:?}", raw_version), - } - } - None => { - panic!("GEOS_VERSION must be set"); - } + // GEOS_VERSION + match version_env { + Some(raw_version) => { + version = Some(parse_geos_version(&raw_version.to_string_lossy().to_string())); } - } else { - let geos_pkg_config = Config::new().probe("geos"); - - if let Ok(geos) = &geos_pkg_config { - // GEOS should only have one include path for geos_c.h header - include_path = PathBuf::from(geos.include_paths.first().unwrap()); - - // standardize GEOS prerelease versions to match semver format: - let raw_version = geos - .version - .trim() - .replace("alpha", "-alpha") - .replace("beta", "-beta") - .replace("dev", "-dev"); - - if let Ok(pkg_version) = Version::parse(&raw_version) { - version = pkg_version; - } - } else if let Err(pkg_config_err) = &geos_pkg_config { - // Special case output for this common error - if matches!(pkg_config_err, pkg_config::Error::Command { cause, .. } if cause.kind() == std::io::ErrorKind::NotFound) - { - panic!("Could not find `pkg-config` in your path. Please install it before building geos-sys."); - } else { - // attempt to run geos-config instead - - let geos_config = Command::new("geos-config") - .args(["--includes", "--ldflags", "--version"]) - .output(); - if let Ok(geos_config) = geos_config { - let geos_config: Vec<&str> = std::str::from_utf8(&geos_config.stdout) - .unwrap() - .split_whitespace() - .collect(); - assert!(geos_config.len() == 3); - - // standardize GEOS prerelease versions to match semver format: - let raw_version = geos_config[2] - .trim() - .replace("alpha", "-alpha") - .replace("beta", "-beta") - .replace("dev", "-dev"); - - if let Ok(pkg_version) = Version::parse(&raw_version) { - version = pkg_version; - } - - println!("cargo:rustc-link-lib=dylib=geos_c"); - - println!( - "cargo:rustc-link-search=native={}", - geos_config[1].replace("-L", "") - ); - - let include_dir = geos_config[0].trim(); - println!("cargo:includedir={}", include_dir); - - include_path = PathBuf::from(include_dir); - } else { - panic!("Could not detect GEOS using pkg-config or geos-config"); - } - } - } else { - panic!("No GEOS version detected"); + None => { + panic!("GEOS_VERSION must be set"); } } + } else { + // try to detect using pkg-config, if available + version = detect_geos_via_pkg_config(); - let min_geos_version = Version::parse(MINIMUM_GEOS_VERSION).unwrap(); - if version < min_geos_version { - panic!( - "GEOS version {}.{}.{} is older than the minimum supported version {}.{}.{}", - version.major, - version.minor, - version.patch, - min_geos_version.major, - min_geos_version.minor, - min_geos_version.patch - ); + // fall back to try using geos-config + if version.is_none() { + version = detect_geos_via_geos_config(); + } + + if version.is_none() { + panic!("Could not detect GEOS using pkg-config or geos-config"); } } - if cfg!(feature = "bindgen") { - write_bindings(&include_path, &out_path); - } else { - { - println!( - "cargo:rustc-cfg=geos_sys_{}_{}_{}", - version.major, version.minor, version.patch - ); - let binding_path = PathBuf::from(format!( - "prebuilt-bindings/geos_{}.{}.rs", - version.major, version.minor - )); - if !binding_path.exists() { - panic!("No pre-built bindings available for GEOS version {}.{}. Use `--features bindgen` to generate your own bindings.", version.major, version.minor); - } + let version = version.unwrap(); - std::fs::copy(&binding_path, &out_path) - .expect("Can't copy bindings to output directory"); - } + let min_geos_version = Version::parse(MINIMUM_GEOS_VERSION).unwrap(); + if version < min_geos_version { + panic!( + "GEOS version {}.{}.{} is older than the minimum supported version {}.{}.{}", + version.major, + version.minor, + version.patch, + min_geos_version.major, + min_geos_version.minor, + min_geos_version.patch + ); + } + + // resolve user-requested version (via specific version feature, e.g., "v3_10") + // to the correct pre-built binding; their available GEOS must be >= requested + // pre-built binding version + + let mut binding_version = Version::parse(MINIMUM_GEOS_VERSION).unwrap(); + + if cfg!(feature = "v3_7") { + binding_version = Version::new(3, 7, 0); + } + + if cfg!(feature = "v3_8") { + binding_version = Version::new(3, 8, 0); + } + + if cfg!(feature = "v3_9") { + binding_version = Version::new(3, 9, 0); + } + + if cfg!(feature = "v3_10") { + binding_version = Version::new(3, 10, 0); } + + if cfg!(feature = "v3_11") { + // binding_version = Version::new(3, 11, 0); + + // FIXME: remove string parsing once released + binding_version = Version::parse("3.11.0-beta2").unwrap(); + } + + if version < binding_version { + panic!("You requested a version of GEOS ({}.{}) that is greater than your installed GEOS version ({}.{}.{})", binding_version.major, binding_version.minor, version.major, version.minor, version.patch); + } + + // copy requested prebuilt binding (if exists) to output directory + let binding_path = PathBuf::from(format!( + "prebuilt-bindings/geos_{}.{}.rs", + binding_version.major, binding_version.minor + )); + + // this shouldn't happen except when a new version feature is added but the + // binding has not yet been created + if !binding_path.exists() { + panic!("No pre-built bindings available for requested GEOS version {}.{}\nUse features to select an available version.", binding_version.major, binding_version.minor); + } + + std::fs::copy(&binding_path, &out_path).expect("Can't copy bindings to output directory"); + + println!( + "cargo:rustc-cfg=geos_sys_{}_{}", + binding_version.major, binding_version.minor + ); } diff --git a/sys/prebuilt-bindings/geos_3.10.rs b/sys/prebuilt-bindings/geos_3.10.rs index 4ffcdbd..2991014 100644 --- a/sys/prebuilt-bindings/geos_3.10.rs +++ b/sys/prebuilt-bindings/geos_3.10.rs @@ -18,28 +18,9 @@ pub type max_align_t = u128; pub struct GEOSContextHandle_HS { _unused: [u8; 0], } -#[doc = " Type returned by GEOS_init_r(), for use in multi-threaded"] -#[doc = " applications."] -#[doc = ""] -#[doc = " There should be only one GEOSContextHandle_t per thread."] pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; -#[doc = " Callback function for passing GEOS error messages to parent process."] -#[doc = ""] -#[doc = " Set the GEOSMessageHandler for error and notice messages in \\ref initGEOS"] -#[doc = " for single-threaded programs, or using \\ref initGEOS_r for threaded"] -#[doc = " programs"] -#[doc = ""] -#[doc = " \\param fmt the message format template"] pub type GEOSMessageHandler = ::std::option::Option; -#[doc = " A GEOS message handler function."] -#[doc = ""] -#[doc = " \\param message the message contents"] -#[doc = " \\param userdata the user data pointer that was passed to GEOS when"] -#[doc = " registering this message handler."] -#[doc = ""] -#[doc = " \\see GEOSContext_setErrorMessageHandler"] -#[doc = " \\see GEOSContext_setNoticeMessageHandler"] pub type GEOSMessageHandler_r = ::std::option::Option< unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), >; @@ -48,130 +29,57 @@ pub type GEOSMessageHandler_r = ::std::option::Option< pub struct GEOSGeom_t { _unused: [u8; 0], } -#[doc = " Geometry generic type. Geometry can be a point, linestring, polygon,"] -#[doc = " multipoint, multilinestring, multipolygon, or geometrycollection."] -#[doc = " Geometry type can be read with \\ref GEOSGeomTypeId. Most functions"] -#[doc = " in GEOS either have GEOSGeometry* as a parameter or a return type."] -#[doc = " \\see GEOSGeom_createPoint"] -#[doc = " \\see GEOSGeom_createLineString"] -#[doc = " \\see GEOSGeom_createPolygon"] -#[doc = " \\see GEOSGeom_createCollection"] -#[doc = " \\see GEOSGeom_destroy"] pub type GEOSGeometry = GEOSGeom_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSPrepGeom_t { _unused: [u8; 0], } -#[doc = " Prepared geometry type."] -#[doc = " \\see GEOSPrepare()"] -#[doc = " \\see GEOSPreparedGeom_destroy()"] pub type GEOSPreparedGeometry = GEOSPrepGeom_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSCoordSeq_t { _unused: [u8; 0], } -#[doc = " Coordinate sequence."] -#[doc = " \\see GEOSCoordSeq_create()"] -#[doc = " \\see GEOSCoordSeq_destroy()"] pub type GEOSCoordSequence = GEOSCoordSeq_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSSTRtree_t { _unused: [u8; 0], } -#[doc = " STRTree index."] -#[doc = " \\see GEOSSTRtree_create()"] -#[doc = " \\see GEOSSTRtree_destroy()"] pub type GEOSSTRtree = GEOSSTRtree_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSBufParams_t { _unused: [u8; 0], } -#[doc = " Parameter object for buffering."] -#[doc = " \\see GEOSBufferParams_create()"] -#[doc = " \\see GEOSBufferParams_destroy()"] pub type GEOSBufferParams = GEOSBufParams_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSMakeValidParams_t { _unused: [u8; 0], } -#[doc = " Parameter object for validity enforcement."] -#[doc = " \\see GEOSMakeValidParams_create()"] -#[doc = " \\see GEOSMakeValidParams_destroy()"] pub type GEOSMakeValidParams = GEOSMakeValidParams_t; -#[doc = " \\cond"] pub type GEOSGeom = *mut GEOSGeometry; pub type GEOSCoordSeq = *mut GEOSCoordSequence; -#[doc = " Point"] pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; -#[doc = " Linestring"] pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; -#[doc = " Linear ring, used within polygons"] pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; -#[doc = " Polygon"] pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; -#[doc = " Multipoint, a homogeneous collection of points"] pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; -#[doc = " Multilinestring, a homogeneous collection of linestrings"] pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; -#[doc = " Multipolygon, a homogeneous collection of polygons"] pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; -#[doc = " Geometry collection, a heterogeneous collection of geometry"] pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; -#[doc = " Geometry type number, used by functions returning or"] -#[doc = " consuming geometry types."] -#[doc = ""] -#[doc = " \\see GEOSGeomType"] -#[doc = " \\see GEOSGeomTypeId"] pub type GEOSGeomTypes = libc::c_uint; -#[doc = " Big Endian"] pub const GEOSWKBByteOrders_GEOS_WKB_XDR: GEOSWKBByteOrders = 0; -#[doc = " Little Endian"] pub const GEOSWKBByteOrders_GEOS_WKB_NDR: GEOSWKBByteOrders = 1; -#[doc = " Well-known binary byte orders used when"] -#[doc = " writing to WKB."] -#[doc = ""] -#[doc = " \\see GEOSWKBWriter_setByteOrder"] pub type GEOSWKBByteOrders = libc::c_uint; -#[doc = " Extended"] pub const GEOSWKBFlavors_GEOS_WKB_EXTENDED: GEOSWKBFlavors = 1; -#[doc = " ISO"] pub const GEOSWKBFlavors_GEOS_WKB_ISO: GEOSWKBFlavors = 2; -#[doc = " Well-known binary flavors to use"] -#[doc = " when writing to WKB. ISO flavour is"] -#[doc = " more standard. Extended flavour supports"] -#[doc = " 3D and SRID embedding. GEOS reads both"] -#[doc = " transparently."] -#[doc = ""] -#[doc = " \\see GEOSWKBWriter_setFlavor"] pub type GEOSWKBFlavors = libc::c_uint; -#[doc = " Callback function for use in spatial index search calls. Pass into"] -#[doc = " the query function and handle query results as the index"] -#[doc = " returns them."] -#[doc = ""] -#[doc = " \\see GEOSSTRtree_query"] pub type GEOSQueryCallback = ::std::option::Option< unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), >; -#[doc = " Callback function for use in spatial index nearest neighbor calculations."] -#[doc = " Allows custom distance to be calculated between items in the"] -#[doc = " index. Is passed two items, and sets the calculated distance"] -#[doc = " between the items into the distance pointer. Extra data for the"] -#[doc = " calculation can be passed via the userdata."] -#[doc = ""] -#[doc = " \\param item1 first of the pair of items to calculate distance between"] -#[doc = " \\param item2 second of the pair of items to calculate distance between"] -#[doc = " \\param distance the distance between the items here"] -#[doc = " \\param userdata extra data for the calculation"] -#[doc = ""] -#[doc = " \\return zero if distance calculation succeeded, non-zero otherwise"] -#[doc = ""] -#[doc = " \\see GEOSSTRtree_nearest_generic"] -#[doc = " \\see GEOSSTRtree_iterate"] pub type GEOSDistanceCallback = ::std::option::Option< unsafe extern "C" fn( item1: *const libc::c_void, @@ -180,66 +88,35 @@ pub type GEOSDistanceCallback = ::std::option::Option< userdata: *mut libc::c_void, ) -> libc::c_int, >; -#[doc = " Callback function for use in interruption. The callback will be invoked _before_ checking for"] -#[doc = " interruption, so can be used to request it."] -#[doc = ""] -#[doc = " \\see GEOS_interruptRegisterCallback"] -#[doc = " \\see GEOS_interruptRequest"] -#[doc = " \\see GEOS_interruptCancel"] pub type GEOSInterruptCallback = ::std::option::Option; extern "C" { - #[doc = " Register a function to be called when processing is interrupted."] - #[doc = " \\param cb Callback function to invoke"] - #[doc = " \\return the previously configured callback"] - #[doc = " \\see GEOSInterruptCallback"] pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; } extern "C" { - #[doc = " Request safe interruption of operations"] pub fn GEOS_interruptRequest(); } extern "C" { - #[doc = " Cancel a pending interruption request"] pub fn GEOS_interruptCancel(); } extern "C" { - #[doc = " Initialize a context for this thread. Pass this context into"] - #[doc = " your other calls of `*_r` functions."] - #[doc = " \\return a GEOS context for this thread"] pub fn GEOS_init_r() -> GEOSContextHandle_t; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSContextHandle_t"] - #[doc = " when you are finished calling GEOS functions."] - #[doc = " \\param handle to be freed"] pub fn GEOS_finish_r(handle: GEOSContextHandle_t); } extern "C" { - #[doc = " Set the notice handler callback function for run-time notice messages."] - #[doc = " \\param extHandle the context returned by \\ref GEOS_init_r."] - #[doc = " \\param nf the handler callback"] - #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] pub fn GEOSContext_setNoticeHandler_r( extHandle: GEOSContextHandle_t, nf: GEOSMessageHandler, ) -> GEOSMessageHandler; } extern "C" { - #[doc = " Set the notice handler callback function for run-time error messages."] - #[doc = " \\param extHandle the GEOS context from \\ref GEOS_init_r"] - #[doc = " \\param ef the handler callback"] - #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] pub fn GEOSContext_setErrorHandler_r( extHandle: GEOSContextHandle_t, ef: GEOSMessageHandler, ) -> GEOSMessageHandler; } extern "C" { - #[doc = " Sets a notice message handler on the given GEOS context."] - #[doc = " \\param extHandle the GEOS context from \\ref GEOS_init_r"] - #[doc = " \\param nf the message handler"] - #[doc = " \\param userData optional user data pointer that will be passed to the message handler"] - #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] pub fn GEOSContext_setNoticeMessageHandler_r( extHandle: GEOSContextHandle_t, nf: GEOSMessageHandler_r, @@ -247,13 +124,6 @@ extern "C" { ) -> GEOSMessageHandler_r; } extern "C" { - #[doc = " Sets an error message handler on the given GEOS context."] - #[doc = ""] - #[doc = " \\param extHandle the GEOS context"] - #[doc = " \\param ef the message handler"] - #[doc = " \\param userData optional user data pointer that will be passed to the message handler"] - #[doc = ""] - #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] pub fn GEOSContext_setErrorMessageHandler_r( extHandle: GEOSContextHandle_t, ef: GEOSMessageHandler_r, @@ -261,7 +131,6 @@ extern "C" { ) -> GEOSMessageHandler_r; } extern "C" { - #[doc = " \\see GEOSCoordSeq_create"] pub fn GEOSCoordSeq_create_r( handle: GEOSContextHandle_t, size: libc::c_uint, @@ -269,7 +138,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSCoordSeq_copyFromBuffer"] pub fn GEOSCoordSeq_copyFromBuffer_r( handle: GEOSContextHandle_t, buf: *const f64, @@ -279,7 +147,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSCoordSeq_copyFromArrays"] pub fn GEOSCoordSeq_copyFromArrays_r( handle: GEOSContextHandle_t, x: *const f64, @@ -290,7 +157,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSCoordSeq_copyToBuffer"] pub fn GEOSCoordSeq_copyToBuffer_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -300,7 +166,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_copyToArrays"] pub fn GEOSCoordSeq_copyToArrays_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -311,76 +176,67 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_clone"] pub fn GEOSCoordSeq_clone_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSCoordSeq_destroy"] pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); } extern "C" { - #[doc = " \\see GEOSCoordSeq_setX"] pub fn GEOSCoordSeq_setX_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setY"] pub fn GEOSCoordSeq_setY_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setZ"] pub fn GEOSCoordSeq_setZ_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setXY"] pub fn GEOSCoordSeq_setXY_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setXYZ"] pub fn GEOSCoordSeq_setXYZ_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, - z: f64, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setOrdinate"] pub fn GEOSCoordSeq_setOrdinate_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getX"] pub fn GEOSCoordSeq_getX_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -389,7 +245,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getY"] pub fn GEOSCoordSeq_getY_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -398,7 +253,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getZ"] pub fn GEOSCoordSeq_getZ_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -407,7 +261,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getXY"] pub fn GEOSCoordSeq_getXY_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -417,7 +270,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getXYZ"] pub fn GEOSCoordSeq_getXYZ_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -428,7 +280,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getOrdinate"] pub fn GEOSCoordSeq_getOrdinate_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -438,7 +289,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getSize"] pub fn GEOSCoordSeq_getSize_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -446,7 +296,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getDimensions"] pub fn GEOSCoordSeq_getDimensions_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -454,7 +303,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_isCCW"] pub fn GEOSCoordSeq_isCCW_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -462,7 +310,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSProject"] pub fn GEOSProject_r( handle: GEOSContextHandle_t, line: *const GEOSGeometry, @@ -470,15 +317,13 @@ extern "C" { ) -> f64; } extern "C" { - #[doc = " \\see GEOSInterpolate"] pub fn GEOSInterpolate_r( handle: GEOSContextHandle_t, line: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSProjectNormalized"] pub fn GEOSProjectNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -486,53 +331,35 @@ extern "C" { ) -> f64; } extern "C" { - #[doc = " \\see GEOSInterpolateNormalized"] pub fn GEOSInterpolateNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSBuffer"] pub fn GEOSBuffer_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } -#[doc = " End is rounded, with end point of original line in the centre of the round cap."] pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; -#[doc = " End is flat, with end point of original line at the end of the buffer"] pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; -#[doc = " End is flat, with end point of original line in the middle of a square enclosing that point"] pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; -#[doc = " Cap styles control the ends of buffered lines."] -#[doc = " \\see GEOSBuffer"] pub type GEOSBufCapStyles = libc::c_uint; -#[doc = " Join is rounded, essentially each line is terminated"] -#[doc = " in a round cap. Form round corner."] pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; -#[doc = " Join is flat, with line between buffer edges,"] -#[doc = " through the join point. Forms flat corner."] pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; -#[doc = " Join is the point at which the two buffer edges intersect."] -#[doc = " Forms sharp corner."] pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; -#[doc = " Join styles control the buffer shape at bends in a line."] -#[doc = " \\see GEOSBuffer"] pub type GEOSBufJoinStyles = libc::c_uint; extern "C" { - #[doc = " \\see GEOSBufferParams_create"] pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; } extern "C" { - #[doc = " \\see GEOSBufferParams_destroy"] pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); } extern "C" { - #[doc = " \\see GEOSBufferParams_setEndCapStyle"] pub fn GEOSBufferParams_setEndCapStyle_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, @@ -540,7 +367,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferParams_setJoinStyle"] pub fn GEOSBufferParams_setJoinStyle_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, @@ -548,15 +374,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferParams_setMitreLimit"] pub fn GEOSBufferParams_setMitreLimit_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferParams_setQuadrantSegments"] pub fn GEOSBufferParams_setQuadrantSegments_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, @@ -564,7 +388,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferParams_setSingleSided"] pub fn GEOSBufferParams_setSingleSided_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, @@ -572,88 +395,76 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferWithParams"] pub fn GEOSBufferWithParams_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSBufferWithStyle"] pub fn GEOSBufferWithStyle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSDensify"] pub fn GEOSDensify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSOffsetCurve"] pub fn GEOSOffsetCurve_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createPoint"] pub fn GEOSGeom_createPoint_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createPointFromXY"] pub fn GEOSGeom_createPointFromXY_r( handle: GEOSContextHandle_t, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createEmptyPoint"] pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createLinearRing"] pub fn GEOSGeom_createLinearRing_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createLineString"] pub fn GEOSGeom_createLineString_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createEmptyLineString"] pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createEmptyPolygon"] pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createPolygon"] pub fn GEOSGeom_createPolygon_r( handle: GEOSContextHandle_t, shell: *mut GEOSGeometry, @@ -662,7 +473,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createCollection"] pub fn GEOSGeom_createCollection_r( handle: GEOSContextHandle_t, type_: libc::c_int, @@ -671,30 +481,25 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createEmptyCollection"] pub fn GEOSGeom_createEmptyCollection_r( handle: GEOSContextHandle_t, type_: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_clone"] pub fn GEOSGeom_clone_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_destroy"] pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); } extern "C" { - #[doc = " \\see GEOSEnvelope"] pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSIntersection"] pub fn GEOSIntersection_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -702,61 +507,53 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSIntersectionPrec"] pub fn GEOSIntersectionPrec_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSConvexHull"] pub fn GEOSConvexHull_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumRotatedRectangle"] pub fn GEOSMinimumRotatedRectangle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMaximumInscribedCircle"] pub fn GEOSMaximumInscribedCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSLargestEmptyCircle"] pub fn GEOSLargestEmptyCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, boundary: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumWidth"] pub fn GEOSMinimumWidth_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumClearanceLine"] pub fn GEOSMinimumClearanceLine_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumClearance"] pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -764,7 +561,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSDifference"] pub fn GEOSDifference_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -772,16 +568,14 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSDifferencePrec"] pub fn GEOSDifferencePrec_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSymDifference"] pub fn GEOSSymDifference_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -789,21 +583,18 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSymDifferencePrec"] pub fn GEOSSymDifferencePrec_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSBoundary"] pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSUnion"] pub fn GEOSUnion_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -811,52 +602,45 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSUnionPrec"] pub fn GEOSUnionPrec_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSUnaryUnion"] pub fn GEOSUnaryUnion_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSUnaryUnionPrec"] pub fn GEOSUnaryUnionPrec_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSCoverageUnion"] pub fn GEOSCoverageUnion_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPointOnSurface"] pub fn GEOSPointOnSurface_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGetCentroid"] pub fn GEOSGetCentroid_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumBoundingCircle"] pub fn GEOSMinimumBoundingCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -865,22 +649,19 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSNode"] pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSClipByRect"] pub fn GEOSClipByRect_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonize"] pub fn GEOSPolygonize_r( handle: GEOSContextHandle_t, geoms: *const *const GEOSGeometry, @@ -888,7 +669,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonize_valid"] pub fn GEOSPolygonize_valid_r( handle: GEOSContextHandle_t, geoms: *const *const GEOSGeometry, @@ -896,7 +676,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonizer_getCutEdges"] pub fn GEOSPolygonizer_getCutEdges_r( handle: GEOSContextHandle_t, geoms: *const *const GEOSGeometry, @@ -904,7 +683,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonize_full"] pub fn GEOSPolygonize_full_r( handle: GEOSContextHandle_t, input: *const GEOSGeometry, @@ -914,48 +692,41 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSBuildArea"] pub fn GEOSBuildArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSLineMerge"] pub fn GEOSLineMerge_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSReverse"] pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSimplify"] pub fn GEOSSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSTopologyPreserveSimplify"] pub fn GEOSTopologyPreserveSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_extractUniquePoints"] pub fn GEOSGeom_extractUniquePoints_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSharedPaths"] pub fn GEOSSharedPaths_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -963,58 +734,52 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSnap"] pub fn GEOSSnap_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSDelaunayTriangulation"] pub fn GEOSDelaunayTriangulation_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSConstrainedDelaunayTriangulation"] pub fn GEOSConstrainedDelaunayTriangulation_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSVoronoiDiagram"] pub fn GEOSVoronoiDiagram_r( extHandle: GEOSContextHandle_t, g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSegmentIntersection"] pub fn GEOSSegmentIntersection_r( extHandle: GEOSContextHandle_t, - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSDisjoint"] pub fn GEOSDisjoint_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1022,7 +787,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSTouches"] pub fn GEOSTouches_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1030,7 +794,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSIntersects"] pub fn GEOSIntersects_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1038,7 +801,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSCrosses"] pub fn GEOSCrosses_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1046,7 +808,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSWithin"] pub fn GEOSWithin_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1054,7 +815,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSContains"] pub fn GEOSContains_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1062,7 +822,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSOverlaps"] pub fn GEOSOverlaps_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1070,7 +829,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSEquals"] pub fn GEOSEquals_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1078,16 +836,14 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSEqualsExact"] pub fn GEOSEqualsExact_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSCovers"] pub fn GEOSCovers_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1095,7 +851,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSCoveredBy"] pub fn GEOSCoveredBy_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1103,18 +858,15 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPrepare"] pub fn GEOSPrepare_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *const GEOSPreparedGeometry; } extern "C" { - #[doc = " \\see GEOSPreparedGeom_destroy"] pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); } extern "C" { - #[doc = " \\see GEOSPreparedContains"] pub fn GEOSPreparedContains_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1122,7 +874,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedContainsProperly"] pub fn GEOSPreparedContainsProperly_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1130,7 +881,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedCoveredBy"] pub fn GEOSPreparedCoveredBy_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1138,7 +888,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedCovers"] pub fn GEOSPreparedCovers_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1146,7 +895,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedCrosses"] pub fn GEOSPreparedCrosses_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1154,7 +902,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedDisjoint"] pub fn GEOSPreparedDisjoint_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1162,7 +909,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedIntersects"] pub fn GEOSPreparedIntersects_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1170,7 +916,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedOverlaps"] pub fn GEOSPreparedOverlaps_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1178,7 +923,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedTouches"] pub fn GEOSPreparedTouches_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1186,7 +930,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedWithin"] pub fn GEOSPreparedWithin_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1194,7 +937,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedNearestPoints"] pub fn GEOSPreparedNearestPoints_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1202,7 +944,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSPreparedDistance"] pub fn GEOSPreparedDistance_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1211,23 +952,20 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSPreparedDistanceWithin"] pub fn GEOSPreparedDistanceWithin_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: f64, + dist: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSSTRtree_create"] pub fn GEOSSTRtree_create_r( handle: GEOSContextHandle_t, nodeCapacity: usize, ) -> *mut GEOSSTRtree; } extern "C" { - #[doc = " \\see GEOSSTRtree_insert"] pub fn GEOSSTRtree_insert_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1236,7 +974,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSSTRtree_query"] pub fn GEOSSTRtree_query_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1246,7 +983,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSSTRtree_nearest"] pub fn GEOSSTRtree_nearest_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1254,7 +990,6 @@ extern "C" { ) -> *const GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSTRtree_nearest_generic"] pub fn GEOSSTRtree_nearest_generic_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1265,7 +1000,6 @@ extern "C" { ) -> *const libc::c_void; } extern "C" { - #[doc = " \\see GEOSSTRtree_iterate"] pub fn GEOSSTRtree_iterate_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1274,7 +1008,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSSTRtree_remove"] pub fn GEOSSTRtree_remove_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1283,46 +1016,32 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSSTRtree_destroy"] pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " \\see GEOSisEmpty"] pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSisSimple"] pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSisRing"] pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSHasZ"] pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSisClosed"] pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } -#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryRuleMod2()"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; -#[doc = " Same as \\ref GEOSRELATE_BNR_MOD2"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; -#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryEndPoint()"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; -#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint()"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 3; -#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryMonovalentEndPoint()"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 4; -#[doc = " Controls the behavior of the result of GEOSRelate when returning"] -#[doc = " DE9IM results for two geometries."] pub type GEOSRelateBoundaryNodeRules = libc::c_uint; extern "C" { - #[doc = " \\see GEOSRelatePattern"] pub fn GEOSRelatePattern_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1331,7 +1050,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSRelate"] pub fn GEOSRelate_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1339,7 +1057,6 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSRelatePatternMatch"] pub fn GEOSRelatePatternMatch_r( handle: GEOSContextHandle_t, mat: *const libc::c_char, @@ -1347,7 +1064,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSRelateBoundaryNodeRule"] pub fn GEOSRelateBoundaryNodeRule_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1355,23 +1071,18 @@ extern "C" { bnr: libc::c_int, ) -> *mut libc::c_char; } -#[doc = " Allow self-touching rings to form a hole in a polygon."] pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; -#[doc = " Change behaviour of validity testing in \\ref GEOSisValidDetail"] pub type GEOSValidFlags = libc::c_uint; extern "C" { - #[doc = " \\see GEOSisValid"] pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSisValidReason"] pub fn GEOSisValidReason_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSisValidDetail"] pub fn GEOSisValidDetail_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1380,33 +1091,20 @@ extern "C" { location: *mut *mut GEOSGeometry, ) -> libc::c_char; } -#[doc = " Original method, combines all rings into"] -#[doc = "a set of noded lines and then extracts valid"] -#[doc = "polygons from that linework."] pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_LINEWORK: GEOSMakeValidMethods = 0; -#[doc = " Structured method, first makes all rings valid"] -#[doc = "then merges shells and subtracts holes from"] -#[doc = "shells to generate valid result. Assumes that"] -#[doc = "holes and shells are correctly categorized."] pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_STRUCTURE: GEOSMakeValidMethods = 1; -#[doc = " Algorithm to use when repairing invalid geometries."] -#[doc = ""] -#[doc = " \\see GEOSMakeValidWithParams"] pub type GEOSMakeValidMethods = libc::c_uint; extern "C" { - #[doc = " \\see GEOSMakeValidParams_create"] pub fn GEOSMakeValidParams_create_r(extHandle: GEOSContextHandle_t) -> *mut GEOSMakeValidParams; } extern "C" { - #[doc = " \\see GEOSMakeValidParams_destroy"] pub fn GEOSMakeValidParams_destroy_r( handle: GEOSContextHandle_t, parms: *mut GEOSMakeValidParams, ); } extern "C" { - #[doc = " \\see GEOSMakeValidParams_setKeepCollapsed"] pub fn GEOSMakeValidParams_setKeepCollapsed_r( handle: GEOSContextHandle_t, p: *mut GEOSMakeValidParams, @@ -1414,7 +1112,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSMakeValidParams_setMethod"] pub fn GEOSMakeValidParams_setMethod_r( handle: GEOSContextHandle_t, p: *mut GEOSMakeValidParams, @@ -1422,14 +1119,12 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSMakeValid"] pub fn GEOSMakeValid_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidWithParams_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1437,31 +1132,25 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeomType"] pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSGeomTypeId"] pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGetSRID"] pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSSetSRID"] pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); } extern "C" { - #[doc = " \\see GEOSGeom_getUserData"] pub fn GEOSGeom_getUserData_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut libc::c_void; } extern "C" { - #[doc = " \\see GEOSGeom_setUserData"] pub fn GEOSGeom_setUserData_r( handle: GEOSContextHandle_t, g: *mut GEOSGeometry, @@ -1469,14 +1158,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSGetNumGeometries"] pub fn GEOSGetNumGeometries_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGetGeometryN"] pub fn GEOSGetGeometryN_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1484,47 +1171,36 @@ extern "C" { ) -> *const GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSNormalize"] pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; } -#[doc = " The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed."] pub const GEOSPrecisionRules_GEOS_PREC_VALID_OUTPUT: GEOSPrecisionRules = 0; -#[doc = " Precision reduction is performed pointwise. Output geometry may be invalid due to collapse or self-intersection. (This might be better called \"GEOS_PREC_POINTWISE\" - the current name is historical.)"] pub const GEOSPrecisionRules_GEOS_PREC_NO_TOPO: GEOSPrecisionRules = 1; -#[doc = " Like the default mode, except that collapsed linear geometry elements are preserved. Collapsed polygonal input elements are removed."] pub const GEOSPrecisionRules_GEOS_PREC_KEEP_COLLAPSED: GEOSPrecisionRules = 2; -#[doc = " Controls the behavior of GEOSGeom_setPrecision()"] -#[doc = " when altering the precision of a geometry."] pub type GEOSPrecisionRules = libc::c_uint; extern "C" { - #[doc = " \\see GEOSGeom_setPrecision"] pub fn GEOSGeom_setPrecision_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_getPrecision"] pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; } extern "C" { - #[doc = " \\see GEOSGetNumInteriorRings"] pub fn GEOSGetNumInteriorRings_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetNumPoints"] pub fn GEOSGeomGetNumPoints_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetX"] pub fn GEOSGeomGetX_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1532,7 +1208,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetY"] pub fn GEOSGeomGetY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1540,7 +1215,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetZ"] pub fn GEOSGeomGetZ_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1548,7 +1222,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGetInteriorRingN"] pub fn GEOSGetInteriorRingN_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1556,42 +1229,36 @@ extern "C" { ) -> *const GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGetExteriorRing"] pub fn GEOSGetExteriorRing_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *const GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGetNumCoordinates"] pub fn GEOSGetNumCoordinates_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getCoordSeq"] pub fn GEOSGeom_getCoordSeq_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *const GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSGeom_getDimensions"] pub fn GEOSGeom_getDimensions_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getCoordinateDimension"] pub fn GEOSGeom_getCoordinateDimension_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getXMin"] pub fn GEOSGeom_getXMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1599,7 +1266,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getYMin"] pub fn GEOSGeom_getYMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1607,7 +1273,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getXMax"] pub fn GEOSGeom_getXMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1615,7 +1280,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getYMax"] pub fn GEOSGeom_getYMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1623,7 +1287,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetPointN"] pub fn GEOSGeomGetPointN_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1631,21 +1294,18 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeomGetStartPoint"] pub fn GEOSGeomGetStartPoint_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeomGetEndPoint"] pub fn GEOSGeomGetEndPoint_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSArea"] pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1653,7 +1313,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSLength"] pub fn GEOSLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1661,7 +1320,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSDistance"] pub fn GEOSDistance_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1670,16 +1328,14 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSDistanceWithin"] pub fn GEOSDistanceWithin_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: f64, + dist: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSDistanceIndexed"] pub fn GEOSDistanceIndexed_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1688,7 +1344,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSHausdorffDistance"] pub fn GEOSHausdorffDistance_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1697,17 +1352,15 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSHausdorffDistanceDensify"] pub fn GEOSHausdorffDistanceDensify_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSFrechetDistance"] pub fn GEOSFrechetDistance_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1716,17 +1369,15 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSFrechetDistanceDensify"] pub fn GEOSFrechetDistanceDensify_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetLength"] pub fn GEOSGeomGetLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1734,7 +1385,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSNearestPoints"] pub fn GEOSNearestPoints_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1742,15 +1392,14 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSOrientationIndex"] pub fn GEOSOrientationIndex_r( handle: GEOSContextHandle_t, - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } #[repr(C)] @@ -1758,65 +1407,44 @@ extern "C" { pub struct GEOSWKTReader_t { _unused: [u8; 0], } -#[doc = " Reader object to read Well-Known Text (WKT) format and construct Geometry."] -#[doc = " \\see GEOSWKTReader_create"] -#[doc = " \\see GEOSWKTReader_create_r"] pub type GEOSWKTReader = GEOSWKTReader_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSWKTWriter_t { _unused: [u8; 0], } -#[doc = " Writer object to turn Geometry into Well-Known Text (WKT)."] -#[doc = " \\see GEOSWKTWriter_create"] -#[doc = " \\see GEOSWKTWriter_create_r"] pub type GEOSWKTWriter = GEOSWKTWriter_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSWKBReader_t { _unused: [u8; 0], } -#[doc = " Reader object to read Well-Known Binary (WKB) format and construct Geometry."] -#[doc = " \\see GEOSWKBReader_create"] -#[doc = " \\see GEOSWKBReader_create_r"] pub type GEOSWKBReader = GEOSWKBReader_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSWKBWriter_t { _unused: [u8; 0], } -#[doc = " Writer object to turn Geometry into Well-Known Binary (WKB)."] -#[doc = " \\see GEOSWKBWriter_create"] -#[doc = " \\see GEOSWKBWriter_create_r"] pub type GEOSWKBWriter = GEOSWKBWriter_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSGeoJSONReader_t { _unused: [u8; 0], } -#[doc = " Reader object to read GeoJSON format and construct a Geometry."] -#[doc = " \\see GEOSGeoJSONReader_create"] -#[doc = " \\see GEOSGeoJSONReader_create_r"] pub type GEOSGeoJSONReader = GEOSGeoJSONReader_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSGeoJSONWriter_t { _unused: [u8; 0], } -#[doc = " Writer object to turn a Geometry into GeoJSON."] -#[doc = " \\see GEOSGeoJSONReader_create"] -#[doc = " \\see GEOSGeoJSONReader_create_r"] pub type GEOSGeoJSONWriter = GEOSGeoJSONWriter_t; extern "C" { - #[doc = " \\see GEOSWKTReader_create"] pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; } extern "C" { - #[doc = " \\see GEOSWKTReader_destroy"] pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); } extern "C" { - #[doc = " \\see GEOSWKTReader_read"] pub fn GEOSWKTReader_read_r( handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader, @@ -1824,15 +1452,12 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSWKTReader_create"] pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; } extern "C" { - #[doc = " \\see GEOSWKTWriter_destroy"] pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); } extern "C" { - #[doc = " \\see GEOSWKTWriter_write"] pub fn GEOSWKTWriter_write_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1840,7 +1465,6 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSWKTWriter_setTrim"] pub fn GEOSWKTWriter_setTrim_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1848,7 +1472,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKTWriter_setRoundingPrecision"] pub fn GEOSWKTWriter_setRoundingPrecision_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1856,7 +1479,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKTWriter_setOutputDimension"] pub fn GEOSWKTWriter_setOutputDimension_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1864,14 +1486,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKTWriter_getOutputDimension"] pub fn GEOSWKTWriter_getOutputDimension_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSWKTWriter_setOld3D"] pub fn GEOSWKTWriter_setOld3D_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1879,15 +1499,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKBReader_create"] pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; } extern "C" { - #[doc = " \\see GEOSWKBReader_destroy"] pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); } extern "C" { - #[doc = " \\see GEOSWKBReader_read"] pub fn GEOSWKBReader_read_r( handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader, @@ -1896,7 +1513,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSWKBReader_readHEX"] pub fn GEOSWKBReader_readHEX_r( handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader, @@ -1905,15 +1521,12 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSWKBWriter_create"] pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; } extern "C" { - #[doc = " \\see GEOSWKBWriter_destroy"] pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); } extern "C" { - #[doc = " \\see GEOSWKBWriter_write"] pub fn GEOSWKBWriter_write_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -1922,7 +1535,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\see GEOSWKBWriter_writeHEX"] pub fn GEOSWKBWriter_writeHEX_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -1931,14 +1543,12 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\see GEOSWKBWriter_getOutputDimension"] pub fn GEOSWKBWriter_getOutputDimension_r( handle: GEOSContextHandle_t, writer: *const GEOSWKBWriter, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSWKBWriter_setOutputDimension"] pub fn GEOSWKBWriter_setOutputDimension_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -1946,14 +1556,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKBWriter_getByteOrder"] pub fn GEOSWKBWriter_getByteOrder_r( handle: GEOSContextHandle_t, writer: *const GEOSWKBWriter, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSWKBWriter_setByteOrder"] pub fn GEOSWKBWriter_setByteOrder_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -1961,14 +1569,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKBWriter_getFlavor"] pub fn GEOSWKBWriter_getFlavor_r( handle: GEOSContextHandle_t, writer: *const GEOSWKBWriter, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSWKBWriter_setFlavor"] pub fn GEOSWKBWriter_setFlavor_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -1976,14 +1582,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKBWriter_getIncludeSRID"] pub fn GEOSWKBWriter_getIncludeSRID_r( handle: GEOSContextHandle_t, writer: *const GEOSWKBWriter, ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSWKBWriter_setIncludeSRID"] pub fn GEOSWKBWriter_setIncludeSRID_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -1991,15 +1595,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSGeoJSONReader_create"] pub fn GEOSGeoJSONReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONReader; } extern "C" { - #[doc = " \\see GEOSGeoJSONReader_destroy"] pub fn GEOSGeoJSONReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSGeoJSONReader); } extern "C" { - #[doc = " \\see GEOSWKTReader_read"] pub fn GEOSGeoJSONReader_readGeometry_r( handle: GEOSContextHandle_t, reader: *mut GEOSGeoJSONReader, @@ -2007,15 +1608,12 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeoJSONWriter_create"] pub fn GEOSGeoJSONWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONWriter; } extern "C" { - #[doc = " \\see GEOSGeoJSONWriter_destroy"] pub fn GEOSGeoJSONWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSGeoJSONWriter); } extern "C" { - #[doc = " \\see GEOSGeoJSONWriter_writeGeometry"] pub fn GEOSGeoJSONWriter_writeGeometry_r( handle: GEOSContextHandle_t, writer: *mut GEOSGeoJSONWriter, @@ -2024,30 +1622,15 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSFree"] pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); } extern "C" { - #[doc = " Returns the current GEOS version string. eg: \"3.10.0\""] - #[doc = " This function does not have a reentrant variant and is"] - #[doc = " available if `GEOS_USE_ONLY_R_API` is defined."] - #[doc = " \\return version string"] pub fn GEOSversion() -> *const libc::c_char; } extern "C" { - #[doc = " Create a coordinate sequence."] - #[doc = " \\param size number of coordinates in the sequence"] - #[doc = " \\param dims dimensionality of the coordinates (2 or 3)"] - #[doc = " \\return the sequence or NULL on exception"] pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Create a coordinate sequence by copying from a buffer of doubles (XYXY or XYZXYZ)"] - #[doc = " \\param buf pointer to buffer"] - #[doc = " \\param size number of coordinates in the sequence"] - #[doc = " \\param hasZ does buffer have Z values?"] - #[doc = " \\param hasM does buffer have M values? (they will be ignored)"] - #[doc = " \\return the sequence or NULL on exception"] pub fn GEOSCoordSeq_copyFromBuffer( buf: *const f64, size: libc::c_uint, @@ -2056,13 +1639,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Create a coordinate sequence by copying from arrays of doubles"] - #[doc = " \\param x array of x coordinates"] - #[doc = " \\param y array of y coordinates"] - #[doc = " \\param z array of z coordinates, or NULL"] - #[doc = " \\param m array of m coordinates, (must be NULL)"] - #[doc = " \\param size length of each array"] - #[doc = " \\return the sequence or NULL on exception"] pub fn GEOSCoordSeq_copyFromArrays( x: *const f64, y: *const f64, @@ -2072,12 +1648,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Copy the contents of a coordinate sequence to a buffer of doubles (XYXY or XYZXYZ)"] - #[doc = " \\param s sequence to copy"] - #[doc = " \\param buf buffer to which coordinates should be copied"] - #[doc = " \\param hasZ copy Z values to buffer?"] - #[doc = " \\param hasM copy M values to buffer? (will be NaN)"] - #[doc = " \\return 1 on success, 0 on error"] pub fn GEOSCoordSeq_copyToBuffer( s: *const GEOSCoordSequence, buf: *mut f64, @@ -2086,13 +1656,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Copy the contents of a coordinate sequence to a buffer of doubles (XYZY or XYZXYZ)"] - #[doc = " \\param s sequence to copy"] - #[doc = " \\param x array to which x values should be copied"] - #[doc = " \\param y array to which y values should be copied"] - #[doc = " \\param z array to which z values should be copied, or NULL"] - #[doc = " \\param m array to which m values should be copied (will all be NAN)"] - #[doc = " \\return 1 on success, 0 on error"] pub fn GEOSCoordSeq_copyToArrays( s: *const GEOSCoordSequence, x: *mut f64, @@ -2102,93 +1665,49 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Clone a coordinate sequence."] - #[doc = " \\param s the coordinate sequence to clone"] - #[doc = " \\return a copy of the coordinate sequence or NULL on exception"] pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Destroy a coordinate sequence, freeing all memory."] - #[doc = " \\param s the coordinate sequence to destroy"] pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - #[doc = " Set X ordinate values in a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val the value to set the ordinate to"] - #[doc = " \\return 0 on exception"] - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - #[doc = " Set Y ordinate values in a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val the value to set the ordinate to"] - #[doc = " \\return 0 on exception"] - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - #[doc = " Set Z ordinate values in a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val the value to set the ordinate to"] - #[doc = " \\return 0 on exception"] - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - #[doc = " Set X and Y ordinate values in a coordinate sequence simultaneously."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param x the value to set the X ordinate to"] - #[doc = " \\param y the value to set the Y ordinate to"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_setXY( s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Set X, Y and Z ordinate values in a coordinate sequence simultaneously."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param x the value to set the X ordinate to"] - #[doc = " \\param y the value to set the Y ordinate to"] - #[doc = " \\param z the value to set the Z ordinate to"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_setXYZ( s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, - z: f64, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Set Nth ordinate value in a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param dim the dimension number of the ordinate to alter, zero based"] - #[doc = " \\param val the value to set the ordinate to"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_setOrdinate( s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Read X ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val pointer where ordinate value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getX( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2196,11 +1715,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read Y ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val pointer where ordinate value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getY( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2208,11 +1722,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read Z ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val pointer where ordinate value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getZ( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2220,12 +1729,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read X and Y ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param x pointer where ordinate X value will be placed"] - #[doc = " \\param y pointer where ordinate Y value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getXY( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2234,13 +1737,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read X and Y ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param x pointer where ordinate X value will be placed"] - #[doc = " \\param y pointer where ordinate Y value will be placed"] - #[doc = " \\param z pointer where ordinate Z value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getXYZ( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2250,12 +1746,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read Nth ordinate value from a coordinate sequence."] - #[doc = " \\param[in] s the coordinate sequence"] - #[doc = " \\param[in] idx the index of the coordinate to alter, zero based"] - #[doc = " \\param[in] dim the dimension number of the ordinate to read, zero based"] - #[doc = " \\param[out] val pointer where ordinate value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getOrdinate( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2264,280 +1754,130 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Get size info from a coordinate sequence."] - #[doc = " \\param[in] s the coordinate sequence"] - #[doc = " \\param[out] size pointer where size value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getSize( s: *const GEOSCoordSequence, size: *mut libc::c_uint, ) -> libc::c_int; } extern "C" { - #[doc = " Get dimension info from a coordinate sequence."] - #[doc = " \\param[in] s the coordinate sequence"] - #[doc = " \\param[out] dims pointer where dimension value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getDimensions( s: *const GEOSCoordSequence, dims: *mut libc::c_uint, ) -> libc::c_int; } extern "C" { - #[doc = " Check orientation of a coordinate sequence. Closure of the sequence is"] - #[doc = " assumed. Invalid (collapsed) sequences will return false. Short (less"] - #[doc = " than 4 points) sequences will return exception."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param is_ccw pointer for ccw value, 1 if counter-clockwise orientation, 0 otherwise"] - #[doc = " \\return 0 on exception, 1 on success"] pub fn GEOSCoordSeq_isCCW( s: *const GEOSCoordSequence, is_ccw: *mut libc::c_char, ) -> libc::c_int; } extern "C" { - #[doc = " Distance of point projected onto line from the start of the line."] - #[doc = " \\param line linear target of projection"] - #[doc = " \\param point point to be projected onto 'g'"] - #[doc = " \\return distance along line that point projects to, -1 on exception"] - #[doc = ""] - #[doc = " \\note Line parameter must be a LineString."] pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; } extern "C" { - #[doc = " Measuring from start of line, return point that is distance"] - #[doc = " the start. Line parameter must be a LineString."] - #[doc = " \\param line linear target of projection"] - #[doc = " \\param d distance from start of line to created point"] - #[doc = " \\return The point \\ref GEOSGeometry that is distance from the start of line."] - #[doc = " Caller takes ownership of returned geometry."] - pub fn GEOSInterpolate(line: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; + pub fn GEOSInterpolate(line: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Project point to line and calculate the **proportion** of"] - #[doc = " the line the point is from the start. For example, a point that"] - #[doc = " projects to the middle of a line would be return 0.5."] - #[doc = " \\param line linear target of projection"] - #[doc = " \\param point the point to project"] - #[doc = " \\return The proportion of the overall line length that the projected"] - #[doc = " point falls at."] pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; } extern "C" { - #[doc = " Measuring from start of line, return point that is a proportion"] - #[doc = " the start. Line parameter must be a LineString."] - #[doc = " \\param line linear target of projection"] - #[doc = " \\param proportion The proportion from the start of line to created point"] - #[doc = " \\return The point \\ref GEOSGeometry that is distance from the start of line."] - #[doc = " Caller takes ownership of returned geometry."] pub fn GEOSInterpolateNormalized( line: *const GEOSGeometry, - proportion: f64, + proportion: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Buffer a geometry."] - #[doc = " \\param g The input geometry to be buffered."] - #[doc = " \\param width The distance by which to expand the geometry (or contract)"] - #[doc = " if the value is negative."] - #[doc = " \\param quadsegs The number of segments per quadrant to generate. More"] - #[doc = " segments provides a more \"precise\" buffer at the expense of size."] - #[doc = " \\return A \\ref GEOSGeometry of the buffered result."] - #[doc = " NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSBuffer( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a default GEOSBufferParams object for controlling the shape"] - #[doc = " of buffered generated by \\ref GEOSBuffer."] - #[doc = " \\return A newly allocated GEOSBufferParams. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSBufferParams_destroy()."] pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; } extern "C" { - #[doc = " Destroy a GEOSBufferParams and free all associated memory."] - #[doc = " \\param parms The object to destroy."] pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); } extern "C" { - #[doc = " Set the end cap type of a GEOSBufferParams to the desired style,"] - #[doc = " which must be one enumerated in \\ref GEOSBufCapStyles."] - #[doc = " \\return 0 on exception, 1 on success."] pub fn GEOSBufferParams_setEndCapStyle( p: *mut GEOSBufferParams, style: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Set the join type of a GEOSBufferParams to the desired style,"] - #[doc = " which must be one enumerated in \\ref GEOSBufJoinStyles."] - #[doc = " \\return 0 on exception, 1 on success."] pub fn GEOSBufferParams_setJoinStyle( p: *mut GEOSBufferParams, joinStyle: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Set the mitre limit of a GEOSBufferParams to the desired size."] - #[doc = " For acute angles, a mitre join can extend very very far from"] - #[doc = " the input geometry, which is probably not desired. The"] - #[doc = " mitre limit places an upper bound on that."] - #[doc = " \\param p The GEOSBufferParams to operate on"] - #[doc = " \\param mitreLimit The limit to set"] - #[doc = " \\return 0 on exception, 1 on success."] - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) -> libc::c_int; } extern "C" { - #[doc = " Set the number of segments to use to stroke each quadrant"] - #[doc = " of circular arcs generated by the buffering process. More"] - #[doc = " segments means a smoother output, but with larger size."] - #[doc = " \\param p The GEOSBufferParams to operate on"] - #[doc = " \\param quadSegs Number of segments per quadrant"] - #[doc = " \\return 0 on exception, 1 on success."] pub fn GEOSBufferParams_setQuadrantSegments( p: *mut GEOSBufferParams, quadSegs: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Sets whether the computed buffer should be single-sided."] - #[doc = " A single-sided buffer is constructed on only one side of each input line."] - #[doc = " \\see geos::operation::buffer::BufferParameters::setSingleSided"] - #[doc = " \\param p The GEOSBufferParams to operate on"] - #[doc = " \\param singleSided Set to 1 for single-sided output 0 otherwise"] - #[doc = " \\return 0 on exception, 1 on success."] pub fn GEOSBufferParams_setSingleSided( p: *mut GEOSBufferParams, singleSided: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Generates a buffer using the special parameters in the GEOSBufferParams"] - #[doc = " \\param g The geometry to buffer"] - #[doc = " \\param p The parameters to apply to the buffer process"] - #[doc = " \\param width The buffer distance"] - #[doc = " \\return The buffered geometry, or NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSBufferWithParams( g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Generate a buffer using the provided style parameters."] - #[doc = " \\param g The geometry to buffer"] - #[doc = " \\param width Width of the buffer"] - #[doc = " \\param quadsegs Number of segments per quadrant"] - #[doc = " \\param endCapStyle See \\ref GEOSBufCapStyles"] - #[doc = " \\param joinStyle See \\ref GEOSBufJoinStyles"] - #[doc = " \\param mitreLimit See GEOSBufferParams_setMitreLimit"] - #[doc = " \\return The buffered geometry, or NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSBufferWithStyle( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Densifies a geometry using a given distance tolerance."] - #[doc = " Additional vertices will be added to every line segment"] - #[doc = " that is greater this tolerance; these vertices will"] - #[doc = " evenly subdivide that segment."] - #[doc = " Only linear components of input geometry are densified."] - #[doc = " \\param g The geometry to densify"] - #[doc = " \\param tolerance the distance tolerance to densify"] - #[doc = " \\return The densified geometry, or NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - pub fn GEOSDensify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Generates offset curve for linear geometry."] - #[doc = " Only LineStrings accepted as input."] - #[doc = " \\param g The linear geometry to offset from"] - #[doc = " \\param width Distance to offset from the curve."] - #[doc = " Negative for a right-side offset."] - #[doc = " Positive for a left-side offset."] - #[doc = " \\param quadsegs Number of segments per quadrant"] - #[doc = " \\param joinStyle See \\ref GEOSBufJoinStyles"] - #[doc = " \\param mitreLimit See GEOSBufferParams_setMitreLimit"] - #[doc = " \\return The offset geometry. Returns NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::buffer::BufferBuilder::bufferLineSingleSided"] + pub fn GEOSDensify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSOffsetCurve( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a point geometry from a coordinate sequence."] - #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] - #[doc = " \\return A newly allocated point geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a point geometry from a pair of coordinates."] - #[doc = " \\param x The X coordinate"] - #[doc = " \\param y The Y coordinate"] - #[doc = " \\return A newly allocated point geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - pub fn GEOSGeom_createPointFromXY(x: f64, y: f64) -> *mut GEOSGeometry; + pub fn GEOSGeom_createPointFromXY(x: libc::c_double, y: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates an empty point."] - #[doc = " \\return A newly allocated empty point geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a linear ring geometry, for use in a polygon."] - #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] - #[doc = " \\return A newly allocated linear ring geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a linestring geometry."] - #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] - #[doc = " \\return A newly allocated linestring geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates an emptylinestring geometry."] - #[doc = " \\return A newly allocated linestring geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates an empty polygon geometry."] - #[doc = " \\return A newly allocated empty polygon geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a polygon geometry from line ring geometries."] - #[doc = " \\param shell A linear ring that is the exterior ring of the polygon."] - #[doc = " \\param holes An array of linear rings that are the holes."] - #[doc = " \\param nholes The number of rings in the holes array."] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\note The holes argument is an array of GEOSGeometry* objects."] - #[doc = " The caller **retains ownership** of the containing array,"] - #[doc = " but the ownership of the pointed-to objects is transferred"] - #[doc = " to the returned \\ref GEOSGeometry."] pub fn GEOSGeom_createPolygon( shell: *mut GEOSGeometry, holes: *mut *mut GEOSGeometry, @@ -2545,16 +1885,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a geometry collection."] - #[doc = " \\param type The geometry type, enumerated by \\ref GEOSGeomTypes"] - #[doc = " \\param geoms A list of geometries that will form the collection"] - #[doc = " \\param ngeoms The number of geometries in the geoms list"] - #[doc = " \\return A newly allocated geometry collection. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\note The holes argument is an array of GEOSGeometry* objects."] - #[doc = " The caller **retains ownership** of the containing array,"] - #[doc = " but the ownership of the pointed-to objects is transferred"] - #[doc = " to the returned \\ref GEOSGeometry."] pub fn GEOSGeom_createCollection( type_: libc::c_int, geoms: *mut *mut GEOSGeometry, @@ -2562,325 +1892,102 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create an empty geometry collection."] - #[doc = " \\param type The geometry type, enumerated by \\ref GEOSGeomTypes"] - #[doc = " \\return A newly allocated empty geometry collection. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a new copy of the input geometry."] - #[doc = " \\param g The geometry to copy"] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Release the memory associated with a geometry."] - #[doc = " \\param g The geometry to be destroyed."] pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); } extern "C" { - #[doc = " Returns minimum rectangular polygon that contains the geometry."] - #[doc = " \\param g The geometry to calculate an envelope for"] - #[doc = " \\return A newly allocated polygonal envelope. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the intersection of two geometries: the set of points"] - #[doc = " that fall within **both** geometries."] - #[doc = " \\param g1 one of the geometries"] - #[doc = " \\param g2 the other geometry"] - #[doc = " \\return A newly allocated geometry of the intersection. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the intersection of two geometries: the set of points"] - #[doc = " that fall within **both** geometries. All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param g1 one of the geometries"] - #[doc = " \\param g2 the other geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the intersection. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSIntersectionPrec( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the difference of two geometries A and B: the set of points"] - #[doc = " that fall within A but **not** within B."] - #[doc = " \\param ga the base geometry"] - #[doc = " \\param gb the geometry to subtract from it"] - #[doc = " \\return A newly allocated geometry of the difference. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the difference of two geometries A and B: the set of points"] - #[doc = " that fall within A but **not** within B."] - #[doc = " All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param ga one of the geometries"] - #[doc = " \\param gb the other geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the difference. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSDifferencePrec( ga: *const GEOSGeometry, gb: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the symmetric difference of two geometries A and B: the set of points"] - #[doc = " that fall in A but **not** within B and the set of points that fall in B but"] - #[doc = " **not** in A."] - #[doc = " \\param ga geometry A"] - #[doc = " \\param gb geometry B"] - #[doc = " \\return A newly allocated geometry of the symmetric difference. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSSymDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the symmetric difference of two geometries A and B: the set of points"] - #[doc = " that fall in A but **not** within B and the set of points that fall in B but"] - #[doc = " **not** in A."] - #[doc = " All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param ga one of the geometries"] - #[doc = " \\param gb the other geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the symmetric difference. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSSymDifferencePrec( ga: *const GEOSGeometry, gb: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the union of two geometries A and B: the set of points"] - #[doc = " that fall in A **or** within B."] - #[doc = " \\param ga geometry A"] - #[doc = " \\param gb geometry B"] - #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSUnion(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the union of two geometries A and B: the set of points"] - #[doc = " that fall in A **or** within B."] - #[doc = " All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param ga one of the geometries"] - #[doc = " \\param gb the other geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSUnionPrec( ga: *const GEOSGeometry, gb: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the union of all components of a single geometry. Usually"] - #[doc = " used to convert a collection into the smallest set of polygons"] - #[doc = " that cover the same area."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the union of all components of a single geometry. Usually"] - #[doc = " used to convert a collection into the smallest set of polygons"] - #[doc = " that cover the same area."] - #[doc = " All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param g input geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] - pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Returns the \"boundary\" of a geometry, as defined by the DE9IM:"] - #[doc = ""] - #[doc = " - the boundary of a polygon is the linear rings dividing the exterior"] - #[doc = " from the interior"] - #[doc = " - the boundary of a linestring is the end points"] - #[doc = " - the boundary of a point is the point"] - #[doc = ""] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the boundary. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns convex hull of a geometry. The smallest convex Geometry"] - #[doc = " that contains all the points in the input Geometry"] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the convex hull. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the minimum rotated rectangular POLYGON which encloses"] - #[doc = " the input geometry. The rectangle has width equal to the"] - #[doc = " minimum diameter, and a longer length. If the convex hill of"] - #[doc = " the input is degenerate (a line or point) a linestring or point"] - #[doc = " is returned. The minimum rotated rectangle can be used as an"] - #[doc = " extremely generalized representation for the given geometry."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the rotated envelope. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Constructs the \"maximum inscribed circle\" (MIC) for a polygonal geometry,"] - #[doc = " up to a specified tolerance."] - #[doc = " The MIC is determined by a point in the interior of the area"] - #[doc = " which has the farthest distance from the area boundary, along with a boundary point at that distance."] - #[doc = " In the context of geography the center of the MIC is known as the"] - #[doc = " \"pole of inaccessibility\". A cartographic use case is to determine a suitable point"] - #[doc = " to place a map label within a polygon."] - #[doc = " The radius length of the MIC is a measure of how \"narrow\" a polygon is. It is the"] - #[doc = " distance at which the negative buffer becomes empty."] - #[doc = " The class supports polygons with holes and multipolygons."] - #[doc = " The implementation uses a successive-approximation technique over a grid of square cells covering the area geometry."] - #[doc = " The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant"] - #[doc = " way by using spatial indexes."] - #[doc = " Returns a two-point linestring, with one point at the center of the inscribed circle and the other"] - #[doc = " on the boundary of the inscribed circle."] - #[doc = " \\param g Input geometry"] - #[doc = " \\param tolerance Stop the algorithm when the search area is smaller than this tolerance"] - #[doc = " \\return A newly allocated geometry of the MIC. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::construct::MaximumInscribedCircle"] - pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Constructs the \"largest empty circle\" (LEC) for a set of obstacle geometries, up to a"] - #[doc = " specified tolerance. The obstacles are point and line geometries."] - #[doc = " The LEC is the largest circle which has its center in the convex hull of the"] - #[doc = " obstacles (the boundary), and whose interior does not intersect with any obstacle."] - #[doc = " The LEC center is the point in the interior of the boundary which has the farthest distance from"] - #[doc = " the obstacles (up to tolerance). The LEC is determined by the center point and a point lying on an"] - #[doc = " obstacle indicating the circle radius."] - #[doc = " The implementation uses a successive-approximation technique over a grid of square cells covering the obstacles and boundary."] - #[doc = " The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant"] - #[doc = " way by using spatial indexes."] - #[doc = " Returns a two-point linestring, with one point at the center of the inscribed circle and the other"] - #[doc = " on the boundary of the inscribed circle."] - #[doc = " \\param obstacles The geometries that the LEC must fit within without covering"] - #[doc = " \\param boundary The area within which the LEC must reside"] - #[doc = " \\param tolerance Stop the algorithm when the search area is smaller than this tolerance"] - #[doc = " \\return A newly allocated geometry of the LEC. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::construct::LargestEmptyCircle"] + pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSLargestEmptyCircle( obstacles: *const GEOSGeometry, boundary: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns a linestring geometry which represents the minimum diameter of the geometry."] - #[doc = " The minimum diameter is defined to be the width of the smallest band that"] - #[doc = " contains the geometry, where a band is a strip of the plane defined"] - #[doc = " by two parallel lines. This can be thought of as the smallest hole that the geometry"] - #[doc = " can be moved through, with a single rotation."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the LEC. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::MinimumDiameter"] pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Computes the minimum clearance of a geometry. The minimum clearance is the smallest amount by which"] - #[doc = " a vertex could be move to produce an invalid polygon, a non-simple linestring, or a multipoint with"] - #[doc = " repeated points. If a geometry has a minimum clearance of 'eps', it can be said that:"] - #[doc = ""] - #[doc = " - No two distinct vertices in the geometry are separated by less than 'eps'"] - #[doc = " - No vertex is closer than 'eps' to a line segment of which it is not an endpoint."] - #[doc = ""] - #[doc = " If the minimum clearance cannot be defined for a geometry (such as with a single point, or a multipoint"] - #[doc = " whose points are identical, a value of Infinity will be calculated."] - #[doc = ""] - #[doc = " \\param g the input geometry"] - #[doc = " \\param d a double to which the result can be stored"] - #[doc = " \\return 0 if no exception occurred."] - #[doc = " 2 if an exception occurred."] - #[doc = " \\see geos::precision::MinimumClearance"] pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Returns a LineString whose endpoints define the minimum clearance of a geometry."] - #[doc = " If the geometry has no minimum clearance, an empty LineString will be returned."] - #[doc = ""] - #[doc = " \\param g the input geometry"] - #[doc = " \\return a linestring geometry, or NULL if an exception occurred."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::precision::MinimumClearance"] pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Optimized union algorithm for polygonal inputs that are correctly"] - #[doc = " noded and do not overlap. It will generate an error (return NULL)"] - #[doc = " for inputs that do not satisfy this constraint."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A geometry that covers all the points of the input geometry."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns a point that is inside the boundary of a polygonal geometry."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A point that is inside the input"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::InteriorPointArea"] pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns a point at the center of mass of the input."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A point at the center of mass of the input"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::Centroid"] pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns a geometry which represents the \"minimum bounding circle\","] - #[doc = " the smallest circle that contains the input."] - #[doc = " \\param[in] g The input geometry"] - #[doc = " \\param[out] radius Pointer will be filled with output radius."] - #[doc = " \\param[out] center Pointer will be filled with output circle center. Caller must free."] - #[doc = " \\return The circle geometry or NULL on exception"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::MinimumBoundingCircle::getCircle"] pub fn GEOSMinimumBoundingCircle( g: *const GEOSGeometry, radius: *mut f64, @@ -2888,116 +1995,36 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " For linear inputs, returns a new geometry in which no lines cross"] - #[doc = " each other, and all touching occurs at end points."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return The noded geometry or NULL on exception"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::noding::GeometryNoder::node"] pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Intersection optimized for a rectangular clipping polygon."] - #[doc = " Supposed to be faster than using GEOSIntersection(). Not"] - #[doc = " guaranteed to return valid results."] - #[doc = " \\param g The input geometry to be clipped"] - #[doc = " \\param xmin Left bound of clipping rectangle"] - #[doc = " \\param ymin Lower bound of clipping rectangle"] - #[doc = " \\param xmax Right bound of clipping rectangle"] - #[doc = " \\param ymax Upper bound of clipping rectangle"] - #[doc = " \\return The clipped geometry or NULL on exception"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::intersection::RectangleIntersection"] pub fn GEOSClipByRect( g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Polygonizes a set of Geometries which contain linework that"] - #[doc = " represents the edges of a planar graph."] - #[doc = ""] - #[doc = " All types of Geometry are accepted as input; the constituent"] - #[doc = " linework is extracted as the edges to be polygonized."] - #[doc = ""] - #[doc = " The edges must be correctly noded; that is, they must only meet"] - #[doc = " at their endpoints. Polygonization will accept incorrectly noded"] - #[doc = " input but will not form polygons from non-noded edges, and reports"] - #[doc = " them as errors."] - #[doc = ""] - #[doc = " The Polygonizer reports the following kinds of errors:"] - #[doc = ""] - #[doc = " - Dangles - edges which have one or both ends which are"] - #[doc = " not incident on another edge endpoint"] - #[doc = " - Cut Edges - edges which are connected at both ends but"] - #[doc = " which do not form part of a polygon"] - #[doc = " - Invalid Ring Lines - edges which form rings which are invalid"] - #[doc = " (e.g. the component lines contain a self-intersection)"] - #[doc = ""] - #[doc = " Errors are reported to output parameters \"cuts\", \"dangles\" and"] - #[doc = " \"invalid\" (if not-null). Formed polygons are returned as a"] - #[doc = " collection. NULL is returned on exception. All returned"] - #[doc = " geometries must be destroyed by caller."] - #[doc = ""] - #[doc = " The GEOSPolygonize_valid() variant allows extracting only polygons"] - #[doc = " which form a valid polygonal result. The set of extracted polygons"] - #[doc = " is guaranteed to be edge-disjoint. This is useful when it is known"] - #[doc = " that the input lines form a valid polygonal geometry (which may"] - #[doc = " include holes or nested polygons)."] - #[doc = ""] - #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] - #[doc = " \\param ngeoms Size of the geoms array."] - #[doc = " \\return The polygonal output geometry."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::Polygonizer"] pub fn GEOSPolygonize( geoms: *const *const GEOSGeometry, ngeoms: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Same polygonizing behavior as GEOSPolygonize(), but only returning results"] - #[doc = " that are valid."] - #[doc = ""] - #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] - #[doc = " \\param ngeoms Size of the geoms array."] - #[doc = " \\return The polygonal output geometry."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::Polygonizer"] pub fn GEOSPolygonize_valid( geoms: *const *const GEOSGeometry, ngeoms: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Perform the polygonization as GEOSPolygonize() but return only the"] - #[doc = " \"cut edges\", the linear features that are connected at both ends,"] - #[doc = " do *not* participate in the final polygon."] - #[doc = ""] - #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] - #[doc = " \\param ngeoms Size of the geoms array."] - #[doc = " \\return The \"cut edges\""] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::Polygonizer"] pub fn GEOSPolygonizer_getCutEdges( geoms: *const *const GEOSGeometry, ngeoms: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Perform the polygonization as GEOSPolygonize() and return the"] - #[doc = " polygonal result as well as all extra ouputs."] - #[doc = ""] - #[doc = " \\param[in] input A single geometry with all the input lines to polygonize."] - #[doc = " \\param[out] cuts Pointer to hold \"cut edges\", connected on both ends but not part of output. Caller must free."] - #[doc = " \\param[out] dangles Pointer to hold \"dangles\", connected one end but not part of output. Caller must free."] - #[doc = " \\param[out] invalid Pointer to hold invalid outputs, polygons formed but not valid. Caller must free."] - #[doc = " \\return The polygonal valid output"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::Polygonizer"] pub fn GEOSPolygonize_full( input: *const GEOSGeometry, cuts: *mut *mut GEOSGeometry, @@ -3006,448 +2033,178 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Perform a polygonization using all the linework, assuming that"] - #[doc = " rings contained within rings are empty holes, rather then"] - #[doc = " extra polygons."] - #[doc = " \\param g The input linework"] - #[doc = " \\return The polygonal output"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::BuildArea"] pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Sews together a set of fully noded LineStrings"] - #[doc = " removing any cardinality 2 nodes in the linework."] - #[doc = " \\param g The input linework"] - #[doc = " \\return The merged linework"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::linemerge::LineMerger"] pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " For geometries with coordinate sequences, reverses the order"] - #[doc = " of the sequences. Converts CCW rings to CW. Reverses direction"] - #[doc = " of LineStrings."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return The reversed geometry"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Apply the"] - #[doc = " [Douglas/Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)"] - #[doc = " to the coordinate sequences of the input geometry."] - #[doc = " Removes \"unnecessary\" vertices, vertices"] - #[doc = " that are co-linear within the tolerance distance."] - #[doc = " \\param g The input geometry"] - #[doc = " \\param tolerance The tolerance to apply. Larger tolerance leads to simpler output."] - #[doc = " \\return The simplified geometry"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::simplify::DouglasPeuckerSimplifier"] - pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Apply the"] - #[doc = " [Douglas/Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)"] - #[doc = " to the coordinate sequences of the input geometry."] - #[doc = " Removes \"unnecessary\" vertices, vertices"] - #[doc = " that are co-linear within the tolerance distance."] - #[doc = " Returns a valid output geometry, checking for collapses, ring-intersections, etc"] - #[doc = " and attempting to avoid. More computationally expensive than GEOSSimplify()"] - #[doc = " \\param g The input geometry"] - #[doc = " \\param tolerance The tolerance to apply. Larger tolerance leads to simpler output."] - #[doc = " \\return The simplified geometry"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::simplify::DouglasPeuckerSimplifier"] + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSTopologyPreserveSimplify( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return all distinct vertices of input geometry as a MultiPoint."] - #[doc = " Note that only 2 dimensions of the vertices are considered when"] - #[doc = " testing for equality."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return The distinct points"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Find paths shared between the two given lineal geometries."] - #[doc = ""] - #[doc = " Returns a GeometryCollection having two elements:"] - #[doc = ""] - #[doc = " - first element is a MultiLineString containing shared paths"] - #[doc = " having the _same_ direction on both inputs"] - #[doc = " - second element is a MultiLineString containing shared paths"] - #[doc = " having the _opposite_ direction on the two inputs"] - #[doc = ""] - #[doc = " \\param g1 An input geometry"] - #[doc = " \\param g2 An input geometry"] - #[doc = " \\return The shared paths"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::sharedpaths::SharedPathsOp"] pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Snap first geometry onto second within the given tolerance."] - #[doc = " \\param input An input geometry"] - #[doc = " \\param snap_target A geometry to snap the input to"] - #[doc = " \\param tolerance Snapping tolerance"] - #[doc = " \\return The snapped verion of the input. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSSnap( input: *const GEOSGeometry, snap_target: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return a Delaunay triangulation of the vertices of the given geometry."] - #[doc = ""] - #[doc = " \\param g the input geometry whose vertices will be used as \"sites\""] - #[doc = " \\param tolerance optional snapping tolerance to use for improved robustness"] - #[doc = " \\param onlyEdges if non-zero will return a MultiLineString, otherwise it will"] - #[doc = " return a GeometryCollection containing triangular Polygons."] - #[doc = ""] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSDelaunayTriangulation( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return a constrained Delaunay triangulation of the vertices of the"] - #[doc = " given polygon(s)."] - #[doc = " For non-polygonal inputs, returns an empty geometry collection."] - #[doc = ""] - #[doc = " \\param g the input geometry whose rings will be used as input"] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSConstrainedDelaunayTriangulation(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the Voronoi polygons of the vertices of the given geometry."] - #[doc = ""] - #[doc = " \\param g the input geometry whose vertices will be used as sites."] - #[doc = " \\param tolerance snapping tolerance to use for improved robustness"] - #[doc = " \\param onlyEdges whether to return only edges of the voronoi cells"] - #[doc = " \\param env clipping envelope for the returned diagram, automatically"] - #[doc = " determined if env is NULL."] - #[doc = " The diagram will be clipped to the larger"] - #[doc = " of this envelope or an envelope surrounding the sites."] - #[doc = ""] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSVoronoiDiagram( g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Computes the coordinate where two line segments intersect, if any"] - #[doc = ""] - #[doc = " \\param[in] ax0 x-coordinate of 1st point in 1st segment"] - #[doc = " \\param[in] ay0 y-coordinate of 1st point in 1st segment"] - #[doc = " \\param[in] ax1 x-coordinate of 2nd point in 1st segment"] - #[doc = " \\param[in] ay1 y-coordinate of 2nd point in 1st segment"] - #[doc = " \\param[in] bx0 x-coordinate of 1st point in 2nd segment"] - #[doc = " \\param[in] by0 y-coordinate of 1st point in 2nd segment"] - #[doc = " \\param[in] bx1 x-coordinate of 2nd point in 2nd segment"] - #[doc = " \\param[in] by1 y-coordinate of 2nd point in 2nd segment"] - #[doc = " \\param[out] cx x-coordinate of intersection point"] - #[doc = " \\param[out] cy y-coordinate of intersection point"] - #[doc = ""] - #[doc = " \\return 0 on error, 1 on success, -1 if segments do not intersect"] pub fn GEOSSegmentIntersection( - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " True if no point of either geometry touchess or is within the other."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::disjoint"] pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries share boundaries at one or more points, but do"] - #[doc = " not have interior overlaps."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::touches"] pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries are not disjoint."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::intersects"] pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries interiors interact but their boundares do not."] - #[doc = " Most useful for finding line crosses cases."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::crosses"] pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometry g1 is completely within g2, and not"] - #[doc = " touching the boundary of g2."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::within"] pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometry g2 is completely within g1."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::contains"] pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries share interiors but are neither"] - #[doc = " within nor contained."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::overlaps"] pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries cover the same space on the place."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::equals"] pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometry g1 is completely within g2, including possibly"] - #[doc = " touching the boundary of g2."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::covers"] pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometry g2 is completely within g1, including possibly"] - #[doc = " touching the boundary of g1."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::coveredby"] pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Determine pointwise equivalence of two geometries, by checking if each vertex of g2 is"] - #[doc = " within tolerance of the corresponding vertex in g1."] - #[doc = " Unlike GEOSEquals(), geometries that are topologically equivalent but have different"] - #[doc = " representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not"] - #[doc = " considered equivalent by GEOSEqualsExact()."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\param tolerance Tolerance to determine vertex equality"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] pub fn GEOSEqualsExact( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " A \\ref GEOSPreparedGeometry is a wrapper around \\ref GEOSGeometry"] - #[doc = " that adds in a spatial index on the edges of the geometry. This"] - #[doc = " internal index allows spatial predicates to evaluate much faster,"] - #[doc = " so for cases in which the same base geometry will be used over and"] - #[doc = " over again for predicate tests, wrapping it in a \\ref GEOSPreparedGeometry"] - #[doc = " is a best practice."] - #[doc = ""] - #[doc = " The caller retains ownership of the base geometry, and after"] - #[doc = " processing is complete, must destroy **both** the prepared and the"] - #[doc = " base geometry. (Ideally, destroy the prepared geometry first, as"] - #[doc = " it has an internal reference to the base geometry.)"] - #[doc = ""] - #[doc = " \\param g The base geometry to wrap in a prepared geometry."] - #[doc = " \\return A prepared geometry. Caller is responsible for freeing with"] - #[doc = " GEOSPreparedGeom_destroy()"] pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSPreparedGeometry."] - #[doc = " Caller must separately free the base \\ref GEOSGeometry used"] - #[doc = " to create the prepared geometry."] - #[doc = " \\param g Prepared geometry to destroy."] pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry is contained."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSContains"] pub fn GEOSPreparedContains( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry is contained properly."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSContainsProperly"] pub fn GEOSPreparedContainsProperly( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry is covered by."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSCoveredBy"] pub fn GEOSPreparedCoveredBy( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry covers."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSCovers"] pub fn GEOSPreparedCovers( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry crosses."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSCrosses"] pub fn GEOSPreparedCrosses( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry is disjoint."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSDisjoin"] pub fn GEOSPreparedDisjoint( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry is disjoint."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSDisjoin"] pub fn GEOSPreparedIntersects( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry overlaps."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSOverlaps"] pub fn GEOSPreparedOverlaps( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry touches."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSTouches"] pub fn GEOSPreparedTouches( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry is within."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSWithin"] pub fn GEOSPreparedWithin( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation to find the nearest points between the"] - #[doc = " prepared and provided geometry."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns A coordinate sequence containing the nearest points, or NULL on exception."] - #[doc = " The first point in the sequence is from the prepared geometry, and the"] - #[doc = " seconds is from the other argument."] pub fn GEOSPreparedNearestPoints( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDistance do a high performance"] - #[doc = " calculation to find the distance points between the"] - #[doc = " prepared and provided geometry. Useful for situations where"] - #[doc = " one geometry is large and static and needs to be tested"] - #[doc = " against a large number of other geometries."] - #[doc = " \\param[in] pg1 The prepared geometry"] - #[doc = " \\param[in] g2 The geometry to test"] - #[doc = " \\param[out] dist Pointer to store the result in"] - #[doc = " \\return 1 on success"] pub fn GEOSPreparedDistance( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, @@ -3455,42 +2212,16 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDistanceWithin do a high performance"] - #[doc = " calculation to find whether the prepared and provided geometry"] - #[doc = " are within the given max distance."] - #[doc = " Useful for situations where"] - #[doc = " one geometry is large and static and needs to be tested"] - #[doc = " against a large number of other geometries."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\param dist The max distance"] - #[doc = " \\return 1 on success"] pub fn GEOSPreparedDistanceWithin( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: f64, + dist: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " Create a new \\ref GEOSSTRtree using the Sort-Tile-Recursive algorithm"] - #[doc = " ([STRtree](https://en.wikipedia.org/wiki/R-tree))"] - #[doc = " for two-dimensional spatial data."] - #[doc = ""] - #[doc = " \\param nodeCapacity The maximum number of child nodes that a node may have."] - #[doc = " The minimum recommended capacity value is 4."] - #[doc = " If unsure, use a default node capacity of 10."] - #[doc = " \\return a pointer to the created tree"] pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; } extern "C" { - #[doc = " Insert an item into an \\ref GEOSSTRtree"] - #[doc = ""] - #[doc = " \\param tree the \\ref GEOSSTRtree in which the item should be inserted"] - #[doc = " \\param g a GEOSGeometry whose envelope corresponds to the extent of 'item'. As of GEOS 3.9, this envelope will be"] - #[doc = " copied into the tree and the caller may destroy `g` while the tree is still in use. Before GEOS 3.9, `g`"] - #[doc = " must be retained until the tree is destroyed."] - #[doc = " \\param item the item to insert into the tree"] - #[doc = " \\note The tree does **not** take ownership of the geometry or the item."] pub fn GEOSSTRtree_insert( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, @@ -3498,14 +2229,6 @@ extern "C" { ); } extern "C" { - #[doc = " Query an \\ref GEOSSTRtree for items intersecting a specified envelope"] - #[doc = ""] - #[doc = " \\param tree the \\ref GEOSSTRtree to search"] - #[doc = " \\param g a GEOSGeomety from which a query envelope will be extracted"] - #[doc = " \\param callback a function to be executed for each item in the tree whose envelope intersects"] - #[doc = " the envelope of 'g'. The callback function should take two parameters: a void"] - #[doc = " pointer representing the located item in the tree, and a void userdata pointer."] - #[doc = " \\param userdata an optional pointer to pe passed to 'callback' as an argument"] pub fn GEOSSTRtree_query( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, @@ -3514,34 +2237,12 @@ extern "C" { ); } extern "C" { - #[doc = " Returns the nearest item in the \\ref GEOSSTRtree to the supplied geometry."] - #[doc = " All items in the tree MUST be of type \\ref GEOSGeometry."] - #[doc = " If this is not the case, use GEOSSTRtree_nearest_generic() instead."] - #[doc = ""] - #[doc = " \\param tree the \\ref GEOSSTRtree to search"] - #[doc = " \\param geom the geometry with which the tree should be queried"] - #[doc = " \\return a const pointer to the nearest \\ref GEOSGeometry in the tree to 'geom', or NULL in"] - #[doc = " case of exception"] pub fn GEOSSTRtree_nearest( tree: *mut GEOSSTRtree, geom: *const GEOSGeometry, ) -> *const GEOSGeometry; } extern "C" { - #[doc = " Returns the nearest item in the \\ref GEOSSTRtree to the supplied item"] - #[doc = ""] - #[doc = " \\param tree the STRtree to search"] - #[doc = " \\param item the item with which the tree should be queried"] - #[doc = " \\param itemEnvelope a GEOSGeometry having the bounding box of 'item'"] - #[doc = " \\param distancefn a function that can compute the distance between two items"] - #[doc = " in the STRtree. The function should return zero in case of error,"] - #[doc = " and should store the computed distance to the location pointed to by"] - #[doc = " the 'distance' argument. The computed distance between two items"] - #[doc = " must not exceed the Cartesian distance between their envelopes."] - #[doc = " \\param userdata optional pointer to arbitrary data; will be passed to distancefn"] - #[doc = " each time it is called."] - #[doc = " \\return a const pointer to the nearest item in the tree to 'item', or NULL in"] - #[doc = " case of exception"] pub fn GEOSSTRtree_nearest_generic( tree: *mut GEOSSTRtree, item: *const libc::c_void, @@ -3551,11 +2252,6 @@ extern "C" { ) -> *const libc::c_void; } extern "C" { - #[doc = " Iterate over all items in the \\ref GEOSSTRtree."] - #[doc = ""] - #[doc = " \\param tree the STRtree over which to iterate"] - #[doc = " \\param callback a function to be executed for each item in the tree."] - #[doc = " \\param userdata payload to pass the callback function."] pub fn GEOSSTRtree_iterate( tree: *mut GEOSSTRtree, callback: GEOSQueryCallback, @@ -3563,14 +2259,6 @@ extern "C" { ); } extern "C" { - #[doc = " Removes an item from the \\ref GEOSSTRtree"] - #[doc = ""] - #[doc = " \\param tree the STRtree from which to remove an item"] - #[doc = " \\param g the envelope of the item to remove"] - #[doc = " \\param item the item to remove"] - #[doc = " \\return 0 if the item was not removed;"] - #[doc = " 1 if the item was removed;"] - #[doc = " 2 if an exception occurred"] pub fn GEOSSTRtree_remove( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, @@ -3578,60 +2266,24 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Frees all the memory associated with a \\ref GEOSSTRtree."] - #[doc = " Only the tree is freed. The geometries and items fed into"] - #[doc = " GEOSSTRtree_insert() are not owned by the tree, and are"] - #[doc = " still left to the caller to manage."] pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " Tests whether the input geometry is empty. If the geometry or any"] - #[doc = " component is non-empty, the geometry is non-empty. An empty geometry"] - #[doc = " has no boundary or interior."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Tests whether the input geometry is \"simple\". Mostly relevant for"] - #[doc = " linestrings. A \"simple\" linestring has no self-intersections."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Tests whether the input geometry is a ring. Rings are"] - #[doc = " linestrings, without self-intersections,"] - #[doc = " with start and end point being identical."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Tests whether the input geometry has z coordinates."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Tests whether the input geometry is closed."] - #[doc = " A closed geometry is a linestring or multilinestring"] - #[doc = " with the start and end points being the same."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Calculate the DE9IM pattern for this geometry pair"] - #[doc = " and compare against the provided pattern to check for"] - #[doc = " consistency. If the result and pattern are consistent"] - #[doc = " return true. The pattern may include glob \"*\" characters"] - #[doc = " for portions that are allowed to match any value."] - #[doc = " \\see geos::geom::Geometry::relate"] - #[doc = " \\param g1 First geometry in pair"] - #[doc = " \\param g2 Second geometry in pair"] - #[doc = " \\param pat DE9IM pattern to check"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSRelatePattern( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -3639,35 +2291,15 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Calculate and return the DE9IM pattern for this geometry pair."] - #[doc = " \\see geos::geom::Geometry::relate"] - #[doc = " \\param g1 First geometry in pair"] - #[doc = " \\param g2 Second geometry in pair"] - #[doc = " \\return DE9IM string. Caller is responsible for freeing with GEOSFree()."] - #[doc = " NULL on exception"] pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { - #[doc = " Compare two DE9IM patterns and return true if they"] - #[doc = " are consistent."] - #[doc = " \\param mat Complete DE9IM string (does not have \"*\")"] - #[doc = " \\param pat Pattern to match to (may contain \"*\")"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSRelatePatternMatch( mat: *const libc::c_char, pat: *const libc::c_char, ) -> libc::c_char; } extern "C" { - #[doc = " Calculate and return the DE9IM pattern for this geometry pair."] - #[doc = " Apply the supplied \\ref GEOSRelateBoundaryNodeRules."] - #[doc = " \\see geos::geom::Geometry::relate"] - #[doc = " \\see geos::algorithm::BoundaryNodeRule"] - #[doc = " \\param g1 First geometry in pair"] - #[doc = " \\param g2 Second geometry in pair"] - #[doc = " \\param bnr A member of the \\ref GEOSRelateBoundaryNodeRules enum"] - #[doc = " \\return DE9IM string. Caller is responsible for freeing with GEOSFree()."] - #[doc = " NULL on exception"] pub fn GEOSRelateBoundaryNodeRule( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -3675,37 +2307,12 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " Check the validity of the provided geometry."] - #[doc = " - All points are valid."] - #[doc = " - All non-zero-length linestrings are valid."] - #[doc = " - Polygon rings must be non-self-intersecting, and interior rings"] - #[doc = " contained within exterior rings."] - #[doc = " - Multi-polygon components may not touch or overlap."] - #[doc = ""] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::operation::valid::isValidOp"] pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Return the human readable reason a geometry is invalid,"] - #[doc = " \"Valid Geometry\" string otherwise, or NULL on exception."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return A string with the reason, NULL on exception."] - #[doc = "Caller must GEOSFree() their result."] pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { - #[doc = " In one step, calculate and return the validity, the"] - #[doc = " human readable validity reason and a point at which validity"] - #[doc = " rules are broken."] - #[doc = " Caller has the responsibility to destroy 'reason' with GEOSFree()"] - #[doc = " and 'location' with GEOSGeom_destroy()"] - #[doc = " \\param g The geometry to test"] - #[doc = " \\param flags A value from the \\ref GEOSValidFlags enum"] - #[doc = " \\param reason A pointer in which the reason string will be places"] - #[doc = " \\param location A pointer in which the location GEOSGeometry will be placed"] - #[doc = " \\return 1 when valid, 0 when invalid, 2 on exception"] pub fn GEOSisValidDetail( g: *const GEOSGeometry, flags: libc::c_int, @@ -3714,346 +2321,130 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Repair an invalid geometry, returning a valid output."] - #[doc = " \\param g The geometry to repair"] - #[doc = " \\return The repaired geometry. Caller must free with GEOSGeom_destroy()."] pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Repair an invalid geometry, returning a valid output, using the"] - #[doc = " indicated GEOSMakeValidMethods algorithm and options."] - #[doc = " \\param g is the geometry to test."] - #[doc = " \\param makeValidParams is a GEOSMakeValidParams with the desired parameters set on it."] - #[doc = " \\return A repaired geometry. Caller must free with GEOSGeom_destroy()."] - #[doc = " \\see GEOSMakeValidParams_create"] - #[doc = " \\see GEOSMakeValidParams_destroy"] - #[doc = " \\see GEOSMakeValidParams_setMethod"] - #[doc = " \\see GEOSMakeValidParams_setKeepCollapsed"] pub fn GEOSMakeValidWithParams( g: *const GEOSGeometry, makeValidParams: *const GEOSMakeValidParams, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a GEOSMakeValidParams to hold the desired parameters"] - #[doc = " to control the algorithm and behavior of the validation process."] - #[doc = " \\return a parameter object"] - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidParams_create() -> *mut GEOSMakeValidParams; } extern "C" { - #[doc = " Destroy a GEOSMakeValidParams."] - #[doc = " \\param parms the object to destroy"] - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidParams_destroy(parms: *mut GEOSMakeValidParams); } extern "C" { - #[doc = " Set the GEOSMakeValidMethods to use in making the geometry"] - #[doc = " valid."] - #[doc = " \\return 0 on exception, 1 on success."] - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidParams_setMethod( p: *mut GEOSMakeValidParams, method: GEOSMakeValidMethods, ) -> libc::c_int; } extern "C" { - #[doc = " When this parameter is not set to 0, the GEOS_MAKE_VALID_STRUCTURE method will drop"] - #[doc = " any component that has collapsed into a lower dimensionality."] - #[doc = " For example, a ring collapsing to a line, or a line collapsing"] - #[doc = " to a point."] - #[doc = " \\return 0 on exception, 1 on success."] - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidParams_setKeepCollapsed( p: *mut GEOSMakeValidParams, keepCollapsed: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Returns the geometry type string for this geometry."] - #[doc = " eg: \"GeometryCollection\", \"LineString\""] - #[doc = " \\param g Input geometry"] - #[doc = " \\return A string with the geometry type."] - #[doc = " Caller must free with GEOSFree()."] - #[doc = " NULL on exception."] pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { - #[doc = " Returns the \\ref GEOSGeomTypeId number for this geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return The geometry type number, or -1 on exception."] pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Returns the \"spatial reference id\" (SRID) for this geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return SRID number or 0 if unknown / not set."] pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Set the \"spatial reference id\" (SRID) for this geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\param SRID SRID number or 0 for unknown SRID."] pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); } extern "C" { - #[doc = " Return the anonymous \"user data\" for this geometry."] - #[doc = " User data must be managed by the caller, and freed before"] - #[doc = " the geometry is freed."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return A void* to the user data, caller is responsible for"] - #[doc = " casting to the appropriate type and freeing."] pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; } extern "C" { - #[doc = " Set the anonymous \"user data\" for this geometry."] - #[doc = " Don't forget to free the user data before freeing the geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\param userData Void pointer to user data"] pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); } extern "C" { - #[doc = " Returns the number of sub-geometries immediately under a"] - #[doc = " multi-geometry or collection or 1 for a simple geometry."] - #[doc = " For nested collections, remember to check if returned"] - #[doc = " sub-geometries are **themselves** also collections."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return Number of direct children in this collection"] - #[doc = " \\warning For GEOS < 3.2 this function may crash when fed simple geometries"] pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Returns the specified sub-geometry of a collection. For"] - #[doc = " a simple geometry, returns a pointer to the input."] - #[doc = " Returned object is a pointer to internal storage:"] - #[doc = " it must NOT be destroyed directly."] - #[doc = " \\param g Input geometry"] - #[doc = " \\param n Sub-geometry index, zero-base"] - #[doc = " \\return A const \\ref GEOSGeometry, do not free!"] - #[doc = "It will be freed when the parent is freed."] - #[doc = "Returns NULL on exception."] - #[doc = " \\note Up to GEOS 3.2.0 the input geometry must be a Collection, in"] - #[doc = " later versions it doesn't matter (getGeometryN(0) for a single will"] - #[doc = " return the input)."] pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; } extern "C" { - #[doc = " Organize the sub-geometries, rings, and coordinate order"] - #[doc = " of geometries, so that geometries that represent the same"] - #[doc = " object can be easily compared. Starts rings from the same"] - #[doc = " location, orients them in the same way, sorts geometry"] - #[doc = " sub-components in the same way. Use before calling"] - #[doc = " GEOSEqualsExact() to avoid false \"not equal\" results."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return 0 on success or -1 on exception"] pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Change the rounding precision on a geometry. This will"] - #[doc = " affect the precision of the existing geometry as well as"] - #[doc = " any geometries derived from this geometry using overlay"] - #[doc = " functions. The output will be a valid \\ref GEOSGeometry."] - #[doc = ""] - #[doc = " Note that operations will always be performed in the precision"] - #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] - #[doc = " That same precision will be attached to the operation outputs."] - #[doc = ""] - #[doc = " In the Default and GEOS_PREC_KEEP_COLLAPSED modes invalid input"] - #[doc = " may cause an error to occur, unless the invalidity is below"] - #[doc = " the scale of the requested precision"] - #[doc = ""] - #[doc = " There are only 3 modes. The GEOS_PREC_NO_TOPO mode"] - #[doc = " takes precedence over GEOS_PREC_KEEP_COLLAPSED."] - #[doc = " So the combination GEOS_PREC_NO_TOPO || GEOS_PREC_KEEP_COLLAPSED"] - #[doc = " has the same semantics as GEOS_PREC_NO_TOPO"] - #[doc = ""] - #[doc = " \\param g Input geometry"] - #[doc = " \\param gridSize cell size of grid to round coordinates to,"] - #[doc = " or 0 for FLOATING precision"] - #[doc = " \\param flags The bitwise OR of members of the \\ref GEOSPrecisionRules enum"] - #[doc = " \\return The precision reduced result."] - #[doc = " Caller must free with GEOSGeom_destroy()"] - #[doc = " NULL on exception."] pub fn GEOSGeom_setPrecision( g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Read the currently set precision value from the"] - #[doc = " geometry and returns the grid size if it is a fixed"] - #[doc = " precision or 0.0 if it is full floating point precision."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return The grid size, or -1 on exception"] pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; } extern "C" { - #[doc = " Returns the number of interior rings, for a Polygon input, or"] - #[doc = " an exception otherwise."] - #[doc = " \\param g Input Polygon geometry"] - #[doc = " \\return Number of interior rings, -1 on exception"] pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Returns the number of points, for a LineString input, or"] - #[doc = " an exception otherwise."] - #[doc = " \\param g Input LineString geometry"] - #[doc = " \\return Number of points, -1 on exception"] pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Returns the X coordinate, for a Point input, or an"] - #[doc = " exception otherwise."] - #[doc = " \\param[in] g Input Point geometry"] - #[doc = " \\param[out] x Pointer to hold return value"] - #[doc = " \\returns 1 on success, 0 on exception"] pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Returns the Y coordinate, for a Point input, or an"] - #[doc = " exception otherwise."] - #[doc = " \\param[in] g Input Point geometry"] - #[doc = " \\param[out] y Pointer to hold return value"] - #[doc = " \\returns 1 on success, 0 on exception"] pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Returns the Z coordinate, for a Point input, or an"] - #[doc = " exception otherwise."] - #[doc = " \\param[in] g Input Point geometry"] - #[doc = " \\param[out] z Pointer to hold return value"] - #[doc = " \\returns 1 on success, 0 on exception"] pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Returns the N'th ring for a Polygon input."] - #[doc = " \\note Returned object is a pointer to internal storage:"] - #[doc = " it must NOT be destroyed directly."] - #[doc = " \\param g Input Polygon geometry"] - #[doc = " \\param n Index of the desired ring"] - #[doc = " \\return LinearRing geometry. Owned by parent geometry, do not free. NULL on exception."] pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; } extern "C" { - #[doc = " Get the external ring of a Polygon."] - #[doc = " \\note Returned object is a pointer to internal storage:"] - #[doc = " it must NOT be destroyed directly."] - #[doc = " \\param g Input Polygon geometry"] - #[doc = " \\return LinearRing geometry. Owned by parent geometry, do not free. NULL on exception."] pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; } extern "C" { - #[doc = " Get the total number of points in a geometry,"] - #[doc = " of any type."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return Number of points in the geometry. -1 on exception."] pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Return the coordinate sequence underlying the"] - #[doc = " given geometry (Must be a LineString, LinearRing or Point)."] - #[doc = " Do not directly free the coordinate sequence, it is owned by"] - #[doc = " the parent geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return Coordinate sequence or NULL on exception."] pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; } extern "C" { - #[doc = " Return the planar dimensionality of the geometry."] - #[doc = ""] - #[doc = " - 0 for point, multipoint"] - #[doc = " - 1 for linestring, multilinestring"] - #[doc = " - 2 for polygon, multipolygon"] - #[doc = ""] - #[doc = " \\see geos::geom::Dimension::DimensionType"] - #[doc = " \\param g Input geometry"] - #[doc = " \\return The dimensionality"] pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Return the cartesian dimension of the geometry."] - #[doc = ""] - #[doc = " - 2 for XY data"] - #[doc = " - 3 for XYZ data"] - #[doc = ""] - #[doc = " \\param g Input geometry"] - #[doc = " \\return The dimension"] pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Finds the minimum X value in the geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] value Pointer to place result"] - #[doc = " \\return 0 on exception"] pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Finds the minimum Y value in the geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] value Pointer to place result"] - #[doc = " \\return 0 on exception"] pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Finds the maximum X value in the geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] value Pointer to place result"] - #[doc = " \\return 0 on exception"] pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Finds the maximum Y value in the geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] value Pointer to place result"] - #[doc = " \\return 0 on exception"] pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Return the N'th point of a LineString"] - #[doc = " \\param g Input geometry, must be a LineString"] - #[doc = " \\param n Index of desired point (zero based)"] - #[doc = " \\return A Point geometry."] - #[doc = " Caller must free with GEOSGeom_destroy()"] - #[doc = " NULL on exception."] pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return the first point of a LineString"] - #[doc = " \\param g Input geometry, must be a LineString"] - #[doc = " \\return A Point geometry."] - #[doc = " Caller must free with GEOSGeom_destroy()"] - #[doc = " NULL on exception."] pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return the last point of a LineString"] - #[doc = " \\param g Input geometry, must be a LineString"] - #[doc = " \\return A Point geometry."] - #[doc = " Caller must free with GEOSGeom_destroy()"] - #[doc = " NULL on exception."] pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Calculate the area of a geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] area Pointer to be filled in with area result"] - #[doc = " \\return 1 on success, 0 on exception."] pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Calculate the length of a geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] length Pointer to be filled in with length result"] - #[doc = " \\return 1 on success, 0 on exception."] pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Calculate the distance between two geometries."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -4061,28 +2452,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Test whether the distance between two geometries is"] - #[doc = " within the given dist."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\param dist The max distance"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] pub fn GEOSDistanceWithin( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: f64, + dist: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " Calculate the distance between two geometries, using the"] - #[doc = " indexed facet distance, which first indexes the geometries"] - #[doc = " internally, then calculates the distance. Useful when one"] - #[doc = " or both geometries is very large."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::operation::distance:;IndexedFacetDistance"] pub fn GEOSDistanceIndexed( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -4090,14 +2466,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Calculate the Hausdorff distance between two geometries."] - #[doc = " [Hausdorff distance](https://en.wikipedia.org/wiki/Hausdorff_distance)"] - #[doc = " is the largest distance between two geometries."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::algorithm::distance::DiscreteHausdorffDistance"] pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -4105,34 +2473,14 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Calculate a more precise Hausdorff distance between two geometries,"] - #[doc = " by densifying the inputs before computation."] - #[doc = " [Hausdorff distance](https://en.wikipedia.org/wiki/Hausdorff_distance)"] - #[doc = " is the largest distance between two geometries."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[in] densifyFrac The largest % of the overall line length that"] - #[doc = " any given two-point segment should be"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::algorithm::distance::DiscreteHausdorffDistance"] pub fn GEOSHausdorffDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Calculate the"] - #[doc = " [Frechet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance)"] - #[doc = " between two geometries,"] - #[doc = " a similarity measure for linear features."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::algorithm::distance::DiscreteFrechetDistance"] pub fn GEOSFrechetDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -4140,164 +2488,78 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Calculate the"] - #[doc = " [Frechet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance)"] - #[doc = " between two geometries,"] - #[doc = " a similarity measure for linear features. For more precision, first"] - #[doc = " densify the inputs."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[in] densifyFrac The largest % of the overall line length that"] - #[doc = " any given two-point segment should be"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::algorithm::distance::DiscreteFrechetDistance"] pub fn GEOSFrechetDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Calculate the length of a LineString."] - #[doc = " Only works for LineString inputs, returns exception otherwise."] - #[doc = ""] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] length Pointer to be filled in with length result"] - #[doc = " \\return 1 on success, 0 on exception."] pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " The closest points of the two geometries."] - #[doc = " The first point comes from g1 geometry and the second point comes from g2."] - #[doc = ""] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\return A coordinate sequence with the two points, or NULL on exception."] - #[doc = " Caller must free with GEOSCoordSeq_destroy()."] pub fn GEOSNearestPoints( g1: *const GEOSGeometry, g2: *const GEOSGeometry, ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " For the points formed by the six input ordinates,"] - #[doc = " walking from A to B and then to P."] - #[doc = " \\param Ax X coordinate of A"] - #[doc = " \\param Ay Y coordinate of A"] - #[doc = " \\param Bx X coordinate of B"] - #[doc = " \\param By Y coordinate of B"] - #[doc = " \\param Px X coordinate of P"] - #[doc = " \\param Py Y coordinate of P"] - #[doc = " \\return -1 if reaching P takes a counter-clockwise (left) turn,"] - #[doc = " 1 if reaching P takes a clockwise (right) turn,"] - #[doc = " 0 if P is collinear with A-B"] pub fn GEOSOrientationIndex( - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Allocate a new \\ref GEOSWKTReader."] - #[doc = " \\returns a new reader. Caller must free with GEOSWKTReader_destroy()"] pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSWKTReader."] - #[doc = " \\param reader The reader to destroy."] pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); } extern "C" { - #[doc = " Use a reader to parse the well-known text representation of"] - #[doc = " a geometry, and return an allocated geometry."] - #[doc = " \\param reader A WKT reader object, caller retains ownership"] - #[doc = " \\param wkt The WKT string to parse, caller retains ownership"] - #[doc = " \\return A \\ref GEOSGeometry, caller to free with GEOSGeom_destroy())"] pub fn GEOSWKTReader_read( reader: *mut GEOSWKTReader, wkt: *const libc::c_char, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Allocate a new \\ref GEOSWKTWriter."] - #[doc = " \\returns a new writer. Caller must free with GEOSWKTWriter_destroy()"] pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSWKTWriter."] - #[doc = " \\param writer The writer to destroy."] pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); } extern "C" { - #[doc = " Writes out the well-known text representation of a geometry,"] - #[doc = " using the trim, rounding and dimension settings of the writer."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return A newly allocated string containing the WKT output or NULL on exception."] - #[doc = " Caller must free with GEOSFree()"] pub fn GEOSWKTWriter_write( writer: *mut GEOSWKTWriter, g: *const GEOSGeometry, ) -> *mut libc::c_char; } extern "C" { - #[doc = " Sets the number trimming option on a \\ref GEOSWKTWriter."] - #[doc = " With trim set to 1, the writer will strip trailing 0's from"] - #[doc = " the output coordinates. With 0, all coordinates will be"] - #[doc = " padded with 0's out to the rounding precision."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param trim The trimming behaviour to set, 1 for 'on', 0 for 'off', default 'off'"] pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); } extern "C" { - #[doc = " Sets the number places after the decimal to output in"] - #[doc = " WKT."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param precision The desired precision, default 16."] pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); } extern "C" { - #[doc = " Sets whether or not to write out XY or XYZ coordinates."] - #[doc = " Legal values are 2 or 3."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param dim The desired dimension, default 2."] pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); } extern "C" { - #[doc = " Reads the current output dimension from a \\ref GEOSWKTWriter."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\return The current dimension."] pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; } extern "C" { - #[doc = " Sets the format for 3D outputs. The \"old 3D\" format does not"] - #[doc = " include a dimensionality tag, eg. \"POINT(1 2 3)\" while the new (ISO)"] - #[doc = " format does includes a tag, eg \"POINT Z (1 2 3)\"."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param useOld3D True to use the old format, false is the default."] pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); } extern "C" { - #[doc = " Allocate a new \\ref GEOSWKBReader."] - #[doc = " \\returns a new reader. Caller must free with GEOSWKBReader_destroy()"] pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSWKBReader."] - #[doc = " \\param reader The reader to destroy."] pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); } extern "C" { - #[doc = " Read a geometry from a well-known binary buffer."] - #[doc = " \\param reader A \\ref GEOSWKBReader"] - #[doc = " \\param wkb A pointer to the buffer to read from"] - #[doc = " \\param size The number of bytes of data in the buffer"] - #[doc = " \\return A \\ref GEOSGeometry built from the WKB, or NULL on exception."] pub fn GEOSWKBReader_read( reader: *mut GEOSWKBReader, wkb: *const libc::c_uchar, @@ -4305,11 +2567,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Read a geometry from a **hex encoded** well-known binary buffer."] - #[doc = " \\param reader A \\ref GEOSWKBReader"] - #[doc = " \\param hex A pointer to the buffer to read from"] - #[doc = " \\param size The number of bytes of data in the buffer"] - #[doc = " \\return A \\ref GEOSGeometry built from the HEX WKB, or NULL on exception."] pub fn GEOSWKBReader_readHEX( reader: *mut GEOSWKBReader, hex: *const libc::c_uchar, @@ -4317,22 +2574,12 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Allocate a new \\ref GEOSWKBWriter."] - #[doc = " \\returns a new writer. Caller must free with GEOSWKBWriter_destroy()"] pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSWKBWriter."] - #[doc = " \\param writer The writer to destroy."] pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); } extern "C" { - #[doc = " Write out the WKB representation of a geometry."] - #[doc = " \\param writer The \\ref GEOSWKBWriter controlling the"] - #[doc = " writing."] - #[doc = " \\param g Geometry to convert to WKB"] - #[doc = " \\param size Pointer to write the size of the final output WKB to"] - #[doc = " \\return The WKB representation. Caller must free with GEOSFree()"] pub fn GEOSWKBWriter_write( writer: *mut GEOSWKBWriter, g: *const GEOSGeometry, @@ -4340,12 +2587,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Write out the **hex** WKB representation of a geometry."] - #[doc = " \\param writer The \\ref GEOSWKBWriter controlling the"] - #[doc = " writing."] - #[doc = " \\param g Geometry to convert to WKB"] - #[doc = " \\param size Pointer to write the size of the final output WKB to"] - #[doc = " \\return The HEX WKB representation. Caller must free with GEOSFree()"] pub fn GEOSWKBWriter_writeHEX( writer: *mut GEOSWKBWriter, g: *const GEOSGeometry, @@ -4353,114 +2594,51 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Read the current output dimension of the writer."] - #[doc = " Either 2 or 3 dimensions."] - #[doc = " Return current number of dimensions."] - #[doc = " \\param writer The writer to read from."] - #[doc = " \\return Number of dimensions (2 or 3)"] pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; } extern "C" { - #[doc = " Set the output dimensionality of the writer. Either"] - #[doc = " 2 or 3 dimensions."] - #[doc = " \\param writer The writer to read from."] - #[doc = " \\param newDimension The dimensionality desired"] pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); } extern "C" { - #[doc = " Find whether the writer will use WKB"] - #[doc = " [byte order](https://en.wikipedia.org/wiki/Endianness)"] - #[doc = " that is big or little endian."] - #[doc = " The return value is a member of \\ref GEOSWKBByteOrders."] - #[doc = " \\param writer The writer to read byte order from"] - #[doc = " \\return The current byte order"] pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; } extern "C" { - #[doc = " Set the output byte order of the writer, using"] - #[doc = " a value from \\ref GEOSWKBByteOrders enum."] - #[doc = " \\param writer The writer to set byte order on"] - #[doc = " \\param byteOrder Desired byte order"] pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); } extern "C" { - #[doc = " Find whether the writer will use"] - #[doc = " [WKB](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary)"] - #[doc = " that is ISO flavor or \"extended\" flavor. The flavor"] - #[doc = " determines how extra dimensionality is encoded with the"] - #[doc = " type number, and whether SRID can be included in the WKB."] - #[doc = " ISO flavor does not support SRID embedding. ISO flavor"] - #[doc = " is \"more standard\" for 3D output. GEOS can read both flavors."] - #[doc = " The return value is a member of \\ref GEOSWKBFlavors."] - #[doc = " \\param writer The writer to read flavor from"] - #[doc = " \\return The current flavor"] pub fn GEOSWKBWriter_getFlavor(writer: *const GEOSWKBWriter) -> libc::c_int; } extern "C" { - #[doc = " Set the output flavor of the writer, using"] - #[doc = " a value from \\ref GEOSWKBFlavors enum."] - #[doc = " \\param writer The writer to set flavor on"] - #[doc = " \\param flavor Desired flavor"] pub fn GEOSWKBWriter_setFlavor(writer: *mut GEOSWKBWriter, flavor: libc::c_int); } extern "C" { - #[doc = " Read the current SRID embedding value from the writer."] - #[doc = " \\param writer The writer to check SRID value on"] pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; } extern "C" { - #[doc = " Specify whether SRID values should be output in WKB."] - #[doc = " Many WKB readers do not support SRID values, use with caution."] - #[doc = " \\param writer The writer to set SRID output on"] - #[doc = " \\param writeSRID Set to 1 to include SRID, 0 otherwise"] pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); } extern "C" { - #[doc = " Free strings and byte buffers returned by functions such"] - #[doc = " as GEOSWKBWriter_write(),"] - #[doc = " GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(), etc."] - #[doc = " \\param buffer The memory to free"] pub fn GEOSFree(buffer: *mut libc::c_void); } extern "C" { - #[doc = " Allocate a new \\ref GEOSGeoJSONReader."] - #[doc = " \\returns a new reader. Caller must free with GEOSGeoJSONReader_destroy()"] pub fn GEOSGeoJSONReader_create() -> *mut GEOSGeoJSONReader; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSGeoJSONReader."] - #[doc = " \\param reader The reader to destroy."] pub fn GEOSGeoJSONReader_destroy(reader: *mut GEOSGeoJSONReader); } extern "C" { - #[doc = " Use a reader to parse a GeoJSON. A single geometry or feature is"] - #[doc = " converted into a geometry. A featurecollection is converted into a"] - #[doc = " geometrycollection. Feature properties are not read."] - #[doc = " \\param reader A GeoJSON reader object, caller retains ownership"] - #[doc = " \\param geojson The json string to parse, caller retains ownership"] - #[doc = " \\return A \\ref GEOSGeometry, caller to free with GEOSGeom_destroy())"] pub fn GEOSGeoJSONReader_readGeometry( reader: *mut GEOSGeoJSONReader, geojson: *const libc::c_char, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Allocate a new \\ref GEOSGeoJSONWriter."] - #[doc = " \\returns a new writer. Caller must free with GEOSGeoJSONWriter_destroy()"] pub fn GEOSGeoJSONWriter_create() -> *mut GEOSGeoJSONWriter; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSGeoJSONWriter."] - #[doc = " \\param writer The writer to destroy."] pub fn GEOSGeoJSONWriter_destroy(writer: *mut GEOSGeoJSONWriter); } extern "C" { - #[doc = " Write out the GeoJSON representation of a geometry. Note that writing a GeoJSON"] - #[doc = " Feature or FeatureCollection is unsupported through the GEOS C API."] - #[doc = " \\param writer A GeoJSON reader object, caller retains ownership."] - #[doc = " \\param g The geometry to convert, caller retains ownership."] - #[doc = " \\param indent The indentation used. Use -1 for no formatting."] - #[doc = " \\return A char pointer, caller to free with GEOSFree())"] pub fn GEOSGeoJSONWriter_writeGeometry( writer: *mut GEOSGeoJSONWriter, g: *const GEOSGeometry, @@ -4468,29 +2646,24 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getOutputDimension_r()"] pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setOutputDimension_r()"] pub fn GEOS_setWKBOutputDims_r( handle: GEOSContextHandle_t, newDims: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getByteOrder_r()"] pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setByteOrder_r()"] pub fn GEOS_setWKBByteOrder_r( handle: GEOSContextHandle_t, byteOrder: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBReader_read_r()"] pub fn GEOSGeomFromWKB_buf_r( handle: GEOSContextHandle_t, wkb: *const libc::c_uchar, @@ -4498,7 +2671,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_write_r()"] pub fn GEOSGeomToWKB_buf_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -4506,7 +2678,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBReader_readHEX_r()"] pub fn GEOSGeomFromHEX_buf_r( handle: GEOSContextHandle_t, hex: *const libc::c_uchar, @@ -4514,7 +2685,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_writeHEX_r()"] pub fn GEOSGeomToHEX_buf_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -4522,34 +2692,26 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOS_getWKBOutputDims()"] pub fn GEOS_getWKBOutputDims() -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOS_setWKBOutputDims()"] pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getByteOrder()"] pub fn GEOS_getWKBByteOrder() -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setByteOrder()"] pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBWriter_read()"] pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_write()"] pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBWriter_readHEX()"] pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_writeHEX()"] pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; } diff --git a/sys/prebuilt-bindings/geos_3.11.rs b/sys/prebuilt-bindings/geos_3.11.rs index cd3fff6..4a8316c 100644 --- a/sys/prebuilt-bindings/geos_3.11.rs +++ b/sys/prebuilt-bindings/geos_3.11.rs @@ -17,28 +17,9 @@ pub type max_align_t = u128; pub struct GEOSContextHandle_HS { _unused: [u8; 0], } -#[doc = " Type returned by GEOS_init_r(), for use in multi-threaded"] -#[doc = " applications."] -#[doc = ""] -#[doc = " There should be only one GEOSContextHandle_t per thread."] pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; -#[doc = " Callback function for passing GEOS error messages to parent process."] -#[doc = ""] -#[doc = " Set the GEOSMessageHandler for error and notice messages in \\ref initGEOS"] -#[doc = " for single-threaded programs, or using \\ref initGEOS_r for threaded"] -#[doc = " programs"] -#[doc = ""] -#[doc = " \\param fmt the message format template"] pub type GEOSMessageHandler = ::std::option::Option; -#[doc = " A GEOS message handler function."] -#[doc = ""] -#[doc = " \\param message the message contents"] -#[doc = " \\param userdata the user data pointer that was passed to GEOS when"] -#[doc = " registering this message handler."] -#[doc = ""] -#[doc = " \\see GEOSContext_setErrorMessageHandler"] -#[doc = " \\see GEOSContext_setNoticeMessageHandler"] pub type GEOSMessageHandler_r = ::std::option::Option< unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), >; @@ -47,130 +28,57 @@ pub type GEOSMessageHandler_r = ::std::option::Option< pub struct GEOSGeom_t { _unused: [u8; 0], } -#[doc = " Geometry generic type. Geometry can be a point, linestring, polygon,"] -#[doc = " multipoint, multilinestring, multipolygon, or geometrycollection."] -#[doc = " Geometry type can be read with \\ref GEOSGeomTypeId. Most functions"] -#[doc = " in GEOS either have GEOSGeometry* as a parameter or a return type."] -#[doc = " \\see GEOSGeom_createPoint"] -#[doc = " \\see GEOSGeom_createLineString"] -#[doc = " \\see GEOSGeom_createPolygon"] -#[doc = " \\see GEOSGeom_createCollection"] -#[doc = " \\see GEOSGeom_destroy"] pub type GEOSGeometry = GEOSGeom_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSPrepGeom_t { _unused: [u8; 0], } -#[doc = " Prepared geometry type."] -#[doc = " \\see GEOSPrepare()"] -#[doc = " \\see GEOSPreparedGeom_destroy()"] pub type GEOSPreparedGeometry = GEOSPrepGeom_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSCoordSeq_t { _unused: [u8; 0], } -#[doc = " Coordinate sequence."] -#[doc = " \\see GEOSCoordSeq_create()"] -#[doc = " \\see GEOSCoordSeq_destroy()"] pub type GEOSCoordSequence = GEOSCoordSeq_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSSTRtree_t { _unused: [u8; 0], } -#[doc = " STRTree index."] -#[doc = " \\see GEOSSTRtree_create()"] -#[doc = " \\see GEOSSTRtree_destroy()"] pub type GEOSSTRtree = GEOSSTRtree_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSBufParams_t { _unused: [u8; 0], } -#[doc = " Parameter object for buffering."] -#[doc = " \\see GEOSBufferParams_create()"] -#[doc = " \\see GEOSBufferParams_destroy()"] pub type GEOSBufferParams = GEOSBufParams_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSMakeValidParams_t { _unused: [u8; 0], } -#[doc = " Parameter object for validity enforcement."] -#[doc = " \\see GEOSMakeValidParams_create()"] -#[doc = " \\see GEOSMakeValidParams_destroy()"] pub type GEOSMakeValidParams = GEOSMakeValidParams_t; -#[doc = " \\cond"] pub type GEOSGeom = *mut GEOSGeometry; pub type GEOSCoordSeq = *mut GEOSCoordSequence; -#[doc = " Point"] pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; -#[doc = " Linestring"] pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; -#[doc = " Linear ring, used within polygons"] pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; -#[doc = " Polygon"] pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; -#[doc = " Multipoint, a homogeneous collection of points"] pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; -#[doc = " Multilinestring, a homogeneous collection of linestrings"] pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; -#[doc = " Multipolygon, a homogeneous collection of polygons"] pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; -#[doc = " Geometry collection, a heterogeneous collection of geometry"] pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; -#[doc = " Geometry type number, used by functions returning or"] -#[doc = " consuming geometry types."] -#[doc = ""] -#[doc = " \\see GEOSGeomType"] -#[doc = " \\see GEOSGeomTypeId"] pub type GEOSGeomTypes = libc::c_uint; -#[doc = " Big Endian"] pub const GEOSWKBByteOrders_GEOS_WKB_XDR: GEOSWKBByteOrders = 0; -#[doc = " Little Endian"] pub const GEOSWKBByteOrders_GEOS_WKB_NDR: GEOSWKBByteOrders = 1; -#[doc = " Well-known binary byte orders used when"] -#[doc = " writing to WKB."] -#[doc = ""] -#[doc = " \\see GEOSWKBWriter_setByteOrder"] pub type GEOSWKBByteOrders = libc::c_uint; -#[doc = " Extended"] pub const GEOSWKBFlavors_GEOS_WKB_EXTENDED: GEOSWKBFlavors = 1; -#[doc = " ISO"] pub const GEOSWKBFlavors_GEOS_WKB_ISO: GEOSWKBFlavors = 2; -#[doc = " Well-known binary flavors to use"] -#[doc = " when writing to WKB. ISO flavour is"] -#[doc = " more standard. Extended flavour supports"] -#[doc = " 3D and SRID embedding. GEOS reads both"] -#[doc = " transparently."] -#[doc = ""] -#[doc = " \\see GEOSWKBWriter_setFlavor"] pub type GEOSWKBFlavors = libc::c_uint; -#[doc = " Callback function for use in spatial index search calls. Pass into"] -#[doc = " the query function and handle query results as the index"] -#[doc = " returns them."] -#[doc = ""] -#[doc = " \\see GEOSSTRtree_query"] pub type GEOSQueryCallback = ::std::option::Option< unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), >; -#[doc = " Callback function for use in spatial index nearest neighbor calculations."] -#[doc = " Allows custom distance to be calculated between items in the"] -#[doc = " index. Is passed two items, and sets the calculated distance"] -#[doc = " between the items into the distance pointer. Extra data for the"] -#[doc = " calculation can be passed via the userdata."] -#[doc = ""] -#[doc = " \\param item1 first of the pair of items to calculate distance between"] -#[doc = " \\param item2 second of the pair of items to calculate distance between"] -#[doc = " \\param distance the distance between the items here"] -#[doc = " \\param userdata extra data for the calculation"] -#[doc = ""] -#[doc = " \\return zero if distance calculation succeeded, non-zero otherwise"] -#[doc = ""] -#[doc = " \\see GEOSSTRtree_nearest_generic"] -#[doc = " \\see GEOSSTRtree_iterate"] pub type GEOSDistanceCallback = ::std::option::Option< unsafe extern "C" fn( item1: *const libc::c_void, @@ -179,79 +87,38 @@ pub type GEOSDistanceCallback = ::std::option::Option< userdata: *mut libc::c_void, ) -> libc::c_int, >; -#[doc = " Callback function for use in GEOSGeom_transformXY."] -#[doc = " Allows custom function to be applied to x and y values for each coordinate"] -#[doc = " in a geometry. Z values are unchanged by this function."] -#[doc = " Extra data for the calculation can be passed via the userdata."] -#[doc = ""] -#[doc = " \\param x coordinate value to be updated"] -#[doc = " \\param y coordinate value to be updated"] -#[doc = " \\param userdata extra data for the calculation"] -#[doc = ""] -#[doc = " \\return 1 if calculation succeeded, 0 on failure"] pub type GEOSTransformXYCallback = ::std::option::Option< unsafe extern "C" fn(x: *mut f64, y: *mut f64, userdata: *mut libc::c_void) -> libc::c_int, >; -#[doc = " Callback function for use in interruption. The callback will be invoked _before_ checking for"] -#[doc = " interruption, so can be used to request it."] -#[doc = ""] -#[doc = " \\see GEOS_interruptRegisterCallback"] -#[doc = " \\see GEOS_interruptRequest"] -#[doc = " \\see GEOS_interruptCancel"] pub type GEOSInterruptCallback = ::std::option::Option; extern "C" { - #[doc = " Register a function to be called when processing is interrupted."] - #[doc = " \\param cb Callback function to invoke"] - #[doc = " \\return the previously configured callback"] - #[doc = " \\see GEOSInterruptCallback"] pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; } extern "C" { - #[doc = " Request safe interruption of operations"] pub fn GEOS_interruptRequest(); } extern "C" { - #[doc = " Cancel a pending interruption request"] pub fn GEOS_interruptCancel(); } extern "C" { - #[doc = " Initialize a context for this thread. Pass this context into"] - #[doc = " your other calls of `*_r` functions."] - #[doc = " \\return a GEOS context for this thread"] pub fn GEOS_init_r() -> GEOSContextHandle_t; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSContextHandle_t"] - #[doc = " when you are finished calling GEOS functions."] - #[doc = " \\param handle to be freed"] pub fn GEOS_finish_r(handle: GEOSContextHandle_t); } extern "C" { - #[doc = " Set the notice handler callback function for run-time notice messages."] - #[doc = " \\param extHandle the context returned by \\ref GEOS_init_r."] - #[doc = " \\param nf the handler callback"] - #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] pub fn GEOSContext_setNoticeHandler_r( extHandle: GEOSContextHandle_t, nf: GEOSMessageHandler, ) -> GEOSMessageHandler; } extern "C" { - #[doc = " Set the notice handler callback function for run-time error messages."] - #[doc = " \\param extHandle the GEOS context from \\ref GEOS_init_r"] - #[doc = " \\param ef the handler callback"] - #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] pub fn GEOSContext_setErrorHandler_r( extHandle: GEOSContextHandle_t, ef: GEOSMessageHandler, ) -> GEOSMessageHandler; } extern "C" { - #[doc = " Sets a notice message handler on the given GEOS context."] - #[doc = " \\param extHandle the GEOS context from \\ref GEOS_init_r"] - #[doc = " \\param nf the message handler"] - #[doc = " \\param userData optional user data pointer that will be passed to the message handler"] - #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] pub fn GEOSContext_setNoticeMessageHandler_r( extHandle: GEOSContextHandle_t, nf: GEOSMessageHandler_r, @@ -259,13 +126,6 @@ extern "C" { ) -> GEOSMessageHandler_r; } extern "C" { - #[doc = " Sets an error message handler on the given GEOS context."] - #[doc = ""] - #[doc = " \\param extHandle the GEOS context"] - #[doc = " \\param ef the message handler"] - #[doc = " \\param userData optional user data pointer that will be passed to the message handler"] - #[doc = ""] - #[doc = " \\return the previously configured message handler or NULL if no message handler was configured"] pub fn GEOSContext_setErrorMessageHandler_r( extHandle: GEOSContextHandle_t, ef: GEOSMessageHandler_r, @@ -273,7 +133,6 @@ extern "C" { ) -> GEOSMessageHandler_r; } extern "C" { - #[doc = " \\see GEOSCoordSeq_create"] pub fn GEOSCoordSeq_create_r( handle: GEOSContextHandle_t, size: libc::c_uint, @@ -281,7 +140,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSCoordSeq_copyFromBuffer"] pub fn GEOSCoordSeq_copyFromBuffer_r( handle: GEOSContextHandle_t, buf: *const f64, @@ -291,7 +149,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSCoordSeq_copyFromArrays"] pub fn GEOSCoordSeq_copyFromArrays_r( handle: GEOSContextHandle_t, x: *const f64, @@ -302,7 +159,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSCoordSeq_copyToBuffer"] pub fn GEOSCoordSeq_copyToBuffer_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -312,7 +168,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_copyToArrays"] pub fn GEOSCoordSeq_copyToArrays_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -323,76 +178,67 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_clone"] pub fn GEOSCoordSeq_clone_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSCoordSeq_destroy"] pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); } extern "C" { - #[doc = " \\see GEOSCoordSeq_setX"] pub fn GEOSCoordSeq_setX_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setY"] pub fn GEOSCoordSeq_setY_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setZ"] pub fn GEOSCoordSeq_setZ_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setXY"] pub fn GEOSCoordSeq_setXY_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setXYZ"] pub fn GEOSCoordSeq_setXYZ_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, - z: f64, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_setOrdinate"] pub fn GEOSCoordSeq_setOrdinate_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getX"] pub fn GEOSCoordSeq_getX_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -401,7 +247,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getY"] pub fn GEOSCoordSeq_getY_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -410,7 +255,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getZ"] pub fn GEOSCoordSeq_getZ_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -419,7 +263,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getXY"] pub fn GEOSCoordSeq_getXY_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -429,7 +272,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getXYZ"] pub fn GEOSCoordSeq_getXYZ_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -440,7 +282,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getOrdinate"] pub fn GEOSCoordSeq_getOrdinate_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -450,7 +291,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getSize"] pub fn GEOSCoordSeq_getSize_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -458,7 +298,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_getDimensions"] pub fn GEOSCoordSeq_getDimensions_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -466,7 +305,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSCoordSeq_isCCW"] pub fn GEOSCoordSeq_isCCW_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, @@ -474,7 +312,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSProject"] pub fn GEOSProject_r( handle: GEOSContextHandle_t, line: *const GEOSGeometry, @@ -482,15 +319,13 @@ extern "C" { ) -> f64; } extern "C" { - #[doc = " \\see GEOSInterpolate"] pub fn GEOSInterpolate_r( handle: GEOSContextHandle_t, line: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSProjectNormalized"] pub fn GEOSProjectNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -498,53 +333,35 @@ extern "C" { ) -> f64; } extern "C" { - #[doc = " \\see GEOSInterpolateNormalized"] pub fn GEOSInterpolateNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSBuffer"] pub fn GEOSBuffer_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } -#[doc = " End is rounded, with end point of original line in the centre of the round cap."] pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; -#[doc = " End is flat, with end point of original line at the end of the buffer"] pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; -#[doc = " End is flat, with end point of original line in the middle of a square enclosing that point"] pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; -#[doc = " Cap styles control the ends of buffered lines."] -#[doc = " \\see GEOSBuffer"] pub type GEOSBufCapStyles = libc::c_uint; -#[doc = " Join is rounded, essentially each line is terminated"] -#[doc = " in a round cap. Form round corner."] pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; -#[doc = " Join is flat, with line between buffer edges,"] -#[doc = " through the join point. Forms flat corner."] pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; -#[doc = " Join is the point at which the two buffer edges intersect."] -#[doc = " Forms sharp corner."] pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; -#[doc = " Join styles control the buffer shape at bends in a line."] -#[doc = " \\see GEOSBuffer"] pub type GEOSBufJoinStyles = libc::c_uint; extern "C" { - #[doc = " \\see GEOSBufferParams_create"] pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; } extern "C" { - #[doc = " \\see GEOSBufferParams_destroy"] pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); } extern "C" { - #[doc = " \\see GEOSBufferParams_setEndCapStyle"] pub fn GEOSBufferParams_setEndCapStyle_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, @@ -552,7 +369,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferParams_setJoinStyle"] pub fn GEOSBufferParams_setJoinStyle_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, @@ -560,15 +376,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferParams_setMitreLimit"] pub fn GEOSBufferParams_setMitreLimit_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferParams_setQuadrantSegments"] pub fn GEOSBufferParams_setQuadrantSegments_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, @@ -576,7 +390,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferParams_setSingleSided"] pub fn GEOSBufferParams_setSingleSided_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, @@ -584,88 +397,76 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSBufferWithParams"] pub fn GEOSBufferWithParams_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSBufferWithStyle"] pub fn GEOSBufferWithStyle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSDensify"] pub fn GEOSDensify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSOffsetCurve"] pub fn GEOSOffsetCurve_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createPoint"] pub fn GEOSGeom_createPoint_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createPointFromXY"] pub fn GEOSGeom_createPointFromXY_r( handle: GEOSContextHandle_t, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createEmptyPoint"] pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createLinearRing"] pub fn GEOSGeom_createLinearRing_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createLineString"] pub fn GEOSGeom_createLineString_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createEmptyLineString"] pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createEmptyPolygon"] pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createPolygon"] pub fn GEOSGeom_createPolygon_r( handle: GEOSContextHandle_t, shell: *mut GEOSGeometry, @@ -674,7 +475,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createCollection"] pub fn GEOSGeom_createCollection_r( handle: GEOSContextHandle_t, type_: libc::c_int, @@ -683,40 +483,34 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createEmptyCollection"] pub fn GEOSGeom_createEmptyCollection_r( handle: GEOSContextHandle_t, type_: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_createRectangle"] pub fn GEOSGeom_createRectangle_r( handle: GEOSContextHandle_t, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_clone"] pub fn GEOSGeom_clone_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_destroy"] pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); } extern "C" { - #[doc = " \\see GEOSEnvelope"] pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSIntersection"] pub fn GEOSIntersection_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -724,99 +518,87 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSIntersectionPrec"] pub fn GEOSIntersectionPrec_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSConvexHull"] pub fn GEOSConvexHull_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSConcaveHull"] pub fn GEOSConcaveHull_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - ratio: f64, + ratio: libc::c_double, allowHoles: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonHullSimplify"] pub fn GEOSPolygonHullSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, isOuter: libc::c_uint, - vertexNumFraction: f64, + vertexNumFraction: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonHullSimplifyByArea"] pub fn GEOSPolygonHullSimplifyMode_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, isOuter: libc::c_uint, parameterMode: libc::c_uint, - parameter: f64, + parameter: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSConcaveHullOfPolygons"] pub fn GEOSConcaveHullOfPolygons_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - lengthRatio: f64, + lengthRatio: libc::c_double, isTight: libc::c_uint, isHolesAllowed: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumRotatedRectangle"] pub fn GEOSMinimumRotatedRectangle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMaximumInscribedCircle"] pub fn GEOSMaximumInscribedCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSLargestEmptyCircle"] pub fn GEOSLargestEmptyCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, boundary: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumWidth"] pub fn GEOSMinimumWidth_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumClearanceLine"] pub fn GEOSMinimumClearanceLine_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumClearance"] pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -824,7 +606,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSDifference"] pub fn GEOSDifference_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -832,16 +613,14 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSDifferencePrec"] pub fn GEOSDifferencePrec_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSymDifference"] pub fn GEOSSymDifference_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -849,21 +628,18 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSymDifferencePrec"] pub fn GEOSSymDifferencePrec_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSBoundary"] pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSUnion"] pub fn GEOSUnion_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -871,52 +647,45 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSUnionPrec"] pub fn GEOSUnionPrec_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSUnaryUnion"] pub fn GEOSUnaryUnion_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSUnaryUnionPrec"] pub fn GEOSUnaryUnionPrec_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSCoverageUnion"] pub fn GEOSCoverageUnion_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPointOnSurface"] pub fn GEOSPointOnSurface_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGetCentroid"] pub fn GEOSGetCentroid_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMinimumBoundingCircle"] pub fn GEOSMinimumBoundingCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -925,22 +694,19 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSNode"] pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSClipByRect"] pub fn GEOSClipByRect_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonize"] pub fn GEOSPolygonize_r( handle: GEOSContextHandle_t, geoms: *const *const GEOSGeometry, @@ -948,7 +714,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonize_valid"] pub fn GEOSPolygonize_valid_r( handle: GEOSContextHandle_t, geoms: *const *const GEOSGeometry, @@ -956,7 +721,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonizer_getCutEdges"] pub fn GEOSPolygonizer_getCutEdges_r( handle: GEOSContextHandle_t, geoms: *const *const GEOSGeometry, @@ -964,7 +728,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSPolygonize_full"] pub fn GEOSPolygonize_full_r( handle: GEOSContextHandle_t, input: *const GEOSGeometry, @@ -974,55 +737,47 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSBuildArea"] pub fn GEOSBuildArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSLineMerge"] pub fn GEOSLineMerge_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSLineMergeDirected"] pub fn GEOSLineMergeDirected_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSReverse"] pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSimplify"] pub fn GEOSSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSTopologyPreserveSimplify"] pub fn GEOSTopologyPreserveSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_extractUniquePoints"] pub fn GEOSGeom_extractUniquePoints_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSharedPaths"] pub fn GEOSSharedPaths_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1030,58 +785,52 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSnap"] pub fn GEOSSnap_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSDelaunayTriangulation"] pub fn GEOSDelaunayTriangulation_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSConstrainedDelaunayTriangulation"] pub fn GEOSConstrainedDelaunayTriangulation_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSVoronoiDiagram"] pub fn GEOSVoronoiDiagram_r( extHandle: GEOSContextHandle_t, g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSegmentIntersection"] pub fn GEOSSegmentIntersection_r( extHandle: GEOSContextHandle_t, - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSDisjoint"] pub fn GEOSDisjoint_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1089,7 +838,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSTouches"] pub fn GEOSTouches_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1097,7 +845,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSIntersects"] pub fn GEOSIntersects_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1105,7 +852,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSCrosses"] pub fn GEOSCrosses_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1113,7 +859,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSWithin"] pub fn GEOSWithin_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1121,7 +866,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSContains"] pub fn GEOSContains_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1129,7 +873,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSOverlaps"] pub fn GEOSOverlaps_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1137,7 +880,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSEquals"] pub fn GEOSEquals_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1145,16 +887,14 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSEqualsExact"] pub fn GEOSEqualsExact_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSCovers"] pub fn GEOSCovers_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1162,7 +902,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSCoveredBy"] pub fn GEOSCoveredBy_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1170,18 +909,15 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPrepare"] pub fn GEOSPrepare_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *const GEOSPreparedGeometry; } extern "C" { - #[doc = " \\see GEOSPreparedGeom_destroy"] pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); } extern "C" { - #[doc = " \\see GEOSPreparedContains"] pub fn GEOSPreparedContains_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1189,7 +925,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedContainsProperly"] pub fn GEOSPreparedContainsProperly_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1197,7 +932,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedCoveredBy"] pub fn GEOSPreparedCoveredBy_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1205,7 +939,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedCovers"] pub fn GEOSPreparedCovers_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1213,7 +946,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedCrosses"] pub fn GEOSPreparedCrosses_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1221,7 +953,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedDisjoint"] pub fn GEOSPreparedDisjoint_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1229,7 +960,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedIntersects"] pub fn GEOSPreparedIntersects_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1237,7 +967,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedOverlaps"] pub fn GEOSPreparedOverlaps_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1245,7 +974,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedTouches"] pub fn GEOSPreparedTouches_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1253,7 +981,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedWithin"] pub fn GEOSPreparedWithin_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1261,7 +988,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSPreparedNearestPoints"] pub fn GEOSPreparedNearestPoints_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1269,7 +995,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSPreparedDistance"] pub fn GEOSPreparedDistance_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, @@ -1278,23 +1003,20 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSPreparedDistanceWithin"] pub fn GEOSPreparedDistanceWithin_r( handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: f64, + dist: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSSTRtree_create"] pub fn GEOSSTRtree_create_r( handle: GEOSContextHandle_t, nodeCapacity: usize, ) -> *mut GEOSSTRtree; } extern "C" { - #[doc = " \\see GEOSSTRtree_insert"] pub fn GEOSSTRtree_insert_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1303,7 +1025,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSSTRtree_query"] pub fn GEOSSTRtree_query_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1313,7 +1034,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSSTRtree_nearest"] pub fn GEOSSTRtree_nearest_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1321,7 +1041,6 @@ extern "C" { ) -> *const GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSSTRtree_nearest_generic"] pub fn GEOSSTRtree_nearest_generic_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1332,7 +1051,6 @@ extern "C" { ) -> *const libc::c_void; } extern "C" { - #[doc = " \\see GEOSSTRtree_iterate"] pub fn GEOSSTRtree_iterate_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1341,7 +1059,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSSTRtree_remove"] pub fn GEOSSTRtree_remove_r( handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree, @@ -1350,46 +1067,32 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSSTRtree_destroy"] pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " \\see GEOSisEmpty"] pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSisSimple"] pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSisRing"] pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSHasZ"] pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSisClosed"] pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } -#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryRuleMod2()"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; -#[doc = " Same as \\ref GEOSRELATE_BNR_MOD2"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; -#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryEndPoint()"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; -#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint()"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 3; -#[doc = " See geos::algorithm::BoundaryNodeRule::getBoundaryMonovalentEndPoint()"] pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 4; -#[doc = " Controls the behavior of the result of GEOSRelate when returning"] -#[doc = " DE9IM results for two geometries."] pub type GEOSRelateBoundaryNodeRules = libc::c_uint; extern "C" { - #[doc = " \\see GEOSRelatePattern"] pub fn GEOSRelatePattern_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1398,7 +1101,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSRelate"] pub fn GEOSRelate_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1406,7 +1108,6 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSRelatePatternMatch"] pub fn GEOSRelatePatternMatch_r( handle: GEOSContextHandle_t, mat: *const libc::c_char, @@ -1414,7 +1115,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSRelateBoundaryNodeRule"] pub fn GEOSRelateBoundaryNodeRule_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1422,23 +1122,18 @@ extern "C" { bnr: libc::c_int, ) -> *mut libc::c_char; } -#[doc = " Allow self-touching rings to form a hole in a polygon."] pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; -#[doc = " Change behaviour of validity testing in \\ref GEOSisValidDetail"] pub type GEOSValidFlags = libc::c_uint; extern "C" { - #[doc = " \\see GEOSisValid"] pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSisValidReason"] pub fn GEOSisValidReason_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSisValidDetail"] pub fn GEOSisValidDetail_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1447,33 +1142,20 @@ extern "C" { location: *mut *mut GEOSGeometry, ) -> libc::c_char; } -#[doc = " Original method, combines all rings into"] -#[doc = "a set of noded lines and then extracts valid"] -#[doc = "polygons from that linework."] pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_LINEWORK: GEOSMakeValidMethods = 0; -#[doc = " Structured method, first makes all rings valid"] -#[doc = "then merges shells and subtracts holes from"] -#[doc = "shells to generate valid result. Assumes that"] -#[doc = "holes and shells are correctly categorized."] pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_STRUCTURE: GEOSMakeValidMethods = 1; -#[doc = " Algorithm to use when repairing invalid geometries."] -#[doc = ""] -#[doc = " \\see GEOSMakeValidWithParams"] pub type GEOSMakeValidMethods = libc::c_uint; extern "C" { - #[doc = " \\see GEOSMakeValidParams_create"] pub fn GEOSMakeValidParams_create_r(extHandle: GEOSContextHandle_t) -> *mut GEOSMakeValidParams; } extern "C" { - #[doc = " \\see GEOSMakeValidParams_destroy"] pub fn GEOSMakeValidParams_destroy_r( handle: GEOSContextHandle_t, parms: *mut GEOSMakeValidParams, ); } extern "C" { - #[doc = " \\see GEOSMakeValidParams_setKeepCollapsed"] pub fn GEOSMakeValidParams_setKeepCollapsed_r( handle: GEOSContextHandle_t, p: *mut GEOSMakeValidParams, @@ -1481,7 +1163,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSMakeValidParams_setMethod"] pub fn GEOSMakeValidParams_setMethod_r( handle: GEOSContextHandle_t, p: *mut GEOSMakeValidParams, @@ -1489,14 +1170,12 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSMakeValid"] pub fn GEOSMakeValid_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidWithParams_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1504,39 +1183,32 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSRemoveRepeatedPoints"] pub fn GEOSRemoveRepeatedPoints_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeomType"] pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSGeomTypeId"] pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGetSRID"] pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSSetSRID"] pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); } extern "C" { - #[doc = " \\see GEOSGeom_getUserData"] pub fn GEOSGeom_getUserData_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut libc::c_void; } extern "C" { - #[doc = " \\see GEOSGeom_setUserData"] pub fn GEOSGeom_setUserData_r( handle: GEOSContextHandle_t, g: *mut GEOSGeometry, @@ -1544,14 +1216,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSGetNumGeometries"] pub fn GEOSGetNumGeometries_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGetGeometryN"] pub fn GEOSGetGeometryN_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1559,47 +1229,36 @@ extern "C" { ) -> *const GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSNormalize"] pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; } -#[doc = " The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed."] pub const GEOSPrecisionRules_GEOS_PREC_VALID_OUTPUT: GEOSPrecisionRules = 0; -#[doc = " Precision reduction is performed pointwise. Output geometry may be invalid due to collapse or self-intersection. (This might be better called \"GEOS_PREC_POINTWISE\" - the current name is historical.)"] pub const GEOSPrecisionRules_GEOS_PREC_NO_TOPO: GEOSPrecisionRules = 1; -#[doc = " Like the default mode, except that collapsed linear geometry elements are preserved. Collapsed polygonal input elements are removed."] pub const GEOSPrecisionRules_GEOS_PREC_KEEP_COLLAPSED: GEOSPrecisionRules = 2; -#[doc = " Controls the behavior of GEOSGeom_setPrecision()"] -#[doc = " when altering the precision of a geometry."] pub type GEOSPrecisionRules = libc::c_uint; extern "C" { - #[doc = " \\see GEOSGeom_setPrecision"] pub fn GEOSGeom_setPrecision_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeom_getPrecision"] pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; } extern "C" { - #[doc = " \\see GEOSGetNumInteriorRings"] pub fn GEOSGetNumInteriorRings_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetNumPoints"] pub fn GEOSGeomGetNumPoints_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetX"] pub fn GEOSGeomGetX_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1607,7 +1266,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetY"] pub fn GEOSGeomGetY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1615,7 +1273,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetZ"] pub fn GEOSGeomGetZ_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1623,7 +1280,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGetInteriorRingN"] pub fn GEOSGetInteriorRingN_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1631,42 +1287,36 @@ extern "C" { ) -> *const GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGetExteriorRing"] pub fn GEOSGetExteriorRing_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *const GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGetNumCoordinates"] pub fn GEOSGetNumCoordinates_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getCoordSeq"] pub fn GEOSGeom_getCoordSeq_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *const GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSGeom_getDimensions"] pub fn GEOSGeom_getDimensions_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getCoordinateDimension"] pub fn GEOSGeom_getCoordinateDimension_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getXMin"] pub fn GEOSGeom_getXMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1674,7 +1324,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getYMin"] pub fn GEOSGeom_getYMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1682,7 +1331,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getXMax"] pub fn GEOSGeom_getXMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1690,7 +1338,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getYMax"] pub fn GEOSGeom_getYMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1698,7 +1345,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeom_getExtent"] pub fn GEOSGeom_getExtent_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1709,7 +1355,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetPointN"] pub fn GEOSGeomGetPointN_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1717,21 +1362,18 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeomGetStartPoint"] pub fn GEOSGeomGetStartPoint_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeomGetEndPoint"] pub fn GEOSGeomGetEndPoint_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSArea"] pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1739,7 +1381,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSLength"] pub fn GEOSLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1747,7 +1388,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSDistance"] pub fn GEOSDistance_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1756,16 +1396,14 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSDistanceWithin"] pub fn GEOSDistanceWithin_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: f64, + dist: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSDistanceIndexed"] pub fn GEOSDistanceIndexed_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1774,7 +1412,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSHausdorffDistance"] pub fn GEOSHausdorffDistance_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1783,17 +1420,15 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSHausdorffDistanceDensify"] pub fn GEOSHausdorffDistanceDensify_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSFrechetDistance"] pub fn GEOSFrechetDistance_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1802,17 +1437,15 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSFrechetDistanceDensify"] pub fn GEOSFrechetDistanceDensify_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSHilbertCode"] pub fn GEOSHilbertCode_r( handle: GEOSContextHandle_t, geom: *const GEOSGeometry, @@ -1822,7 +1455,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSGeomGetLength"] pub fn GEOSGeomGetLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1830,7 +1462,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSNearestPoints"] pub fn GEOSNearestPoints_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -1838,7 +1469,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " \\see GEOSGeom_transformXY"] pub fn GEOSGeom_transformXY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1847,15 +1477,14 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSOrientationIndex"] pub fn GEOSOrientationIndex_r( handle: GEOSContextHandle_t, - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } #[repr(C)] @@ -1863,65 +1492,44 @@ extern "C" { pub struct GEOSWKTReader_t { _unused: [u8; 0], } -#[doc = " Reader object to read Well-Known Text (WKT) format and construct Geometry."] -#[doc = " \\see GEOSWKTReader_create"] -#[doc = " \\see GEOSWKTReader_create_r"] pub type GEOSWKTReader = GEOSWKTReader_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSWKTWriter_t { _unused: [u8; 0], } -#[doc = " Writer object to turn Geometry into Well-Known Text (WKT)."] -#[doc = " \\see GEOSWKTWriter_create"] -#[doc = " \\see GEOSWKTWriter_create_r"] pub type GEOSWKTWriter = GEOSWKTWriter_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSWKBReader_t { _unused: [u8; 0], } -#[doc = " Reader object to read Well-Known Binary (WKB) format and construct Geometry."] -#[doc = " \\see GEOSWKBReader_create"] -#[doc = " \\see GEOSWKBReader_create_r"] pub type GEOSWKBReader = GEOSWKBReader_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSWKBWriter_t { _unused: [u8; 0], } -#[doc = " Writer object to turn Geometry into Well-Known Binary (WKB)."] -#[doc = " \\see GEOSWKBWriter_create"] -#[doc = " \\see GEOSWKBWriter_create_r"] pub type GEOSWKBWriter = GEOSWKBWriter_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSGeoJSONReader_t { _unused: [u8; 0], } -#[doc = " Reader object to read GeoJSON format and construct a Geometry."] -#[doc = " \\see GEOSGeoJSONReader_create"] -#[doc = " \\see GEOSGeoJSONReader_create_r"] pub type GEOSGeoJSONReader = GEOSGeoJSONReader_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GEOSGeoJSONWriter_t { _unused: [u8; 0], } -#[doc = " Writer object to turn a Geometry into GeoJSON."] -#[doc = " \\see GEOSGeoJSONReader_create"] -#[doc = " \\see GEOSGeoJSONReader_create_r"] pub type GEOSGeoJSONWriter = GEOSGeoJSONWriter_t; extern "C" { - #[doc = " \\see GEOSWKTReader_create"] pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; } extern "C" { - #[doc = " \\see GEOSWKTReader_destroy"] pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); } extern "C" { - #[doc = " \\see GEOSWKTReader_read"] pub fn GEOSWKTReader_read_r( handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader, @@ -1929,15 +1537,12 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSWKTReader_create"] pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; } extern "C" { - #[doc = " \\see GEOSWKTWriter_destroy"] pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); } extern "C" { - #[doc = " \\see GEOSWKTWriter_write"] pub fn GEOSWKTWriter_write_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1945,7 +1550,6 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSWKTWriter_setTrim"] pub fn GEOSWKTWriter_setTrim_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1953,7 +1557,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKTWriter_setRoundingPrecision"] pub fn GEOSWKTWriter_setRoundingPrecision_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1961,7 +1564,6 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKTWriter_setOutputDimension"] pub fn GEOSWKTWriter_setOutputDimension_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1969,14 +1571,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKTWriter_getOutputDimension"] pub fn GEOSWKTWriter_getOutputDimension_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSWKTWriter_setOld3D"] pub fn GEOSWKTWriter_setOld3D_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter, @@ -1984,15 +1584,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKBReader_create"] pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; } extern "C" { - #[doc = " \\see GEOSWKBReader_destroy"] pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); } extern "C" { - #[doc = " \\see GEOSWKBReader_read"] pub fn GEOSWKBReader_read_r( handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader, @@ -2001,7 +1598,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSWKBReader_readHEX"] pub fn GEOSWKBReader_readHEX_r( handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader, @@ -2010,15 +1606,12 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSWKBWriter_create"] pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; } extern "C" { - #[doc = " \\see GEOSWKBWriter_destroy"] pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); } extern "C" { - #[doc = " \\see GEOSWKBWriter_write"] pub fn GEOSWKBWriter_write_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -2027,7 +1620,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\see GEOSWKBWriter_writeHEX"] pub fn GEOSWKBWriter_writeHEX_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -2036,14 +1628,12 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\see GEOSWKBWriter_getOutputDimension"] pub fn GEOSWKBWriter_getOutputDimension_r( handle: GEOSContextHandle_t, writer: *const GEOSWKBWriter, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSWKBWriter_setOutputDimension"] pub fn GEOSWKBWriter_setOutputDimension_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -2051,14 +1641,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKBWriter_getByteOrder"] pub fn GEOSWKBWriter_getByteOrder_r( handle: GEOSContextHandle_t, writer: *const GEOSWKBWriter, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSWKBWriter_setByteOrder"] pub fn GEOSWKBWriter_setByteOrder_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -2066,14 +1654,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKBWriter_getFlavor"] pub fn GEOSWKBWriter_getFlavor_r( handle: GEOSContextHandle_t, writer: *const GEOSWKBWriter, ) -> libc::c_int; } extern "C" { - #[doc = " \\see GEOSWKBWriter_setFlavor"] pub fn GEOSWKBWriter_setFlavor_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -2081,14 +1667,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSWKBWriter_getIncludeSRID"] pub fn GEOSWKBWriter_getIncludeSRID_r( handle: GEOSContextHandle_t, writer: *const GEOSWKBWriter, ) -> libc::c_char; } extern "C" { - #[doc = " \\see GEOSWKBWriter_setIncludeSRID"] pub fn GEOSWKBWriter_setIncludeSRID_r( handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter, @@ -2096,15 +1680,12 @@ extern "C" { ); } extern "C" { - #[doc = " \\see GEOSGeoJSONReader_create"] pub fn GEOSGeoJSONReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONReader; } extern "C" { - #[doc = " \\see GEOSGeoJSONReader_destroy"] pub fn GEOSGeoJSONReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSGeoJSONReader); } extern "C" { - #[doc = " \\see GEOSWKTReader_read"] pub fn GEOSGeoJSONReader_readGeometry_r( handle: GEOSContextHandle_t, reader: *mut GEOSGeoJSONReader, @@ -2112,15 +1693,12 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\see GEOSGeoJSONWriter_create"] pub fn GEOSGeoJSONWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONWriter; } extern "C" { - #[doc = " \\see GEOSGeoJSONWriter_destroy"] pub fn GEOSGeoJSONWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSGeoJSONWriter); } extern "C" { - #[doc = " \\see GEOSGeoJSONWriter_writeGeometry"] pub fn GEOSGeoJSONWriter_writeGeometry_r( handle: GEOSContextHandle_t, writer: *mut GEOSGeoJSONWriter, @@ -2129,54 +1707,18 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\see GEOSFree"] pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); } extern "C" { - #[doc = " Returns the current GEOS version string. eg: \"3.10.0\""] - #[doc = " This function does not have a reentrant variant and is"] - #[doc = " available if `GEOS_USE_ONLY_R_API` is defined."] - #[doc = " \\return version string"] pub fn GEOSversion() -> *const libc::c_char; } extern "C" { - #[doc = " For non-reentrant code, set up an execution contact, and associate"] - #[doc = " \\ref GEOSMessageHandler functions with it, to pass error and notice"] - #[doc = " messages back to the calling application."] - #[doc = "
"]
-    #[doc = " typedef void (*GEOSMessageHandler)(const char *fmt, ...);"]
-    #[doc = " 
"] - #[doc = ""] - #[doc = " \\param notice_function Handle notice messages"] - #[doc = " \\param error_function Handle error messages"] - pub fn initGEOS(notice_function: GEOSMessageHandler, error_function: GEOSMessageHandler); -} -extern "C" { - #[doc = " For non-reentrant code, call when all GEOS operations are complete,"] - #[doc = " cleans up global resources."] - pub fn finishGEOS(); -} -extern "C" { - #[doc = " Free strings and byte buffers returned by functions such"] - #[doc = " as GEOSWKBWriter_write(),"] - #[doc = " GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(), etc."] - #[doc = " \\param buffer The memory to free"] pub fn GEOSFree(buffer: *mut libc::c_void); } extern "C" { - #[doc = " Create a coordinate sequence."] - #[doc = " \\param size number of coordinates in the sequence"] - #[doc = " \\param dims dimensionality of the coordinates (2 or 3)"] - #[doc = " \\return the sequence or NULL on exception"] pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Create a coordinate sequence by copying from a buffer of doubles (XYXY or XYZXYZ)"] - #[doc = " \\param buf pointer to buffer"] - #[doc = " \\param size number of coordinates in the sequence"] - #[doc = " \\param hasZ does buffer have Z values?"] - #[doc = " \\param hasM does buffer have M values? (they will be ignored)"] - #[doc = " \\return the sequence or NULL on exception"] pub fn GEOSCoordSeq_copyFromBuffer( buf: *const f64, size: libc::c_uint, @@ -2185,13 +1727,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Create a coordinate sequence by copying from arrays of doubles"] - #[doc = " \\param x array of x coordinates"] - #[doc = " \\param y array of y coordinates"] - #[doc = " \\param z array of z coordinates, or NULL"] - #[doc = " \\param m array of m coordinates, (must be NULL)"] - #[doc = " \\param size length of each array"] - #[doc = " \\return the sequence or NULL on exception"] pub fn GEOSCoordSeq_copyFromArrays( x: *const f64, y: *const f64, @@ -2201,12 +1736,6 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Copy the contents of a coordinate sequence to a buffer of doubles (XYXY or XYZXYZ)"] - #[doc = " \\param s sequence to copy"] - #[doc = " \\param buf buffer to which coordinates should be copied"] - #[doc = " \\param hasZ copy Z values to buffer?"] - #[doc = " \\param hasM copy M values to buffer? (will be NaN)"] - #[doc = " \\return 1 on success, 0 on error"] pub fn GEOSCoordSeq_copyToBuffer( s: *const GEOSCoordSequence, buf: *mut f64, @@ -2215,13 +1744,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Copy the contents of a coordinate sequence to a buffer of doubles (XYZY or XYZXYZ)"] - #[doc = " \\param s sequence to copy"] - #[doc = " \\param x array to which x values should be copied"] - #[doc = " \\param y array to which y values should be copied"] - #[doc = " \\param z array to which z values should be copied, or NULL"] - #[doc = " \\param m array to which m values should be copied (will all be NAN)"] - #[doc = " \\return 1 on success, 0 on error"] pub fn GEOSCoordSeq_copyToArrays( s: *const GEOSCoordSequence, x: *mut f64, @@ -2231,93 +1753,49 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Clone a coordinate sequence."] - #[doc = " \\param s the coordinate sequence to clone"] - #[doc = " \\return a copy of the coordinate sequence or NULL on exception"] pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Destroy a coordinate sequence, freeing all memory."] - #[doc = " \\param s the coordinate sequence to destroy"] pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - #[doc = " Set X ordinate values in a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val the value to set the ordinate to"] - #[doc = " \\return 0 on exception"] - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - #[doc = " Set Y ordinate values in a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val the value to set the ordinate to"] - #[doc = " \\return 0 on exception"] - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - #[doc = " Set Z ordinate values in a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val the value to set the ordinate to"] - #[doc = " \\return 0 on exception"] - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - #[doc = " Set X and Y ordinate values in a coordinate sequence simultaneously."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param x the value to set the X ordinate to"] - #[doc = " \\param y the value to set the Y ordinate to"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_setXY( s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Set X, Y and Z ordinate values in a coordinate sequence simultaneously."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param x the value to set the X ordinate to"] - #[doc = " \\param y the value to set the Y ordinate to"] - #[doc = " \\param z the value to set the Z ordinate to"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_setXYZ( s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, - z: f64, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Set Nth ordinate value in a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param dim the dimension number of the ordinate to alter, zero based"] - #[doc = " \\param val the value to set the ordinate to"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_setOrdinate( s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Read X ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val pointer where ordinate value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getX( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2325,11 +1803,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read Y ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val pointer where ordinate value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getY( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2337,11 +1810,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read Z ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param val pointer where ordinate value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getZ( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2349,12 +1817,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read X and Y ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param x pointer where ordinate X value will be placed"] - #[doc = " \\param y pointer where ordinate Y value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getXY( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2363,13 +1825,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read X and Y ordinate values from a coordinate sequence."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param idx the index of the coordinate to alter, zero based"] - #[doc = " \\param x pointer where ordinate X value will be placed"] - #[doc = " \\param y pointer where ordinate Y value will be placed"] - #[doc = " \\param z pointer where ordinate Z value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getXYZ( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2379,12 +1834,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Read Nth ordinate value from a coordinate sequence."] - #[doc = " \\param[in] s the coordinate sequence"] - #[doc = " \\param[in] idx the index of the coordinate to alter, zero based"] - #[doc = " \\param[in] dim the dimension number of the ordinate to read, zero based"] - #[doc = " \\param[out] val pointer where ordinate value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getOrdinate( s: *const GEOSCoordSequence, idx: libc::c_uint, @@ -2393,95 +1842,45 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Get size info from a coordinate sequence."] - #[doc = " \\param[in] s the coordinate sequence"] - #[doc = " \\param[out] size pointer where size value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getSize( s: *const GEOSCoordSequence, size: *mut libc::c_uint, ) -> libc::c_int; } extern "C" { - #[doc = " Get dimension info from a coordinate sequence."] - #[doc = " \\param[in] s the coordinate sequence"] - #[doc = " \\param[out] dims pointer where dimension value will be placed"] - #[doc = " \\return 0 on exception"] pub fn GEOSCoordSeq_getDimensions( s: *const GEOSCoordSequence, dims: *mut libc::c_uint, ) -> libc::c_int; } extern "C" { - #[doc = " Check orientation of a coordinate sequence. Closure of the sequence is"] - #[doc = " assumed. Invalid (collapsed) sequences will return false. Short (less"] - #[doc = " than 4 points) sequences will return exception."] - #[doc = " \\param s the coordinate sequence"] - #[doc = " \\param is_ccw pointer for ccw value, 1 if counter-clockwise orientation, 0 otherwise"] - #[doc = " \\return 0 on exception, 1 on success"] pub fn GEOSCoordSeq_isCCW( s: *const GEOSCoordSequence, is_ccw: *mut libc::c_char, ) -> libc::c_int; } extern "C" { - #[doc = " Creates a point geometry from a coordinate sequence."] - #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] - #[doc = " \\return A newly allocated point geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a point geometry from a pair of coordinates."] - #[doc = " \\param x The X coordinate"] - #[doc = " \\param y The Y coordinate"] - #[doc = " \\return A newly allocated point geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - pub fn GEOSGeom_createPointFromXY(x: f64, y: f64) -> *mut GEOSGeometry; + pub fn GEOSGeom_createPointFromXY(x: libc::c_double, y: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates an empty point."] - #[doc = " \\return A newly allocated empty point geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a linear ring geometry, for use in a polygon."] - #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] - #[doc = " \\return A newly allocated linear ring geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a linestring geometry."] - #[doc = " \\param s Input coordinate sequence, ownership passes to the geometry"] - #[doc = " \\return A newly allocated linestring geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates an emptylinestring geometry."] - #[doc = " \\return A newly allocated linestring geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates an empty polygon geometry."] - #[doc = " \\return A newly allocated empty polygon geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; } extern "C" { - #[doc = " Creates a polygon geometry from line ring geometries."] - #[doc = " \\param shell A linear ring that is the exterior ring of the polygon."] - #[doc = " \\param holes An array of linear rings that are the holes."] - #[doc = " \\param nholes The number of rings in the holes array."] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\note The holes argument is an array of GEOSGeometry* objects."] - #[doc = " The caller **retains ownership** of the containing array,"] - #[doc = " but the ownership of the pointed-to objects is transferred"] - #[doc = " to the returned \\ref GEOSGeometry."] pub fn GEOSGeom_createPolygon( shell: *mut GEOSGeometry, holes: *mut *mut GEOSGeometry, @@ -2489,16 +1888,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a geometry collection."] - #[doc = " \\param type The geometry type, enumerated by \\ref GEOSGeomTypes"] - #[doc = " \\param geoms A list of geometries that will form the collection"] - #[doc = " \\param ngeoms The number of geometries in the geoms list"] - #[doc = " \\return A newly allocated geometry collection. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\note The holes argument is an array of GEOSGeometry* objects."] - #[doc = " The caller **retains ownership** of the containing array,"] - #[doc = " but the ownership of the pointed-to objects is transferred"] - #[doc = " to the returned \\ref GEOSGeometry."] pub fn GEOSGeom_createCollection( type_: libc::c_int, geoms: *mut *mut GEOSGeometry, @@ -2506,232 +1895,89 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create an empty geometry collection."] - #[doc = " \\param type The geometry type, enumerated by \\ref GEOSGeomTypes"] - #[doc = " \\return A newly allocated empty geometry collection. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a rectangular polygon from bounding coordinates."] - #[doc = " Will return a point geometry if width and height are 0."] - #[doc = " \\param xmin Left bound of envelope"] - #[doc = " \\param ymin Lower bound of envelope"] - #[doc = " \\param xmax Right bound of envelope"] - #[doc = " \\param ymax Upper bound of envelope"] pub fn GEOSGeom_createRectangle( - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a new copy of the input geometry."] - #[doc = " \\param g The geometry to copy"] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Release the memory associated with a geometry."] - #[doc = " \\param g The geometry to be destroyed."] pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); } extern "C" { - #[doc = " Returns the geometry type string for this geometry."] - #[doc = " eg: \"GeometryCollection\", \"LineString\""] - #[doc = " \\param g Input geometry"] - #[doc = " \\return A string with the geometry type."] - #[doc = " Caller must free with GEOSFree()."] - #[doc = " NULL on exception."] pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { - #[doc = " Returns the \\ref GEOSGeomTypeId number for this geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return The geometry type number, or -1 on exception."] pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Returns the \"spatial reference id\" (SRID) for this geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return SRID number or 0 if unknown / not set."] pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Return the anonymous \"user data\" for this geometry."] - #[doc = " User data must be managed by the caller, and freed before"] - #[doc = " the geometry is freed."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return A void* to the user data, caller is responsible for"] - #[doc = " casting to the appropriate type and freeing."] pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; } extern "C" { - #[doc = " Returns the number of sub-geometries immediately under a"] - #[doc = " multi-geometry or collection or 1 for a simple geometry."] - #[doc = " For nested collections, remember to check if returned"] - #[doc = " sub-geometries are **themselves** also collections."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return Number of direct children in this collection"] - #[doc = " \\warning For GEOS < 3.2 this function may crash when fed simple geometries"] pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Returns the specified sub-geometry of a collection. For"] - #[doc = " a simple geometry, returns a pointer to the input."] - #[doc = " Returned object is a pointer to internal storage:"] - #[doc = " it must NOT be destroyed directly."] - #[doc = " \\param g Input geometry"] - #[doc = " \\param n Sub-geometry index, zero-base"] - #[doc = " \\return A const \\ref GEOSGeometry, do not free!"] - #[doc = "It will be freed when the parent is freed."] - #[doc = "Returns NULL on exception."] - #[doc = " \\note Up to GEOS 3.2.0 the input geometry must be a Collection, in"] - #[doc = " later versions it doesn't matter (getGeometryN(0) for a single will"] - #[doc = " return the input)."] pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; } extern "C" { - #[doc = " Read the currently set precision value from the"] - #[doc = " geometry and returns the grid size if it is a fixed"] - #[doc = " precision or 0.0 if it is full floating point precision."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return The grid size, or -1 on exception"] pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; } extern "C" { - #[doc = " Returns the number of interior rings, for a Polygon input, or"] - #[doc = " an exception otherwise."] - #[doc = " \\param g Input Polygon geometry"] - #[doc = " \\return Number of interior rings, -1 on exception"] pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Returns the number of points, for a LineString input, or"] - #[doc = " an exception otherwise."] - #[doc = " \\param g Input LineString geometry"] - #[doc = " \\return Number of points, -1 on exception"] pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Returns the X coordinate, for a Point input, or an"] - #[doc = " exception otherwise."] - #[doc = " \\param[in] g Input Point geometry"] - #[doc = " \\param[out] x Pointer to hold return value"] - #[doc = " \\returns 1 on success, 0 on exception"] pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Returns the Y coordinate, for a Point input, or an"] - #[doc = " exception otherwise."] - #[doc = " \\param[in] g Input Point geometry"] - #[doc = " \\param[out] y Pointer to hold return value"] - #[doc = " \\returns 1 on success, 0 on exception"] pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Returns the Z coordinate, for a Point input, or an"] - #[doc = " exception otherwise."] - #[doc = " \\param[in] g Input Point geometry"] - #[doc = " \\param[out] z Pointer to hold return value"] - #[doc = " \\returns 1 on success, 0 on exception"] pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Returns the N'th ring for a Polygon input."] - #[doc = " \\note Returned object is a pointer to internal storage:"] - #[doc = " it must NOT be destroyed directly."] - #[doc = " \\param g Input Polygon geometry"] - #[doc = " \\param n Index of the desired ring"] - #[doc = " \\return LinearRing geometry. Owned by parent geometry, do not free. NULL on exception."] pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; } extern "C" { - #[doc = " Get the external ring of a Polygon."] - #[doc = " \\note Returned object is a pointer to internal storage:"] - #[doc = " it must NOT be destroyed directly."] - #[doc = " \\param g Input Polygon geometry"] - #[doc = " \\return LinearRing geometry. Owned by parent geometry, do not free. NULL on exception."] pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; } extern "C" { - #[doc = " Get the total number of points in a geometry,"] - #[doc = " of any type."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return Number of points in the geometry. -1 on exception."] pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Return the coordinate sequence underlying the"] - #[doc = " given geometry (Must be a LineString, LinearRing or Point)."] - #[doc = " Do not directly free the coordinate sequence, it is owned by"] - #[doc = " the parent geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return Coordinate sequence or NULL on exception."] pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; } extern "C" { - #[doc = " Return the planar dimensionality of the geometry."] - #[doc = ""] - #[doc = " - 0 for point, multipoint"] - #[doc = " - 1 for linestring, multilinestring"] - #[doc = " - 2 for polygon, multipolygon"] - #[doc = ""] - #[doc = " \\see geos::geom::Dimension::DimensionType"] - #[doc = " \\param g Input geometry"] - #[doc = " \\return The dimensionality"] pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Return the cartesian dimension of the geometry."] - #[doc = ""] - #[doc = " - 2 for XY data"] - #[doc = " - 3 for XYZ data"] - #[doc = ""] - #[doc = " \\param g Input geometry"] - #[doc = " \\return The dimension"] pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Finds the minimum X value in the geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] value Pointer to place result"] - #[doc = " \\return 0 on exception"] pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Finds the minimum Y value in the geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] value Pointer to place result"] - #[doc = " \\return 0 on exception"] pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Finds the maximum X value in the geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] value Pointer to place result"] - #[doc = " \\return 0 on exception"] pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Finds the maximum Y value in the geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] value Pointer to place result"] - #[doc = " \\return 0 on exception"] pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Finds the extent (minimum and maximum X and Y value) of the geometry."] - #[doc = " Raises an exception for empty geometry input."] - #[doc = ""] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] xmin Pointer to place result for minimum X value"] - #[doc = " \\param[out] ymin Pointer to place result for minimum Y value"] - #[doc = " \\param[out] xmax Pointer to place result for maximum X value"] - #[doc = " \\param[out] ymax Pointer to place result for maximum Y value"] - #[doc = " \\return 1 on success, 0 on exception"] pub fn GEOSGeom_getExtent( g: *const GEOSGeometry, xmin: *mut f64, @@ -2741,131 +1987,45 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Return the N'th point of a LineString"] - #[doc = " \\param g Input geometry, must be a LineString"] - #[doc = " \\param n Index of desired point (zero based)"] - #[doc = " \\return A Point geometry."] - #[doc = " Caller must free with GEOSGeom_destroy()"] - #[doc = " NULL on exception."] pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return the first point of a LineString"] - #[doc = " \\param g Input geometry, must be a LineString"] - #[doc = " \\return A Point geometry."] - #[doc = " Caller must free with GEOSGeom_destroy()"] - #[doc = " NULL on exception."] pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return the last point of a LineString"] - #[doc = " \\param g Input geometry, must be a LineString"] - #[doc = " \\return A Point geometry."] - #[doc = " Caller must free with GEOSGeom_destroy()"] - #[doc = " NULL on exception."] pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Tests whether the input geometry is empty. If the geometry or any"] - #[doc = " component is non-empty, the geometry is non-empty. An empty geometry"] - #[doc = " has no boundary or interior."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Tests whether the input geometry is a ring. Rings are"] - #[doc = " linestrings, without self-intersections,"] - #[doc = " with start and end point being identical."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Tests whether the input geometry has z coordinates."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Tests whether the input geometry is closed."] - #[doc = " A closed geometry is a linestring or multilinestring"] - #[doc = " with the start and end points being the same."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Set the \"spatial reference id\" (SRID) for this geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\param SRID SRID number or 0 for unknown SRID."] pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); } extern "C" { - #[doc = " Set the anonymous \"user data\" for this geometry."] - #[doc = " Don't forget to free the user data before freeing the geometry."] - #[doc = " \\param g Input geometry"] - #[doc = " \\param userData Void pointer to user data"] pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); } extern "C" { - #[doc = " Organize the elements, rings, and coordinate order"] - #[doc = " of geometries in a consistent way,"] - #[doc = " so that geometries that represent the same"] - #[doc = " object can be easily compared."] - #[doc = " Modifies the geometry in-place."] - #[doc = ""] - #[doc = " Normalization ensures the following:"] - #[doc = " - Lines are oriented to have smallest coordinate first (apart from duplicate endpoints)"] - #[doc = " - Rings start with their smallest coordinate"] - #[doc = " (using XY ordering)"] - #[doc = " - Polygon shell rings are oriented CW, and holes CCW"] - #[doc = " - Collection elements are sorted by their first coordinate"] - #[doc = ""] - #[doc = " Use before calling \\ref GEOSEqualsExact to avoid false \"not equal\" results."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return 0 on success or -1 on exception"] pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Tests whether the input geometry is \"simple\". Mostly relevant for"] - #[doc = " linestrings. A \"simple\" linestring has no self-intersections."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Check the validity of the provided geometry."] - #[doc = " - All points are valid."] - #[doc = " - All non-zero-length linestrings are valid."] - #[doc = " - Polygon rings must be non-self-intersecting, and interior rings"] - #[doc = " contained within exterior rings."] - #[doc = " - Multi-polygon components may not touch or overlap."] - #[doc = ""] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::operation::valid::isValidOp"] pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Return the human readable reason a geometry is invalid,"] - #[doc = " \"Valid Geometry\" string otherwise, or NULL on exception."] - #[doc = " \\param g The geometry to test"] - #[doc = " \\return A string with the reason, NULL on exception."] - #[doc = "Caller must GEOSFree() their result."] pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { - #[doc = " In one step, calculate and return the validity, the"] - #[doc = " human readable validity reason and a point at which validity"] - #[doc = " rules are broken."] - #[doc = " Caller has the responsibility to destroy 'reason' with GEOSFree()"] - #[doc = " and 'location' with GEOSGeom_destroy()"] - #[doc = " \\param g The geometry to test"] - #[doc = " \\param flags A value from the \\ref GEOSValidFlags enum"] - #[doc = " \\param reason A pointer in which the reason string will be places"] - #[doc = " \\param location A pointer in which the location GEOSGeometry will be placed"] - #[doc = " \\return 1 when valid, 0 when invalid, 2 on exception"] pub fn GEOSisValidDetail( g: *const GEOSGeometry, flags: libc::c_int, @@ -2874,134 +2034,51 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Repair an invalid geometry, returning a valid output."] - #[doc = " \\param g The geometry to repair"] - #[doc = " \\return The repaired geometry. Caller must free with GEOSGeom_destroy()."] pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Repair an invalid geometry, returning a valid output, using the"] - #[doc = " indicated GEOSMakeValidMethods algorithm and options."] - #[doc = " \\param g is the geometry to test."] - #[doc = " \\param makeValidParams is a GEOSMakeValidParams with the desired parameters set on it."] - #[doc = " \\return A repaired geometry. Caller must free with GEOSGeom_destroy()."] - #[doc = " \\see GEOSMakeValidParams_create"] - #[doc = " \\see GEOSMakeValidParams_destroy"] - #[doc = " \\see GEOSMakeValidParams_setMethod"] - #[doc = " \\see GEOSMakeValidParams_setKeepCollapsed"] pub fn GEOSMakeValidWithParams( g: *const GEOSGeometry, makeValidParams: *const GEOSMakeValidParams, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a GEOSMakeValidParams to hold the desired parameters"] - #[doc = " to control the algorithm and behavior of the validation process."] - #[doc = " \\return a parameter object"] - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidParams_create() -> *mut GEOSMakeValidParams; } extern "C" { - #[doc = " Destroy a GEOSMakeValidParams."] - #[doc = " \\param parms the object to destroy"] - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidParams_destroy(parms: *mut GEOSMakeValidParams); } extern "C" { - #[doc = " Set the GEOSMakeValidMethods to use in making the geometry"] - #[doc = " valid."] - #[doc = " \\return 0 on exception, 1 on success."] - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidParams_setMethod( p: *mut GEOSMakeValidParams, method: GEOSMakeValidMethods, ) -> libc::c_int; } extern "C" { - #[doc = " When this parameter is not set to 0, the GEOS_MAKE_VALID_STRUCTURE method will drop"] - #[doc = " any component that has collapsed into a lower dimensionality."] - #[doc = " For example, a ring collapsing to a line, or a line collapsing"] - #[doc = " to a point."] - #[doc = " \\return 0 on exception, 1 on success."] - #[doc = " \\see GEOSMakeValidWithParams"] pub fn GEOSMakeValidParams_setKeepCollapsed( p: *mut GEOSMakeValidParams, keepCollapsed: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Computes the minimum clearance of a geometry. The minimum clearance is the smallest amount by which"] - #[doc = " a vertex could be move to produce an invalid polygon, a non-simple linestring, or a multipoint with"] - #[doc = " repeated points. If a geometry has a minimum clearance of 'eps', it can be said that:"] - #[doc = ""] - #[doc = " - No two distinct vertices in the geometry are separated by less than 'eps'"] - #[doc = " - No vertex is closer than 'eps' to a line segment of which it is not an endpoint."] - #[doc = ""] - #[doc = " If the minimum clearance cannot be defined for a geometry (such as with a single point, or a multipoint"] - #[doc = " whose points are identical, a value of Infinity will be calculated."] - #[doc = ""] - #[doc = " \\param g the input geometry"] - #[doc = " \\param d a double to which the result can be stored"] - #[doc = " \\return 0 if no exception occurred."] - #[doc = " 2 if an exception occurred."] - #[doc = " \\see geos::precision::MinimumClearance"] pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Returns a LineString whose endpoints define the minimum clearance of a geometry."] - #[doc = " If the geometry has no minimum clearance, an empty LineString will be returned."] - #[doc = ""] - #[doc = " \\param g the input geometry"] - #[doc = " \\return a linestring geometry, or NULL if an exception occurred."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::precision::MinimumClearance"] pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Works from start of each coordinate sequence in the"] - #[doc = " geometry, retaining points that are further away from the"] - #[doc = " previous retained point than the tolerance value."] - #[doc = ""] - #[doc = " Removing repeated points with a non-zero tolerance may"] - #[doc = " result in an invalid geometry being returned. Be sure"] - #[doc = " to check and repair validity."] - #[doc = ""] - #[doc = " \\return A geometry with all points within the tolerance of each other removed."] - #[doc = " \\param g The geometry to filter"] - #[doc = " \\param tolerance Remove all points within this distance of each other. Use 0.0 to remove only exactly repeated points."] - #[doc = ""] - #[doc = " \\see GEOSMakeValidWithParams"] - pub fn GEOSRemoveRepeatedPoints(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Calculate the area of a geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] area Pointer to be filled in with area result"] - #[doc = " \\return 1 on success, 0 on exception."] + pub fn GEOSRemoveRepeatedPoints(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Calculate the length of a geometry."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] length Pointer to be filled in with length result"] - #[doc = " \\return 1 on success, 0 on exception."] pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Calculate the length of a LineString."] - #[doc = " Only works for LineString inputs, returns exception otherwise."] - #[doc = ""] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[out] length Pointer to be filled in with length result"] - #[doc = " \\return 1 on success, 0 on exception."] pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; } extern "C" { - #[doc = " Calculate the distance between two geometries."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -3009,28 +2086,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Test whether the distance between two geometries is"] - #[doc = " within the given dist."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\param dist The max distance"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] pub fn GEOSDistanceWithin( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: f64, + dist: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " Calculate the distance between two geometries, using the"] - #[doc = " indexed facet distance, which first indexes the geometries"] - #[doc = " internally, then calculates the distance. Useful when one"] - #[doc = " or both geometries is very large."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::operation::distance:;IndexedFacetDistance"] pub fn GEOSDistanceIndexed( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -3038,27 +2100,12 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " The closest points of the two geometries."] - #[doc = " The first point comes from g1 geometry and the second point comes from g2."] - #[doc = ""] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\return A coordinate sequence with the two points, or NULL on exception."] - #[doc = " Caller must free with GEOSCoordSeq_destroy()."] pub fn GEOSNearestPoints( g1: *const GEOSGeometry, g2: *const GEOSGeometry, ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Calculate the Hausdorff distance between two geometries."] - #[doc = " [Hausdorff distance](https://en.wikipedia.org/wiki/Hausdorff_distance)"] - #[doc = " is the largest distance between two geometries."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::algorithm::distance::DiscreteHausdorffDistance"] pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -3066,34 +2113,14 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Calculate a more precise Hausdorff distance between two geometries,"] - #[doc = " by densifying the inputs before computation."] - #[doc = " [Hausdorff distance](https://en.wikipedia.org/wiki/Hausdorff_distance)"] - #[doc = " is the largest distance between two geometries."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[in] densifyFrac The largest % of the overall line length that"] - #[doc = " any given two-point segment should be"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::algorithm::distance::DiscreteHausdorffDistance"] pub fn GEOSHausdorffDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Calculate the"] - #[doc = " [Frechet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance)"] - #[doc = " between two geometries,"] - #[doc = " a similarity measure for linear features."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::algorithm::distance::DiscreteFrechetDistance"] pub fn GEOSFrechetDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -3101,635 +2128,224 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Calculate the"] - #[doc = " [Frechet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance)"] - #[doc = " between two geometries,"] - #[doc = " a similarity measure for linear features. For more precision, first"] - #[doc = " densify the inputs."] - #[doc = " \\param[in] g1 Input geometry"] - #[doc = " \\param[in] g2 Input geometry"] - #[doc = " \\param[in] densifyFrac The largest % of the overall line length that"] - #[doc = " any given two-point segment should be"] - #[doc = " \\param[out] dist Pointer to be filled in with distance result"] - #[doc = " \\return 1 on success, 0 on exception."] - #[doc = " \\see geos::algorithm::distance::DiscreteFrechetDistance"] pub fn GEOSFrechetDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Distance of point projected onto line from the start of the line."] - #[doc = " \\param line linear target of projection"] - #[doc = " \\param point point to be projected onto 'g'"] - #[doc = " \\return distance along line that point projects to, -1 on exception"] - #[doc = ""] - #[doc = " \\note Line parameter must be a LineString."] pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; } extern "C" { - #[doc = " Measuring from start of line, return point that is distance"] - #[doc = " the start. Line parameter must be a LineString."] - #[doc = " The returned point is not guaranteed to intersect the line due to limitations"] - #[doc = " of floating point calculations."] - #[doc = " \\param line linear target of projection"] - #[doc = " \\param d distance from start of line to created point"] - #[doc = " \\return The point \\ref GEOSGeometry that is distance from the start of line."] - #[doc = " Caller takes ownership of returned geometry."] - pub fn GEOSInterpolate(line: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Project point to line and calculate the **proportion** of"] - #[doc = " the line the point is from the start. For example, a point that"] - #[doc = " projects to the middle of a line would be return 0.5."] - #[doc = " \\param line linear target of projection"] - #[doc = " \\param point the point to project"] - #[doc = " \\return The proportion of the overall line length that the projected"] - #[doc = " point falls at."] + pub fn GEOSInterpolate(line: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; } extern "C" { - #[doc = " Measuring from start of line, return point that is a proportion"] - #[doc = " the start. Line parameter must be a LineString."] - #[doc = " \\param line linear target of projection"] - #[doc = " \\param proportion The proportion from the start of line to created point"] - #[doc = " \\return The point \\ref GEOSGeometry that is distance from the start of line."] - #[doc = " Caller takes ownership of returned geometry."] pub fn GEOSInterpolateNormalized( line: *const GEOSGeometry, - proportion: f64, + proportion: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the intersection of two geometries: the set of points"] - #[doc = " that fall within **both** geometries."] - #[doc = " \\param g1 one of the geometries"] - #[doc = " \\param g2 the other geometry"] - #[doc = " \\return A newly allocated geometry of the intersection. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the intersection of two geometries: the set of points"] - #[doc = " that fall within **both** geometries. All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param g1 one of the geometries"] - #[doc = " \\param g2 the other geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the intersection. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSIntersectionPrec( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the difference of two geometries A and B: the set of points"] - #[doc = " that fall within A but **not** within B."] - #[doc = " \\param ga the base geometry"] - #[doc = " \\param gb the geometry to subtract from it"] - #[doc = " \\return A newly allocated geometry of the difference. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the difference of two geometries A and B: the set of points"] - #[doc = " that fall within A but **not** within B."] - #[doc = " All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param ga one of the geometries"] - #[doc = " \\param gb the other geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the difference. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSDifferencePrec( ga: *const GEOSGeometry, gb: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the symmetric difference of two geometries A and B: the set of points"] - #[doc = " that fall in A but **not** within B and the set of points that fall in B but"] - #[doc = " **not** in A."] - #[doc = " \\param ga geometry A"] - #[doc = " \\param gb geometry B"] - #[doc = " \\return A newly allocated geometry of the symmetric difference. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSSymDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the symmetric difference of two geometries A and B: the set of points"] - #[doc = " that fall in A but **not** within B and the set of points that fall in B but"] - #[doc = " **not** in A."] - #[doc = " All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param ga one of the geometries"] - #[doc = " \\param gb the other geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the symmetric difference. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSSymDifferencePrec( ga: *const GEOSGeometry, gb: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the union of two geometries A and B: the set of points"] - #[doc = " that fall in A **or** within B."] - #[doc = " \\param ga geometry A"] - #[doc = " \\param gb geometry B"] - #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSUnion(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the union of two geometries A and B: the set of points"] - #[doc = " that fall in A **or** within B."] - #[doc = " All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param ga one of the geometries"] - #[doc = " \\param gb the other geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSUnionPrec( ga: *const GEOSGeometry, gb: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the union of all components of a single geometry. Usually"] - #[doc = " used to convert a collection into the smallest set of polygons"] - #[doc = " that cover the same area."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the union of all components of a single geometry. Usually"] - #[doc = " used to convert a collection into the smallest set of polygons"] - #[doc = " that cover the same area."] - #[doc = " All the vertices of the output"] - #[doc = " geometry must fall on the grid defined by the gridSize, and the"] - #[doc = " output will be a valid geometry."] - #[doc = " \\param g input geometry"] - #[doc = " \\param gridSize the cell size of the precision grid"] - #[doc = " \\return A newly allocated geometry of the union. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] - pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Optimized union algorithm for polygonal inputs that are correctly"] - #[doc = " noded and do not overlap. It will generate an error (return NULL)"] - #[doc = " for inputs that do not satisfy this constraint."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A geometry that covers all the points of the input geometry."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] + pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Intersection optimized for a rectangular clipping polygon."] - #[doc = " Supposed to be faster than using GEOSIntersection(). Not"] - #[doc = " guaranteed to return valid results."] - #[doc = " \\param g The input geometry to be clipped"] - #[doc = " \\param xmin Left bound of clipping rectangle"] - #[doc = " \\param ymin Lower bound of clipping rectangle"] - #[doc = " \\param xmax Right bound of clipping rectangle"] - #[doc = " \\param ymax Upper bound of clipping rectangle"] - #[doc = " \\return The clipped geometry or NULL on exception"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::intersection::RectangleIntersection"] pub fn GEOSClipByRect( g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Find paths shared between the two given lineal geometries."] - #[doc = ""] - #[doc = " Returns a GeometryCollection having two elements:"] - #[doc = ""] - #[doc = " - first element is a MultiLineString containing shared paths"] - #[doc = " having the _same_ direction on both inputs"] - #[doc = " - second element is a MultiLineString containing shared paths"] - #[doc = " having the _opposite_ direction on the two inputs"] - #[doc = ""] - #[doc = " \\param g1 An input geometry"] - #[doc = " \\param g2 An input geometry"] - #[doc = " \\return The shared paths"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::sharedpaths::SharedPathsOp"] pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Buffer a geometry."] - #[doc = " \\param g The input geometry to be buffered."] - #[doc = " \\param width The distance by which to expand the geometry (or contract)"] - #[doc = " if the value is negative."] - #[doc = " \\param quadsegs The number of segments per quadrant to generate. More"] - #[doc = " segments provides a more \"precise\" buffer at the expense of size."] - #[doc = " \\return A \\ref GEOSGeometry of the buffered result."] - #[doc = " NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSBuffer( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Create a default GEOSBufferParams object for controlling the shape"] - #[doc = " of buffered generated by \\ref GEOSBuffer."] - #[doc = " \\return A newly allocated GEOSBufferParams. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSBufferParams_destroy()."] pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; } extern "C" { - #[doc = " Destroy a GEOSBufferParams and free all associated memory."] - #[doc = " \\param parms The object to destroy."] pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); } extern "C" { - #[doc = " Set the end cap type of a GEOSBufferParams to the desired style,"] - #[doc = " which must be one enumerated in \\ref GEOSBufCapStyles."] - #[doc = " \\return 0 on exception, 1 on success."] pub fn GEOSBufferParams_setEndCapStyle( p: *mut GEOSBufferParams, style: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Set the join type of a GEOSBufferParams to the desired style,"] - #[doc = " which must be one enumerated in \\ref GEOSBufJoinStyles."] - #[doc = " \\return 0 on exception, 1 on success."] pub fn GEOSBufferParams_setJoinStyle( p: *mut GEOSBufferParams, joinStyle: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Set the mitre limit of a GEOSBufferParams to the desired size."] - #[doc = " For acute angles, a mitre join can extend very very far from"] - #[doc = " the input geometry, which is probably not desired. The"] - #[doc = " mitre limit places an upper bound on that."] - #[doc = " \\param p The GEOSBufferParams to operate on"] - #[doc = " \\param mitreLimit The limit to set"] - #[doc = " \\return 0 on exception, 1 on success."] - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) -> libc::c_int; } extern "C" { - #[doc = " Set the number of segments to use to stroke each quadrant"] - #[doc = " of circular arcs generated by the buffering process. More"] - #[doc = " segments means a smoother output, but with larger size."] - #[doc = " \\param p The GEOSBufferParams to operate on"] - #[doc = " \\param quadSegs Number of segments per quadrant"] - #[doc = " \\return 0 on exception, 1 on success."] pub fn GEOSBufferParams_setQuadrantSegments( p: *mut GEOSBufferParams, quadSegs: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Sets whether the computed buffer should be single-sided."] - #[doc = " A single-sided buffer is constructed on only one side of each input line."] - #[doc = " \\see geos::operation::buffer::BufferParameters::setSingleSided"] - #[doc = " \\param p The GEOSBufferParams to operate on"] - #[doc = " \\param singleSided Set to 1 for single-sided output 0 otherwise"] - #[doc = " \\return 0 on exception, 1 on success."] pub fn GEOSBufferParams_setSingleSided( p: *mut GEOSBufferParams, singleSided: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " Generates a buffer using the special parameters in the GEOSBufferParams"] - #[doc = " \\param g The geometry to buffer"] - #[doc = " \\param p The parameters to apply to the buffer process"] - #[doc = " \\param width The buffer distance"] - #[doc = " \\return The buffered geometry, or NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSBufferWithParams( g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Generate a buffer using the provided style parameters."] - #[doc = " \\param g The geometry to buffer"] - #[doc = " \\param width Width of the buffer"] - #[doc = " \\param quadsegs Number of segments per quadrant"] - #[doc = " \\param endCapStyle See \\ref GEOSBufCapStyles"] - #[doc = " \\param joinStyle See \\ref GEOSBufJoinStyles"] - #[doc = " \\param mitreLimit See GEOSBufferParams_setMitreLimit"] - #[doc = " \\return The buffered geometry, or NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSBufferWithStyle( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Generates offset curve line(s) for a geometry."] - #[doc = " Handles all geometry types as input."] - #[doc = ""] - #[doc = " - For a LineString the result is a LineString."] - #[doc = " - For a Point the result is an empty LineString."] - #[doc = " - For a Polygon the result is the boundary lines(s) of the polygon buffered to the offset distance"] - #[doc = " (which may be a MultiLineString)."] - #[doc = " - For a collection the result is a collection of the element offset curves."] - #[doc = " \\param g The linear geometry to offset from"] - #[doc = " \\param width Distance to offset from the curve."] - #[doc = " Negative for a right-side offset."] - #[doc = " Positive for a left-side offset."] - #[doc = " \\param quadsegs Number of segments per quadrant"] - #[doc = " \\param joinStyle See \\ref GEOSBufJoinStyles"] - #[doc = " \\param mitreLimit See GEOSBufferParams_setMitreLimit"] - #[doc = " \\return The offset geometry. Returns NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::buffer::BufferBuilder::bufferLineSingleSided"] pub fn GEOSOffsetCurve( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns minimum rectangular polygon that contains the geometry."] - #[doc = " \\param g The geometry to calculate an envelope for"] - #[doc = " \\return A newly allocated polygonal envelope. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the \"boundary\" of a geometry, as defined by the DE9IM:"] - #[doc = ""] - #[doc = " - the boundary of a polygon is the linear rings dividing the exterior"] - #[doc = " from the interior"] - #[doc = " - the boundary of a linestring is the end points"] - #[doc = " - the boundary of a point is the point"] - #[doc = ""] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the boundary. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns convex hull of a geometry. The smallest convex Geometry"] - #[doc = " that contains all the points in the input Geometry"] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the convex hull. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::overlayng::OverlayNG"] pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns \"concave hull\" of a geometry. The concave hull is fully"] - #[doc = " contained within the convex hull and also contains all the"] - #[doc = " points of the input, but in a smaller area."] - #[doc = " The area ratio is the ratio"] - #[doc = " of the area of the convex hull and the concave hull. Frequently"] - #[doc = " used to convert a multi-point into a polygonal area."] - #[doc = " that contains all the points in the input Geometry"] - #[doc = " \\param g The input geometry"] - #[doc = " \\param ratio The ratio value, between 0 and 1."] - #[doc = " \\param allowHoles When non-zero, the polygonal output may contain holes."] - #[doc = " \\return A newly allocated geometry of the concave hull. NULL on exception."] - #[doc = " The area ratio is the ratio of the concave hull area to the convex hull area."] - #[doc = " 1 produces the convex hull; 0 produces maximum concaveness."] - #[doc = " The Length Ratio is a fraction determining the length of the longest"] - #[doc = " edge in the computed hull. 1 produces the convex hull;"] - #[doc = " 0 produces a hull with maximum concaveness"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::hull::ConcaveHull"] pub fn GEOSConcaveHull( g: *const GEOSGeometry, - ratio: f64, + ratio: libc::c_double, allowHoles: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Computes a boundary-respecting hull of a polygonal geometry,"] - #[doc = " with hull shape determined by a target parameter"] - #[doc = " specifying the fraction of the input vertices retained in the result."] - #[doc = " Larger values produce less concave results."] - #[doc = " A value of 1 produces the convex hull; a value of 0 produces the original geometry."] - #[doc = " An outer hull is computed if the parameter is positive,"] - #[doc = " an inner hull is computed if it is negative."] - #[doc = ""] - #[doc = " \\param g the polygonal geometry to process"] - #[doc = " \\param isOuter indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner)"] - #[doc = " \\param vertexNumFraction the target fraction of the count of input vertices to retain in result"] - #[doc = " \\return A newly allocated geometry of the concave hull. NULL on exception."] - #[doc = ""] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::simplify::PolygonHullSimplifier"] pub fn GEOSPolygonHullSimplify( g: *const GEOSGeometry, isOuter: libc::c_uint, - vertexNumFraction: f64, + vertexNumFraction: libc::c_double, ) -> *mut GEOSGeometry; } -#[doc = " See geos::simplify::PolygonHullSimplifier::hull()"] pub const GEOSPolygonHullParameterModes_GEOSHULL_PARAM_VERTEX_RATIO: GEOSPolygonHullParameterModes = 1; -#[doc = " See geos::simplify::PolygonHullSimplifier::hullByAreaDelta()"] pub const GEOSPolygonHullParameterModes_GEOSHULL_PARAM_AREA_RATIO: GEOSPolygonHullParameterModes = 2; -#[doc = " Controls the behavior of the GEOSPolygonHullSimplify parameter."] pub type GEOSPolygonHullParameterModes = libc::c_uint; extern "C" { - #[doc = " Computes a topology-preserving simplified hull of a polygonal geometry,"] - #[doc = " with hull shape determined by the parameter, controlled by a parameter"] - #[doc = " mode, which is one defined in GEOSPolygonHullParameterModes. In general,"] - #[doc = " larger values compute less concave results and value of 0"] - #[doc = " produces the original geometry."] - #[doc = " Either outer or inner hulls can be computed."] - #[doc = ""] - #[doc = " \\param g the polygonal geometry to process"] - #[doc = " \\param isOuter indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner)"] - #[doc = " \\param parameterMode the interpretation to apply to the parameter argument"] - #[doc = " \\param parameter the target ratio of area difference to original area"] - #[doc = " \\return A newly allocated geometry of the concave hull. NULL on exception."] - #[doc = ""] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::simplify::PolygonHullSimplifier"] pub fn GEOSPolygonHullSimplifyMode( g: *const GEOSGeometry, isOuter: libc::c_uint, parameterMode: libc::c_uint, - parameter: f64, + parameter: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Constructs a concave hull of a set of polygons, respecting"] - #[doc = " the polygons as constraints."] - #[doc = ""] - #[doc = " A concave hull is a possibly non-convex polygon containing all the input polygons."] - #[doc = " A given set of polygons has a sequence of hulls of increasing concaveness,"] - #[doc = " determined by a numeric target parameter."] - #[doc = " The computed hull \"fills the gap\" between the polygons,"] - #[doc = " and does not intersect their interior."] - #[doc = ""] - #[doc = " The concave hull is constructed by removing the longest outer edges"] - #[doc = " of the Delaunay Triangulation of the space between the polygons,"] - #[doc = " until the target criterion parameter is reached."] - #[doc = ""] - #[doc = " \"Maximum Edge Length\" constrains the length of the longest edge between the polygons to be no larger than this value."] - #[doc = ""] - #[doc = " \\param g the valid MultiPolygon geometry to process"] - #[doc = " \\param lengthRatio determine the Maximum Edge Length as a"] - #[doc = " fraction of the difference between the longest and"] - #[doc = " shortest edge lengths between the polygons."] - #[doc = " This normalizes the Maximum Edge Length to be scale-free."] - #[doc = " A value of 1 produces the convex hull; a value of 0 produces"] - #[doc = " the original polygons."] - #[doc = " \\param isHolesAllowed is the concave hull allowed to contain holes?"] - #[doc = " \\param isTight does the hull follow the outer boundaries of the input polygons."] - #[doc = " \\return A newly allocated geometry of the concave hull. NULL on exception."] - #[doc = ""] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::hull::ConcaveHullOfPolygons"] - #[doc = ""] - #[doc = " The input polygons *must* form a *valid* MultiPolygon"] - #[doc = " (i.e. they must be non-overlapping)."] pub fn GEOSConcaveHullOfPolygons( g: *const GEOSGeometry, - lengthRatio: f64, + lengthRatio: libc::c_double, isTight: libc::c_uint, isHolesAllowed: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the minimum rotated rectangular POLYGON which encloses"] - #[doc = " the input geometry. The rectangle has width equal to the"] - #[doc = " minimum diameter, and a longer length. If the convex hill of"] - #[doc = " the input is degenerate (a line or point) a linestring or point"] - #[doc = " is returned. The minimum rotated rectangle can be used as an"] - #[doc = " extremely generalized representation for the given geometry."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the rotated envelope. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Constructs the \"maximum inscribed circle\" (MIC) for a polygonal geometry,"] - #[doc = " up to a specified tolerance."] - #[doc = " The MIC is determined by a point in the interior of the area"] - #[doc = " which has the farthest distance from the area boundary, along with a boundary point at that distance."] - #[doc = " In the context of geography the center of the MIC is known as the"] - #[doc = " \"pole of inaccessibility\". A cartographic use case is to determine a suitable point"] - #[doc = " to place a map label within a polygon."] - #[doc = " The radius length of the MIC is a measure of how \"narrow\" a polygon is. It is the"] - #[doc = " distance at which the negative buffer becomes empty."] - #[doc = " The class supports polygons with holes and multipolygons."] - #[doc = " The implementation uses a successive-approximation technique over a grid of square cells covering the area geometry."] - #[doc = " The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant"] - #[doc = " way by using spatial indexes."] - #[doc = " Returns a two-point linestring, with one point at the center of the inscribed circle and the other"] - #[doc = " on the boundary of the inscribed circle."] - #[doc = " \\param g Input geometry"] - #[doc = " \\param tolerance Stop the algorithm when the search area is smaller than this tolerance"] - #[doc = " \\return A newly allocated geometry of the MIC. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::construct::MaximumInscribedCircle"] - pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Constructs the \"largest empty circle\" (LEC) for a set of obstacle geometries, up to a"] - #[doc = " specified tolerance. The obstacles are point and line geometries. Polygonal obstacles willl"] - #[doc = " be treated as linear features."] - #[doc = " The LEC is the largest circle which has its **center** inside the boundary,"] - #[doc = " and whose interior does not intersect with any obstacle. If no boundary is provided, the"] - #[doc = " convex hull of the obstacles is used as the boundary."] - #[doc = " The LEC center is the point in the interior of the boundary which has the farthest distance from"] - #[doc = " the obstacles (up to tolerance). The LEC is determined by the center point and a point lying on an"] - #[doc = " obstacle indicating the circle radius."] - #[doc = " The implementation uses a successive-approximation technique over a grid of square cells covering the obstacles and boundary."] - #[doc = " The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant"] - #[doc = " way by using spatial indexes."] - #[doc = " Returns a two-point linestring, with the start point at the center of the inscribed circle and the end"] - #[doc = " on the boundary of the inscribed circle."] - #[doc = " \\param obstacles The geometries that the LEC must fit within without covering"] - #[doc = " \\param boundary The area within which the LEC must reside"] - #[doc = " \\param tolerance Stop the algorithm when the search area is smaller than this tolerance"] - #[doc = " \\return A newly allocated geometry of the LEC. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::construct::LargestEmptyCircle"] + pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSLargestEmptyCircle( obstacles: *const GEOSGeometry, boundary: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns a linestring geometry which represents the minimum diameter of the geometry."] - #[doc = " The minimum diameter is defined to be the width of the smallest band that"] - #[doc = " contains the geometry, where a band is a strip of the plane defined"] - #[doc = " by two parallel lines. This can be thought of as the smallest hole that the geometry"] - #[doc = " can be moved through, with a single rotation."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A newly allocated geometry of the LEC. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::MinimumDiameter"] pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns a point that is inside the boundary of a polygonal geometry."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A point that is inside the input"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::InteriorPointArea"] pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns a point at the center of mass of the input."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return A point at the center of mass of the input"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::Centroid"] pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns a geometry which represents the \"minimum bounding circle\","] - #[doc = " the smallest circle that contains the input."] - #[doc = " \\param[in] g The input geometry"] - #[doc = " \\param[out] radius Pointer will be filled with output radius."] - #[doc = " \\param[out] center Pointer will be filled with output circle center. Caller must free."] - #[doc = " \\return The circle geometry or NULL on exception"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::algorithm::MinimumBoundingCircle::getCircle"] pub fn GEOSMinimumBoundingCircle( g: *const GEOSGeometry, radius: *mut f64, @@ -3737,142 +2353,45 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return a Delaunay triangulation of the vertices of the given geometry."] - #[doc = ""] - #[doc = " \\param g the input geometry whose vertices will be used as \"sites\""] - #[doc = " \\param tolerance optional snapping tolerance to use for improved robustness"] - #[doc = " \\param onlyEdges if non-zero will return a MultiLineString, otherwise it will"] - #[doc = " return a GeometryCollection containing triangular Polygons."] - #[doc = ""] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSDelaunayTriangulation( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return a constrained Delaunay triangulation of the vertices of the"] - #[doc = " given polygon(s)."] - #[doc = " For non-polygonal inputs, returns an empty geometry collection."] - #[doc = ""] - #[doc = " \\param g the input geometry whose rings will be used as input"] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSConstrainedDelaunayTriangulation(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Returns the Voronoi polygons of the vertices of the given geometry."] - #[doc = ""] - #[doc = " \\param g the input geometry whose vertices will be used as sites."] - #[doc = " \\param tolerance snapping tolerance to use for improved robustness"] - #[doc = " \\param onlyEdges whether to return only edges of the voronoi cells"] - #[doc = " \\param env clipping envelope for the returned diagram, automatically"] - #[doc = " determined if env is NULL."] - #[doc = " The diagram will be clipped to the larger"] - #[doc = " of this envelope or an envelope surrounding the sites."] - #[doc = ""] - #[doc = " \\return A newly allocated geometry. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSVoronoiDiagram( g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " For linear inputs, returns a new geometry in which no lines cross"] - #[doc = " each other, and all touching occurs at end points."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return The noded geometry or NULL on exception"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::noding::GeometryNoder::node"] pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Polygonizes a set of Geometries which contain linework that"] - #[doc = " represents the edges of a planar graph."] - #[doc = ""] - #[doc = " All types of Geometry are accepted as input; the constituent"] - #[doc = " linework is extracted as the edges to be polygonized."] - #[doc = ""] - #[doc = " The edges must be correctly noded; that is, they must only meet"] - #[doc = " at their endpoints. Polygonization will accept incorrectly noded"] - #[doc = " input but will not form polygons from non-noded edges, and reports"] - #[doc = " them as errors."] - #[doc = ""] - #[doc = " The Polygonizer reports the following kinds of errors:"] - #[doc = ""] - #[doc = " - Dangles - edges which have one or both ends which are"] - #[doc = " not incident on another edge endpoint"] - #[doc = " - Cut Edges - edges which are connected at both ends but"] - #[doc = " which do not form part of a polygon"] - #[doc = " - Invalid Ring Lines - edges which form rings which are invalid"] - #[doc = " (e.g. the component lines contain a self-intersection)"] - #[doc = ""] - #[doc = " Errors are reported to output parameters \"cuts\", \"dangles\" and"] - #[doc = " \"invalid\" (if not-null). Formed polygons are returned as a"] - #[doc = " collection. NULL is returned on exception. All returned"] - #[doc = " geometries must be destroyed by caller."] - #[doc = ""] - #[doc = " The GEOSPolygonize_valid() variant allows extracting only polygons"] - #[doc = " which form a valid polygonal result. The set of extracted polygons"] - #[doc = " is guaranteed to be edge-disjoint. This is useful when it is known"] - #[doc = " that the input lines form a valid polygonal geometry (which may"] - #[doc = " include holes or nested polygons)."] - #[doc = ""] - #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] - #[doc = " \\param ngeoms Size of the geoms array."] - #[doc = " \\return The polygonal output geometry."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::Polygonizer"] pub fn GEOSPolygonize( geoms: *const *const GEOSGeometry, ngeoms: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Same polygonizing behavior as GEOSPolygonize(), but only returning results"] - #[doc = " that are valid."] - #[doc = ""] - #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] - #[doc = " \\param ngeoms Size of the geoms array."] - #[doc = " \\return The polygonal output geometry."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::Polygonizer"] pub fn GEOSPolygonize_valid( geoms: *const *const GEOSGeometry, ngeoms: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Perform the polygonization as GEOSPolygonize() but return only the"] - #[doc = " \"cut edges\", the linear features that are connected at both ends,"] - #[doc = " do *not* participate in the final polygon."] - #[doc = ""] - #[doc = " \\param geoms Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects."] - #[doc = " \\param ngeoms Size of the geoms array."] - #[doc = " \\return The \"cut edges\""] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::Polygonizer"] pub fn GEOSPolygonizer_getCutEdges( geoms: *const *const GEOSGeometry, ngeoms: libc::c_uint, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Perform the polygonization as GEOSPolygonize() and return the"] - #[doc = " polygonal result as well as all extra ouputs."] - #[doc = ""] - #[doc = " \\param[in] input A single geometry with all the input lines to polygonize."] - #[doc = " \\param[out] cuts Pointer to hold \"cut edges\", connected on both ends but not part of output. Caller must free."] - #[doc = " \\param[out] dangles Pointer to hold \"dangles\", connected one end but not part of output. Caller must free."] - #[doc = " \\param[out] invalid Pointer to hold invalid outputs, polygons formed but not valid. Caller must free."] - #[doc = " \\return The polygonal valid output"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::Polygonizer"] pub fn GEOSPolygonize_full( input: *const GEOSGeometry, cuts: *mut *mut GEOSGeometry, @@ -3881,107 +2400,33 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Perform a polygonization using all the linework, assuming that"] - #[doc = " rings contained within rings are empty holes, rather then"] - #[doc = " extra polygons."] - #[doc = " \\param g The input linework"] - #[doc = " \\return The polygonal output"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::polygonize::BuildArea"] pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Densifies a geometry using a given distance tolerance."] - #[doc = " Additional vertices will be added to every line segment"] - #[doc = " that is greater this tolerance; these vertices will"] - #[doc = " evenly subdivide that segment."] - #[doc = " Only linear components of input geometry are densified."] - #[doc = " \\param g The geometry to densify"] - #[doc = " \\param tolerance the distance tolerance to densify"] - #[doc = " \\return The densified geometry, or NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - pub fn GEOSDensify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Sews together a set of fully noded LineStrings"] - #[doc = " removing any cardinality 2 nodes in the linework."] - #[doc = " \\param g The input linework"] - #[doc = " \\return The merged linework"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::linemerge::LineMerger"] + pub fn GEOSDensify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Sews together a set of fully noded LineStrings"] - #[doc = " removing any cardinality 2 nodes in the linework"] - #[doc = " only if possible without changing order of points."] - #[doc = " \\param g The input linework"] - #[doc = " \\return The merged linework"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::operation::linemerge::LineMerger"] pub fn GEOSLineMergeDirected(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " For geometries with coordinate sequences, reverses the order"] - #[doc = " of the sequences. Converts CCW rings to CW. Reverses direction"] - #[doc = " of LineStrings."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return The reversed geometry"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Apply the"] - #[doc = " [Douglas/Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)"] - #[doc = " to the coordinate sequences of the input geometry."] - #[doc = " Removes \"unnecessary\" vertices, vertices"] - #[doc = " that are co-linear within the tolerance distance."] - #[doc = " \\param g The input geometry"] - #[doc = " \\param tolerance The tolerance to apply. Larger tolerance leads to simpler output."] - #[doc = " \\return The simplified geometry"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::simplify::DouglasPeuckerSimplifier"] - pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " Apply the"] - #[doc = " [Douglas/Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)"] - #[doc = " to the coordinate sequences of the input geometry."] - #[doc = " Removes \"unnecessary\" vertices, vertices"] - #[doc = " that are co-linear within the tolerance distance."] - #[doc = " Returns a valid output geometry, checking for collapses, ring-intersections, etc"] - #[doc = " and attempting to avoid. More computationally expensive than GEOSSimplify()"] - #[doc = " \\param g The input geometry"] - #[doc = " \\param tolerance The tolerance to apply. Larger tolerance leads to simpler output."] - #[doc = " \\return The simplified geometry"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] - #[doc = " \\see geos::simplify::DouglasPeuckerSimplifier"] + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { pub fn GEOSTopologyPreserveSimplify( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Return all distinct vertices of input geometry as a MultiPoint."] - #[doc = " Note that only 2 dimensions of the vertices are considered when"] - #[doc = " testing for equality."] - #[doc = " \\param g The input geometry"] - #[doc = " \\return The distinct points"] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Calculate the"] - #[doc = " [Hilbert code](https://en.wikipedia.org/wiki/Hilbert_curve)"] - #[doc = " of the centroid of a geometry relative to an extent."] - #[doc = " This allows sorting geometries in a deterministic way, such that similar Hilbert codes are"] - #[doc = " likely to be near each other in two-dimensional space."] - #[doc = " The caller must ensure that the geometry is contained within the extent."] - #[doc = " \\param[in] geom Input geometry, must be non-empty"] - #[doc = " \\param[in] extent Extent within which to calculate the Hilbert code for geom"] - #[doc = " \\param[in] level The level of precision of the Hilbert curve, up to 16"] - #[doc = " \\param[out] code Pointer to be filled in with Hilbert code result"] - #[doc = " \\return 1 on success, 0 on exception."] pub fn GEOSHilbertCode( geom: *const GEOSGeometry, extent: *const GEOSGeometry, @@ -3990,16 +2435,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Apply XY coordinate transform callback to all coordinates in a copy of"] - #[doc = " input geometry. If the callback returns an error, returned geometry will be"] - #[doc = " NULL. Z values, if present, are not modified by this function."] - #[doc = " \\param[in] g Input geometry"] - #[doc = " \\param[in] callback a function to be executed for each coordinate in the"] - #[doc = "geometry. The callback takes 3 parameters: x and y coordinate"] - #[doc = "values to be updated and a void userdata pointer."] - #[doc = " \\param userdata an optional pointer to pe passed to 'callback' as an argument"] - #[doc = " \\return a copy of the input geometry with transformed coordinates."] - #[doc = " Caller must free with GEOSGeom_destroy()."] pub fn GEOSGeom_transformXY( g: *const GEOSGeometry, callback: GEOSTransformXYCallback, @@ -4007,166 +2442,57 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Snap first geometry onto second within the given tolerance."] - #[doc = " \\param input An input geometry"] - #[doc = " \\param snap_target A geometry to snap the input to"] - #[doc = " \\param tolerance Snapping tolerance"] - #[doc = " \\return The snapped verion of the input. NULL on exception."] - #[doc = " Caller is responsible for freeing with GEOSGeom_destroy()."] pub fn GEOSSnap( input: *const GEOSGeometry, snap_target: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Change the coordinate precision of a geometry. This will"] - #[doc = " affect the precision of the existing geometry as well as"] - #[doc = " any geometries derived from this geometry using overlay"] - #[doc = " functions. The output will be a valid \\ref GEOSGeometry."] - #[doc = ""] - #[doc = " Note that operations will always be performed in the precision"] - #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] - #[doc = " That same precision will be attached to the operation outputs."] - #[doc = ""] - #[doc = " In the Default and GEOS_PREC_KEEP_COLLAPSED modes invalid input"] - #[doc = " may cause an error to occur, unless the invalidity is below"] - #[doc = " the scale of the requested precision"] - #[doc = ""] - #[doc = " There are only 3 modes. The GEOS_PREC_NO_TOPO mode"] - #[doc = " takes precedence over GEOS_PREC_KEEP_COLLAPSED."] - #[doc = " So the combination GEOS_PREC_NO_TOPO || GEOS_PREC_KEEP_COLLAPSED"] - #[doc = " has the same semantics as GEOS_PREC_NO_TOPO"] - #[doc = ""] - #[doc = " \\param g Input geometry"] - #[doc = " \\param gridSize cell size of grid to round coordinates to,"] - #[doc = " or 0 for FLOATING precision"] - #[doc = " \\param flags The bitwise OR of members of the \\ref GEOSPrecisionRules enum"] - #[doc = " \\return The precision reduced result."] - #[doc = " Caller must free with GEOSGeom_destroy()"] - #[doc = " NULL on exception."] pub fn GEOSGeom_setPrecision( g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " True if no point of either geometry touchess or is within the other."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::disjoint"] pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries share boundaries at one or more points, but do"] - #[doc = " not have interior overlaps."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::touches"] pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries are not disjoint."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::intersects"] pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries interiors interact but their boundares do not."] - #[doc = " Most useful for finding line crosses cases."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::crosses"] pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometry g1 is completely within g2, and not"] - #[doc = " touching the boundary of g2."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::within"] pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometry g2 is completely within g1."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::contains"] pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries share interiors but are neither"] - #[doc = " within nor contained."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::overlaps"] pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometries cover the same space on the place."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::equals"] pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometry g1 is completely within g2, including possibly"] - #[doc = " touching the boundary of g2."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::covers"] pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " True if geometry g2 is completely within g1, including possibly"] - #[doc = " touching the boundary of g1."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see geos::geom::Geometry::coveredby"] pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Determine pointwise equivalence of two geometries, by"] - #[doc = " checking that they have identical structure"] - #[doc = " and that each vertex of g2 is"] - #[doc = " within the distance tolerance of the corresponding vertex in g1."] - #[doc = " Unlike GEOSEquals(), geometries that are topologically equivalent but have different"] - #[doc = " representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not"] - #[doc = " considered equal by GEOSEqualsExact()."] - #[doc = " \\param g1 Input geometry"] - #[doc = " \\param g2 Input geometry"] - #[doc = " \\param tolerance Tolerance to determine vertex equality"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSNormalize()"] pub fn GEOSEqualsExact( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " Calculate the DE9IM pattern for this geometry pair"] - #[doc = " and compare against the provided pattern to check for"] - #[doc = " consistency. If the result and pattern are consistent"] - #[doc = " return true. The pattern may include glob \"*\" characters"] - #[doc = " for portions that are allowed to match any value."] - #[doc = " \\see geos::geom::Geometry::relate"] - #[doc = " \\param g1 First geometry in pair"] - #[doc = " \\param g2 Second geometry in pair"] - #[doc = " \\param pat DE9IM pattern to check"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSRelatePattern( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -4174,35 +2500,15 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Calculate and return the DE9IM pattern for this geometry pair."] - #[doc = " \\see geos::geom::Geometry::relate"] - #[doc = " \\param g1 First geometry in pair"] - #[doc = " \\param g2 Second geometry in pair"] - #[doc = " \\return DE9IM string. Caller is responsible for freeing with GEOSFree()."] - #[doc = " NULL on exception"] pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { - #[doc = " Compare two DE9IM patterns and return true if they"] - #[doc = " are consistent."] - #[doc = " \\param mat Complete DE9IM string (does not have \"*\")"] - #[doc = " \\param pat Pattern to match to (may contain \"*\")"] - #[doc = " \\return 1 on true, 0 on false, 2 on exception"] pub fn GEOSRelatePatternMatch( mat: *const libc::c_char, pat: *const libc::c_char, ) -> libc::c_char; } extern "C" { - #[doc = " Calculate and return the DE9IM pattern for this geometry pair."] - #[doc = " Apply the supplied \\ref GEOSRelateBoundaryNodeRules."] - #[doc = " \\see geos::geom::Geometry::relate"] - #[doc = " \\see geos::algorithm::BoundaryNodeRule"] - #[doc = " \\param g1 First geometry in pair"] - #[doc = " \\param g2 Second geometry in pair"] - #[doc = " \\param bnr A member of the \\ref GEOSRelateBoundaryNodeRules enum"] - #[doc = " \\return DE9IM string. Caller is responsible for freeing with GEOSFree()."] - #[doc = " NULL on exception"] pub fn GEOSRelateBoundaryNodeRule( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -4210,168 +2516,78 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " Create a Prepared Geometry."] - #[doc = " The caller retains ownership of the base geometry, and after"] - #[doc = " processing is complete, must free **both** the prepared and the"] - #[doc = " base geometry. (Ideally, destroy the prepared geometry first, as"] - #[doc = " it has an internal reference to the base geometry.)"] - #[doc = ""] - #[doc = " \\param g The base geometry to wrap in a prepared geometry."] - #[doc = " \\return A prepared geometry. Caller is responsible for freeing with"] - #[doc = " GEOSPreparedGeom_destroy()"] pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSPreparedGeometry."] - #[doc = " Caller must separately free the base \\ref GEOSGeometry used"] - #[doc = " to create the prepared geometry."] - #[doc = " \\param g Prepared geometry to destroy."] pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry is contained."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSContains"] pub fn GEOSPreparedContains( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry is contained properly."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSContainsProperly"] pub fn GEOSPreparedContainsProperly( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry is covered by."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSCoveredBy"] pub fn GEOSPreparedCoveredBy( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry covers."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSCovers"] pub fn GEOSPreparedCovers( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedGeometry do a high performance"] - #[doc = " calculation of whether the provided geometry crosses."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSCrosses"] pub fn GEOSPreparedCrosses( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry is disjoint."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSDisjoin"] pub fn GEOSPreparedDisjoint( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry is disjoint."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSDisjoin"] pub fn GEOSPreparedIntersects( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry overlaps."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSOverlaps"] pub fn GEOSPreparedOverlaps( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry touches."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSTouches"] pub fn GEOSPreparedTouches( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation of whether the provided geometry is within."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns 1 on true, 0 on false, 2 on exception"] - #[doc = " \\see GEOSWithin"] pub fn GEOSPreparedWithin( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> libc::c_char; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDisjoint do a high performance"] - #[doc = " calculation to find the nearest points between the"] - #[doc = " prepared and provided geometry."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\returns A coordinate sequence containing the nearest points, or NULL on exception."] - #[doc = " The first point in the sequence is from the prepared geometry, and the"] - #[doc = " seconds is from the other argument."] pub fn GEOSPreparedNearestPoints( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDistance do a high performance"] - #[doc = " calculation to find the distance points between the"] - #[doc = " prepared and provided geometry. Useful for situations where"] - #[doc = " one geometry is large and static and needs to be tested"] - #[doc = " against a large number of other geometries."] - #[doc = " \\param[in] pg1 The prepared geometry"] - #[doc = " \\param[in] g2 The geometry to test"] - #[doc = " \\param[out] dist Pointer to store the result in"] - #[doc = " \\return 1 on success"] pub fn GEOSPreparedDistance( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, @@ -4379,42 +2595,16 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Using a \\ref GEOSPreparedDistanceWithin do a high performance"] - #[doc = " calculation to find whether the prepared and provided geometry"] - #[doc = " are within the given max distance."] - #[doc = " Useful for situations where"] - #[doc = " one geometry is large and static and needs to be tested"] - #[doc = " against a large number of other geometries."] - #[doc = " \\param pg1 The prepared geometry"] - #[doc = " \\param g2 The geometry to test"] - #[doc = " \\param dist The max distance"] - #[doc = " \\return 1 on success"] pub fn GEOSPreparedDistanceWithin( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: f64, + dist: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " Create a new \\ref GEOSSTRtree using the Sort-Tile-Recursive algorithm"] - #[doc = " ([STRtree](https://en.wikipedia.org/wiki/R-tree))"] - #[doc = " for two-dimensional spatial data."] - #[doc = ""] - #[doc = " \\param nodeCapacity The maximum number of child nodes that a node may have."] - #[doc = " The minimum recommended capacity value is 4."] - #[doc = " If unsure, use a default node capacity of 10."] - #[doc = " \\return a pointer to the created tree"] pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; } extern "C" { - #[doc = " Insert an item into an \\ref GEOSSTRtree"] - #[doc = ""] - #[doc = " \\param tree the \\ref GEOSSTRtree in which the item should be inserted"] - #[doc = " \\param g a GEOSGeometry whose envelope corresponds to the extent of 'item'. As of GEOS 3.9, this envelope will be"] - #[doc = " copied into the tree and the caller may destroy `g` while the tree is still in use. Before GEOS 3.9, `g`"] - #[doc = " must be retained until the tree is destroyed."] - #[doc = " \\param item the item to insert into the tree"] - #[doc = " \\note The tree does **not** take ownership of the geometry or the item."] pub fn GEOSSTRtree_insert( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, @@ -4422,14 +2612,6 @@ extern "C" { ); } extern "C" { - #[doc = " Query an \\ref GEOSSTRtree for items intersecting a specified envelope"] - #[doc = ""] - #[doc = " \\param tree the \\ref GEOSSTRtree to search"] - #[doc = " \\param g a GEOSGeomety from which a query envelope will be extracted"] - #[doc = " \\param callback a function to be executed for each item in the tree whose envelope intersects"] - #[doc = " the envelope of 'g'. The callback function should take two parameters: a void"] - #[doc = " pointer representing the located item in the tree, and a void userdata pointer."] - #[doc = " \\param userdata an optional pointer to pe passed to 'callback' as an argument"] pub fn GEOSSTRtree_query( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, @@ -4438,34 +2620,12 @@ extern "C" { ); } extern "C" { - #[doc = " Returns the nearest item in the \\ref GEOSSTRtree to the supplied geometry."] - #[doc = " All items in the tree MUST be of type \\ref GEOSGeometry."] - #[doc = " If this is not the case, use GEOSSTRtree_nearest_generic() instead."] - #[doc = ""] - #[doc = " \\param tree the \\ref GEOSSTRtree to search"] - #[doc = " \\param geom the geometry with which the tree should be queried"] - #[doc = " \\return a const pointer to the nearest \\ref GEOSGeometry in the tree to 'geom', or NULL in"] - #[doc = " case of exception"] pub fn GEOSSTRtree_nearest( tree: *mut GEOSSTRtree, geom: *const GEOSGeometry, ) -> *const GEOSGeometry; } extern "C" { - #[doc = " Returns the nearest item in the \\ref GEOSSTRtree to the supplied item"] - #[doc = ""] - #[doc = " \\param tree the STRtree to search"] - #[doc = " \\param item the item with which the tree should be queried"] - #[doc = " \\param itemEnvelope a GEOSGeometry having the bounding box of 'item'"] - #[doc = " \\param distancefn a function that can compute the distance between two items"] - #[doc = " in the STRtree. The function should return zero in case of error,"] - #[doc = " and should store the computed distance to the location pointed to by"] - #[doc = " the 'distance' argument. The computed distance between two items"] - #[doc = " must not exceed the Cartesian distance between their envelopes."] - #[doc = " \\param userdata optional pointer to arbitrary data; will be passed to distancefn"] - #[doc = " each time it is called."] - #[doc = " \\return a const pointer to the nearest item in the tree to 'item', or NULL in"] - #[doc = " case of exception"] pub fn GEOSSTRtree_nearest_generic( tree: *mut GEOSSTRtree, item: *const libc::c_void, @@ -4475,11 +2635,6 @@ extern "C" { ) -> *const libc::c_void; } extern "C" { - #[doc = " Iterate over all items in the \\ref GEOSSTRtree."] - #[doc = ""] - #[doc = " \\param tree the STRtree over which to iterate"] - #[doc = " \\param callback a function to be executed for each item in the tree."] - #[doc = " \\param userdata payload to pass the callback function."] pub fn GEOSSTRtree_iterate( tree: *mut GEOSSTRtree, callback: GEOSQueryCallback, @@ -4487,14 +2642,6 @@ extern "C" { ); } extern "C" { - #[doc = " Removes an item from the \\ref GEOSSTRtree"] - #[doc = ""] - #[doc = " \\param tree the STRtree from which to remove an item"] - #[doc = " \\param g the envelope of the item to remove"] - #[doc = " \\param item the item to remove"] - #[doc = " \\return 0 if the item was not removed;"] - #[doc = " 1 if the item was removed;"] - #[doc = " 2 if an exception occurred"] pub fn GEOSSTRtree_remove( tree: *mut GEOSSTRtree, g: *const GEOSGeometry, @@ -4502,157 +2649,78 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Frees all the memory associated with a \\ref GEOSSTRtree."] - #[doc = " Only the tree is freed. The geometries and items fed into"] - #[doc = " GEOSSTRtree_insert() are not owned by the tree, and are"] - #[doc = " still left to the caller to manage."] pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " Computes the coordinate where two line segments intersect, if any"] - #[doc = ""] - #[doc = " \\param[in] ax0 x-coordinate of 1st point in 1st segment"] - #[doc = " \\param[in] ay0 y-coordinate of 1st point in 1st segment"] - #[doc = " \\param[in] ax1 x-coordinate of 2nd point in 1st segment"] - #[doc = " \\param[in] ay1 y-coordinate of 2nd point in 1st segment"] - #[doc = " \\param[in] bx0 x-coordinate of 1st point in 2nd segment"] - #[doc = " \\param[in] by0 y-coordinate of 1st point in 2nd segment"] - #[doc = " \\param[in] bx1 x-coordinate of 2nd point in 2nd segment"] - #[doc = " \\param[in] by1 y-coordinate of 2nd point in 2nd segment"] - #[doc = " \\param[out] cx x-coordinate of intersection point"] - #[doc = " \\param[out] cy y-coordinate of intersection point"] - #[doc = ""] - #[doc = " \\return 0 on error, 1 on success, -1 if segments do not intersect"] pub fn GEOSSegmentIntersection( - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " For the points formed by the six input ordinates,"] - #[doc = " walking from A to B and then to P."] - #[doc = " \\param Ax X coordinate of A"] - #[doc = " \\param Ay Y coordinate of A"] - #[doc = " \\param Bx X coordinate of B"] - #[doc = " \\param By Y coordinate of B"] - #[doc = " \\param Px X coordinate of P"] - #[doc = " \\param Py Y coordinate of P"] - #[doc = " \\return -1 if reaching P takes a counter-clockwise (left) turn,"] - #[doc = " 1 if reaching P takes a clockwise (right) turn,"] - #[doc = " 0 if P is collinear with A-B"] pub fn GEOSOrientationIndex( - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Allocate a new \\ref GEOSWKTReader."] - #[doc = " \\returns a new reader. Caller must free with GEOSWKTReader_destroy()"] pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSWKTReader."] - #[doc = " \\param reader The reader to destroy."] pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); } extern "C" { - #[doc = " Use a reader to parse the well-known text representation of"] - #[doc = " a geometry, and return an allocated geometry."] - #[doc = " \\param reader A WKT reader object, caller retains ownership"] - #[doc = " \\param wkt The WKT string to parse, caller retains ownership"] - #[doc = " \\return A \\ref GEOSGeometry, caller to free with GEOSGeom_destroy())"] pub fn GEOSWKTReader_read( reader: *mut GEOSWKTReader, wkt: *const libc::c_char, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Allocate a new \\ref GEOSWKTWriter."] - #[doc = " \\returns a new writer. Caller must free with GEOSWKTWriter_destroy()"] pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSWKTWriter."] - #[doc = " \\param writer The writer to destroy."] pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); } extern "C" { - #[doc = " Writes out the well-known text representation of a geometry,"] - #[doc = " using the trim, rounding and dimension settings of the writer."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param g Input geometry"] - #[doc = " \\return A newly allocated string containing the WKT output or NULL on exception."] - #[doc = " Caller must free with GEOSFree()"] pub fn GEOSWKTWriter_write( writer: *mut GEOSWKTWriter, g: *const GEOSGeometry, ) -> *mut libc::c_char; } extern "C" { - #[doc = " Sets the number trimming option on a \\ref GEOSWKTWriter."] - #[doc = " With trim set to 1, the writer will strip trailing 0's from"] - #[doc = " the output coordinates. With 0, all coordinates will be"] - #[doc = " padded with 0's out to the rounding precision."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param trim The trimming behaviour to set, 1 for 'on', 0 for 'off', default 'off'"] pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); } extern "C" { - #[doc = " Sets the number places after the decimal to output in"] - #[doc = " WKT."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param precision The desired precision, default 16."] pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); } extern "C" { - #[doc = " Sets whether or not to write out XY or XYZ coordinates."] - #[doc = " Legal values are 2 or 3."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param dim The desired dimension, default 2."] pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); } extern "C" { - #[doc = " Reads the current output dimension from a \\ref GEOSWKTWriter."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\return The current dimension."] pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; } extern "C" { - #[doc = " Sets the format for 3D outputs. The \"old 3D\" format does not"] - #[doc = " include a dimensionality tag, eg. \"POINT(1 2 3)\" while the new (ISO)"] - #[doc = " format does includes a tag, eg \"POINT Z (1 2 3)\"."] - #[doc = " \\param writer A \\ref GEOSWKTWriter."] - #[doc = " \\param useOld3D True to use the old format, false is the default."] pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); } extern "C" { - #[doc = " Allocate a new \\ref GEOSWKBReader."] - #[doc = " \\returns a new reader. Caller must free with GEOSWKBReader_destroy()"] pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSWKBReader."] - #[doc = " \\param reader The reader to destroy."] pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); } extern "C" { - #[doc = " Read a geometry from a well-known binary buffer."] - #[doc = " \\param reader A \\ref GEOSWKBReader"] - #[doc = " \\param wkb A pointer to the buffer to read from"] - #[doc = " \\param size The number of bytes of data in the buffer"] - #[doc = " \\return A \\ref GEOSGeometry built from the WKB, or NULL on exception."] pub fn GEOSWKBReader_read( reader: *mut GEOSWKBReader, wkb: *const libc::c_uchar, @@ -4660,11 +2728,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Read a geometry from a **hex encoded** well-known binary buffer."] - #[doc = " \\param reader A \\ref GEOSWKBReader"] - #[doc = " \\param hex A pointer to the buffer to read from"] - #[doc = " \\param size The number of bytes of data in the buffer"] - #[doc = " \\return A \\ref GEOSGeometry built from the HEX WKB, or NULL on exception."] pub fn GEOSWKBReader_readHEX( reader: *mut GEOSWKBReader, hex: *const libc::c_uchar, @@ -4672,22 +2735,12 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Allocate a new \\ref GEOSWKBWriter."] - #[doc = " \\returns a new writer. Caller must free with GEOSWKBWriter_destroy()"] pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSWKBWriter."] - #[doc = " \\param writer The writer to destroy."] pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); } extern "C" { - #[doc = " Write out the WKB representation of a geometry."] - #[doc = " \\param writer The \\ref GEOSWKBWriter controlling the"] - #[doc = " writing."] - #[doc = " \\param g Geometry to convert to WKB"] - #[doc = " \\param size Pointer to write the size of the final output WKB to"] - #[doc = " \\return The WKB representation. Caller must free with GEOSFree()"] pub fn GEOSWKBWriter_write( writer: *mut GEOSWKBWriter, g: *const GEOSGeometry, @@ -4695,12 +2748,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Write out the **hex** WKB representation of a geometry."] - #[doc = " \\param writer The \\ref GEOSWKBWriter controlling the"] - #[doc = " writing."] - #[doc = " \\param g Geometry to convert to WKB"] - #[doc = " \\param size Pointer to write the size of the final output WKB to"] - #[doc = " \\return The HEX WKB representation. Caller must free with GEOSFree()"] pub fn GEOSWKBWriter_writeHEX( writer: *mut GEOSWKBWriter, g: *const GEOSGeometry, @@ -4708,107 +2755,48 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Read the current output dimension of the writer."] - #[doc = " Either 2 or 3 dimensions."] - #[doc = " Return current number of dimensions."] - #[doc = " \\param writer The writer to read from."] - #[doc = " \\return Number of dimensions (2 or 3)"] pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; } extern "C" { - #[doc = " Set the output dimensionality of the writer. Either"] - #[doc = " 2 or 3 dimensions."] - #[doc = " \\param writer The writer to read from."] - #[doc = " \\param newDimension The dimensionality desired"] pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); } extern "C" { - #[doc = " Find whether the writer will use WKB"] - #[doc = " [byte order](https://en.wikipedia.org/wiki/Endianness)"] - #[doc = " that is big or little endian."] - #[doc = " The return value is a member of \\ref GEOSWKBByteOrders."] - #[doc = " \\param writer The writer to read byte order from"] - #[doc = " \\return The current byte order"] pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; } extern "C" { - #[doc = " Set the output byte order of the writer, using"] - #[doc = " a value from \\ref GEOSWKBByteOrders enum."] - #[doc = " \\param writer The writer to set byte order on"] - #[doc = " \\param byteOrder Desired byte order"] pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); } extern "C" { - #[doc = " Find whether the writer will use"] - #[doc = " [WKB](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary)"] - #[doc = " that is ISO flavor or \"extended\" flavor. The flavor"] - #[doc = " determines how extra dimensionality is encoded with the"] - #[doc = " type number, and whether SRID can be included in the WKB."] - #[doc = " ISO flavor does not support SRID embedding. ISO flavor"] - #[doc = " is \"more standard\" for 3D output. GEOS can read both flavors."] - #[doc = " The return value is a member of \\ref GEOSWKBFlavors."] - #[doc = " \\param writer The writer to read flavor from"] - #[doc = " \\return The current flavor"] pub fn GEOSWKBWriter_getFlavor(writer: *const GEOSWKBWriter) -> libc::c_int; } extern "C" { - #[doc = " Set the output flavor of the writer, using"] - #[doc = " a value from \\ref GEOSWKBFlavors enum."] - #[doc = " \\param writer The writer to set flavor on"] - #[doc = " \\param flavor Desired flavor"] pub fn GEOSWKBWriter_setFlavor(writer: *mut GEOSWKBWriter, flavor: libc::c_int); } extern "C" { - #[doc = " Read the current SRID embedding value from the writer."] - #[doc = " \\param writer The writer to check SRID value on"] pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; } extern "C" { - #[doc = " Specify whether SRID values should be output in WKB."] - #[doc = " Many WKB readers do not support SRID values, use with caution."] - #[doc = " \\param writer The writer to set SRID output on"] - #[doc = " \\param writeSRID Set to 1 to include SRID, 0 otherwise"] pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); } extern "C" { - #[doc = " Allocate a new \\ref GEOSGeoJSONReader."] - #[doc = " \\returns a new reader. Caller must free with GEOSGeoJSONReader_destroy()"] pub fn GEOSGeoJSONReader_create() -> *mut GEOSGeoJSONReader; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSGeoJSONReader."] - #[doc = " \\param reader The reader to destroy."] pub fn GEOSGeoJSONReader_destroy(reader: *mut GEOSGeoJSONReader); } extern "C" { - #[doc = " Use a reader to parse a GeoJSON. A single geometry or feature is"] - #[doc = " converted into a geometry. A featurecollection is converted into a"] - #[doc = " geometrycollection. Feature properties are not read."] - #[doc = " \\param reader A GeoJSON reader object, caller retains ownership"] - #[doc = " \\param geojson The json string to parse, caller retains ownership"] - #[doc = " \\return A \\ref GEOSGeometry, caller to free with GEOSGeom_destroy())"] pub fn GEOSGeoJSONReader_readGeometry( reader: *mut GEOSGeoJSONReader, geojson: *const libc::c_char, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Allocate a new \\ref GEOSGeoJSONWriter."] - #[doc = " \\returns a new writer. Caller must free with GEOSGeoJSONWriter_destroy()"] pub fn GEOSGeoJSONWriter_create() -> *mut GEOSGeoJSONWriter; } extern "C" { - #[doc = " Free the memory associated with a \\ref GEOSGeoJSONWriter."] - #[doc = " \\param writer The writer to destroy."] pub fn GEOSGeoJSONWriter_destroy(writer: *mut GEOSGeoJSONWriter); } extern "C" { - #[doc = " Write out the GeoJSON representation of a geometry. Note that writing a GeoJSON"] - #[doc = " Feature or FeatureCollection is unsupported through the GEOS C API."] - #[doc = " \\param writer A GeoJSON reader object, caller retains ownership."] - #[doc = " \\param g The geometry to convert, caller retains ownership."] - #[doc = " \\param indent The indentation used. Use -1 for no formatting."] - #[doc = " \\return A char pointer, caller to free with GEOSFree())"] pub fn GEOSGeoJSONWriter_writeGeometry( writer: *mut GEOSGeoJSONWriter, g: *const GEOSGeometry, @@ -4816,78 +2804,24 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " \\deprecated in 3.3.0, use GEOSOffsetCurve() instead"] - pub fn GEOSSingleSidedBuffer( - g: *const GEOSGeometry, - width: f64, - quadsegs: libc::c_int, - joinStyle: libc::c_int, - mitreLimit: f64, - leftSide: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " \\deprecated in 3.3.0, use GEOSOffsetCurve() instead"] - pub fn GEOSSingleSidedBuffer_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - width: f64, - quadsegs: libc::c_int, - joinStyle: libc::c_int, - mitreLimit: f64, - leftSide: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " \\deprecated in 3.5.0. Use GEOS_init_r() and set the message handlers using"] - #[doc = " GEOSContext_setNoticeHandler_r() and/or GEOSContext_setErrorHandler_r()"] - pub fn initGEOS_r( - notice_function: GEOSMessageHandler, - error_function: GEOSMessageHandler, - ) -> GEOSContextHandle_t; -} -extern "C" { - #[doc = " \\deprecated in 3.5.0, replaced by GEOS_finish_r()"] - pub fn finishGEOS_r(handle: GEOSContextHandle_t); -} -extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKTReader and GEOSWKTReader_read_r()"] - pub fn GEOSGeomFromWKT_r( - handle: GEOSContextHandle_t, - wkt: *const libc::c_char, - ) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKTWriter and GEOSWKTWriter_write_r()"] - pub fn GEOSGeomToWKT_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut libc::c_char; -} -extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getOutputDimension_r()"] pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setOutputDimension_r()"] pub fn GEOS_setWKBOutputDims_r( handle: GEOSContextHandle_t, newDims: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getByteOrder_r()"] pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setByteOrder_r()"] pub fn GEOS_setWKBByteOrder_r( handle: GEOSContextHandle_t, byteOrder: libc::c_int, ) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBReader_read_r()"] pub fn GEOSGeomFromWKB_buf_r( handle: GEOSContextHandle_t, wkb: *const libc::c_uchar, @@ -4895,7 +2829,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_write_r()"] pub fn GEOSGeomToWKB_buf_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -4903,7 +2836,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBReader_readHEX_r()"] pub fn GEOSGeomFromHEX_buf_r( handle: GEOSContextHandle_t, hex: *const libc::c_uchar, @@ -4911,7 +2843,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_writeHEX_r()"] pub fn GEOSGeomToHEX_buf_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -4919,53 +2850,26 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKTReader and GEOSWKTReader_read_r()"] - pub fn GEOSGeomFromWKT(wkt: *const libc::c_char) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKTWriter and GEOSWKTWriter_write()"] - pub fn GEOSGeomToWKT(g: *const GEOSGeometry) -> *mut libc::c_char; -} -extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOS_getWKBOutputDims()"] pub fn GEOS_getWKBOutputDims() -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOS_setWKBOutputDims()"] pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_getByteOrder()"] pub fn GEOS_getWKBByteOrder() -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_setByteOrder()"] pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBWriter_read()"] pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_write()"] pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBReader and GEOSWKBWriter_readHEX()"] pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; } extern "C" { - #[doc = " \\deprecated use \\ref GEOSWKBWriter and GEOSWKBWriter_writeHEX()"] pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; } -extern "C" { - #[doc = " \\deprecated in 3.3.0: use GEOSUnaryUnion() instead"] - pub fn GEOSUnionCascaded(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - #[doc = " \\deprecated in 3.3.0: use GEOSUnaryUnion_r() instead"] - pub fn GEOSUnionCascaded_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} diff --git a/sys/prebuilt-bindings/geos_3.6.rs b/sys/prebuilt-bindings/geos_3.6.rs new file mode 100644 index 0000000..d7d643c --- /dev/null +++ b/sys/prebuilt-bindings/geos_3.6.rs @@ -0,0 +1,2036 @@ +/* automatically generated by rust-bindgen 0.60.1 */ + +pub const GEOS_VERSION_MAJOR: u32 = 3; +pub const GEOS_VERSION_MINOR: u32 = 6; +pub const GEOS_VERSION_PATCH: u32 = 5; +pub const GEOS_VERSION: &[u8; 6usize] = b"3.6.5\0"; +pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; +pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; +pub const GEOS_CAPI_VERSION_MINOR: u32 = 10; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 5; +pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.6.5-CAPI-1.10.5\0"; +pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; +pub const GEOS_CAPI_LAST_INTERFACE: u32 = 11; +pub const GEOS_PREC_NO_TOPO: u32 = 1; +pub const GEOS_PREC_KEEP_COLLAPSED: u32 = 2; +pub type wchar_t = libc::c_int; +pub type max_align_t = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSContextHandle_HS { + _unused: [u8; 0], +} +pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; +pub type GEOSMessageHandler = + ::std::option::Option; +pub type GEOSMessageHandler_r = ::std::option::Option< + unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeom_t { + _unused: [u8; 0], +} +pub type GEOSGeometry = GEOSGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSPrepGeom_t { + _unused: [u8; 0], +} +pub type GEOSPreparedGeometry = GEOSPrepGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSCoordSeq_t { + _unused: [u8; 0], +} +pub type GEOSCoordSequence = GEOSCoordSeq_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSSTRtree_t { + _unused: [u8; 0], +} +pub type GEOSSTRtree = GEOSSTRtree_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSBufParams_t { + _unused: [u8; 0], +} +pub type GEOSBufferParams = GEOSBufParams_t; +pub type GEOSGeom = *mut GEOSGeometry; +pub type GEOSCoordSeq = *mut GEOSCoordSequence; +pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; +pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; +pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; +pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; +pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; +pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; +pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; +pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; +pub type GEOSGeomTypes = libc::c_uint; +pub const GEOSByteOrders_GEOS_WKB_XDR: GEOSByteOrders = 0; +pub const GEOSByteOrders_GEOS_WKB_NDR: GEOSByteOrders = 1; +pub type GEOSByteOrders = libc::c_uint; +pub type GEOSQueryCallback = ::std::option::Option< + unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), +>; +pub type GEOSDistanceCallback = ::std::option::Option< + unsafe extern "C" fn( + item1: *const libc::c_void, + item2: *const libc::c_void, + distance: *mut f64, + userdata: *mut libc::c_void, + ) -> libc::c_int, +>; +pub type GEOSInterruptCallback = ::std::option::Option; +extern "C" { + pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; +} +extern "C" { + pub fn GEOS_interruptRequest(); +} +extern "C" { + pub fn GEOS_interruptCancel(); +} +extern "C" { + pub fn GEOS_init_r() -> GEOSContextHandle_t; +} +extern "C" { + pub fn GEOS_finish_r(handle: GEOSContextHandle_t); +} +extern "C" { + pub fn GEOSContext_setNoticeHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setErrorHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setNoticeMessageHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + pub fn GEOSContext_setErrorMessageHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + pub fn GEOSversion() -> *const libc::c_char; +} +extern "C" { + pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims_r( + handle: GEOSContextHandle_t, + newDims: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder_r( + handle: GEOSContextHandle_t, + byteOrder: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf_r( + handle: GEOSContextHandle_t, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf_r( + handle: GEOSContextHandle_t, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSCoordSeq_create_r( + handle: GEOSContextHandle_t, + size: libc::c_uint, + dims: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_clone_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSProject_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + pub fn GEOSInterpolate_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> f64; +} +extern "C" { + pub fn GEOSInterpolateNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; +pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; +pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; +pub type GEOSBufCapStyles = libc::c_uint; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; +pub type GEOSBufJoinStyles = libc::c_uint; +extern "C" { + pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPoint_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon_r( + handle: GEOSContextHandle_t, + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); +} +extern "C" { + pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearanceLine_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + distance: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full_r( + handle: GEOSContextHandle_t, + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalidRings: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram_r( + extHandle: GEOSContextHandle_t, + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: libc::c_double, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDisjoint_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEqualsExact_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPrepare_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_create_r( + handle: GEOSContextHandle_t, + nodeCapacity: usize, + ) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); +} +extern "C" { + pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 3; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 4; +pub type GEOSRelateBoundaryNodeRules = libc::c_uint; +extern "C" { + pub fn GEOSRelatePattern_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch_r( + handle: GEOSContextHandle_t, + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; +pub type GEOSValidFlags = libc::c_uint; +extern "C" { + pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData_r( + handle: GEOSContextHandle_t, + g: *mut GEOSGeometry, + userData: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSGetNumGeometries_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_setPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: libc::c_double, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSGetNumInteriorRings_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + x: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + y: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + area: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: libc::c_double, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSOrientationIndex_r( + handle: GEOSContextHandle_t, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, + ) -> libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTReader_t { + _unused: [u8; 0], +} +pub type GEOSWKTReader = GEOSWKTReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKTWriter = GEOSWKTWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBReader_t { + _unused: [u8; 0], +} +pub type GEOSWKBReader = GEOSWKBReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKBWriter = GEOSWKBWriter_t; +extern "C" { + pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + trim: libc::c_char, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + precision: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + dim: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + useOld3D: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + newDimension: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + byteOrder: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + writeSRID: libc::c_char, + ); +} +extern "C" { + pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); +} +extern "C" { + pub fn GEOS_getWKBOutputDims() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) + -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize( + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions( + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSInterpolate(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer( + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle( + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle( + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) + -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments( + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided( + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams( + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle( + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve( + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon( + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection( + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); +} +extern "C" { + pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference(g1: *const GEOSGeometry, g2: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect( + g: *const GEOSGeometry, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full( + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalid: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify( + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation( + g: *const GEOSGeometry, + tolerance: libc::c_double, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram( + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: libc::c_double, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSEqualsExact( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest( + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic( + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate( + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); +} +extern "C" { + pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelatePattern( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch( + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail( + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); +} +extern "C" { + pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_setPrecision( + g: *const GEOSGeometry, + gridSize: libc::c_double, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; +} +extern "C" { + pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: libc::c_double, + dist: *mut f64, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSOrientationIndex( + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read( + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write( + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); +} +extern "C" { + pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_read( + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX( + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); +} +extern "C" { + pub fn GEOSFree(buffer: *mut libc::c_void); +} diff --git a/sys/prebuilt-bindings/geos_3.7.rs b/sys/prebuilt-bindings/geos_3.7.rs index 098b7e0..9621582 100644 --- a/sys/prebuilt-bindings/geos_3.7.rs +++ b/sys/prebuilt-bindings/geos_3.7.rs @@ -2,13 +2,13 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 7; -pub const GEOS_VERSION_PATCH: u32 = 3; -pub const GEOS_VERSION: &[u8; 6usize] = b"3.7.3\0"; +pub const GEOS_VERSION_PATCH: u32 = 5; +pub const GEOS_VERSION: &[u8; 6usize] = b"3.7.5\0"; pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 11; -pub const GEOS_CAPI_VERSION_PATCH: u32 = 3; -pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.7.3-CAPI-1.11.3\0"; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 5; +pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.7.5-CAPI-1.11.5\0"; pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; pub const GEOS_CAPI_LAST_INTERFACE: u32 = 12; pub const GEOS_PREC_NO_TOPO: u32 = 1; @@ -20,8 +20,6 @@ pub type max_align_t = u128; pub struct GEOSContextHandle_HS { _unused: [u8; 0], } -#[doc = " (Abstract) type definitions"] -#[doc = ""] pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; pub type GEOSMessageHandler = ::std::option::Option; @@ -175,8 +173,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Coordinate Sequence functions"] - #[doc = ""] pub fn GEOSCoordSeq_create_r( handle: GEOSContextHandle_t, size: libc::c_uint, @@ -197,7 +193,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -205,7 +201,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -213,7 +209,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -222,7 +218,7 @@ extern "C" { s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -280,9 +276,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Linear referencing functions -- there are more, but these are"] - #[doc = " probably sufficient for most purposes"] - #[doc = ""] pub fn GEOSProject_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -293,7 +286,7 @@ extern "C" { pub fn GEOSInterpolate_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -307,14 +300,14 @@ extern "C" { pub fn GEOSInterpolateNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } @@ -350,7 +343,7 @@ extern "C" { pub fn GEOSBufferParams_setMitreLimit_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -372,35 +365,31 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBufferWithStyle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSOffsetCurve_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry Constructors."] - #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] - #[doc = " All functions return NULL on exception."] - #[doc = ""] pub fn GEOSGeom_createPoint_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, @@ -456,13 +445,9 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Memory management"] - #[doc = ""] pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); } extern "C" { - #[doc = " Topology operations - return NULL on exception."] - #[doc = ""] pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } @@ -554,10 +539,10 @@ extern "C" { pub fn GEOSClipByRect_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -596,14 +581,14 @@ extern "C" { pub fn GEOSSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSTopologyPreserveSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -624,14 +609,14 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSDelaunayTriangulation_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } @@ -640,28 +625,26 @@ extern "C" { extHandle: GEOSContextHandle_t, g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSSegmentIntersection_r( extHandle: GEOSContextHandle_t, - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSDisjoint_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -722,7 +705,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { @@ -740,8 +723,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSPrepare_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -821,8 +802,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " STRtree functions"] - #[doc = ""] pub fn GEOSSTRtree_create_r( handle: GEOSContextHandle_t, nodeCapacity: usize, @@ -882,8 +861,6 @@ extern "C" { pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -905,8 +882,6 @@ pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 3; pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 4; -#[doc = " Dimensionally Extended 9 Intersection Model related"] -#[doc = ""] pub type GEOSRelateBoundaryNodeRules = libc::c_uint; extern "C" { pub fn GEOSRelatePattern_r( @@ -939,8 +914,6 @@ extern "C" { ) -> *mut libc::c_char; } pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; -#[doc = " Validity checking"] -#[doc = ""] pub type GEOSValidFlags = libc::c_uint; extern "C" { pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; @@ -961,8 +934,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Geometry info"] - #[doc = ""] pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut libc::c_char; } @@ -1005,31 +976,14 @@ extern "C" { pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Set the geometry's precision, optionally rounding all its"] - #[doc = " coordinates to the precision grid (if it changes)."] - #[doc = ""] - #[doc = " Note that operations will always be performed in the precision"] - #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] - #[doc = " That same precision will be attached to the operation outputs."] - #[doc = ""] - #[doc = " @param gridSize size of the precision grid, or 0 for FLOATING"] - #[doc = " precision."] - #[doc = " @param flags The bitwise OR of one of more of the"] - #[doc = " @ref GEOS_PREC_NO_TOPO \"precision options\""] - #[doc = " @retuns NULL on exception or a new GEOSGeometry object"] - #[doc = ""] pub fn GEOSGeom_setPrecision_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Get a geometry's precision"] - #[doc = ""] - #[doc = " @return the size of the geometry's precision grid, 0 for FLOATING"] - #[doc = " precision or -1 on exception"] pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; } extern "C" { @@ -1150,8 +1104,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Misc functions"] - #[doc = ""] pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1194,7 +1146,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -1211,7 +1163,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -1230,16 +1182,14 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Algorithms"] - #[doc = ""] pub fn GEOSOrientationIndex_r( handle: GEOSContextHandle_t, - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } #[repr(C)] @@ -1247,8 +1197,6 @@ extern "C" { pub struct GEOSWKTReader_t { _unused: [u8; 0], } -#[doc = " Reader and Writer APIs"] -#[doc = ""] pub type GEOSWKTReader = GEOSWKTReader_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1439,8 +1387,6 @@ extern "C" { pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Coordinate Sequence functions"] - #[doc = ""] pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; } extern "C" { @@ -1450,15 +1396,15 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { @@ -1466,7 +1412,7 @@ extern "C" { s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1517,24 +1463,21 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Linear referencing functions -- there are more, but these are"] - #[doc = " probably sufficient for most purposes"] - #[doc = ""] pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; } extern "C" { - pub fn GEOSInterpolate(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; + pub fn GEOSInterpolate(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; } extern "C" { - pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; + pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } @@ -1557,7 +1500,7 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) -> libc::c_int; } extern "C" { @@ -1576,33 +1519,29 @@ extern "C" { pub fn GEOSBufferWithParams( g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBufferWithStyle( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSOffsetCurve( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry Constructors."] - #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] - #[doc = " All functions return NULL on exception."] - #[doc = ""] pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { @@ -1641,13 +1580,9 @@ extern "C" { pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Memory management"] - #[doc = ""] pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); } extern "C" { - #[doc = " Topology operations - return NULL on exception."] - #[doc = ""] pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { @@ -1696,10 +1631,10 @@ extern "C" { extern "C" { pub fn GEOSClipByRect( g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1729,12 +1664,12 @@ extern "C" { pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSTopologyPreserveSimplify( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1747,13 +1682,13 @@ extern "C" { pub fn GEOSSnap( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSDelaunayTriangulation( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } @@ -1761,27 +1696,25 @@ extern "C" { pub fn GEOSVoronoiDiagram( g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSSegmentIntersection( - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -1809,7 +1742,7 @@ extern "C" { pub fn GEOSEqualsExact( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { @@ -1819,8 +1752,6 @@ extern "C" { pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; } extern "C" { @@ -1937,8 +1868,6 @@ extern "C" { pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -1954,8 +1883,6 @@ extern "C" { pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Dimensionally Extended 9 Intersection Model related"] - #[doc = ""] pub fn GEOSRelatePattern( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -1979,8 +1906,6 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " Validity checking"] - #[doc = ""] pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -1995,8 +1920,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Geometry info"] - #[doc = ""] pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { @@ -2026,7 +1949,7 @@ extern "C" { extern "C" { pub fn GEOSGeom_setPrecision( g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } @@ -2088,8 +2011,6 @@ extern "C" { pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Misc functions"] - #[doc = ""] pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; } extern "C" { @@ -2120,7 +2041,7 @@ extern "C" { pub fn GEOSHausdorffDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -2135,7 +2056,7 @@ extern "C" { pub fn GEOSFrechetDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -2149,20 +2070,16 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Algorithms"] - #[doc = ""] pub fn GEOSOrientationIndex( - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Reader and Writer APIs"] - #[doc = ""] pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; } extern "C" { diff --git a/sys/prebuilt-bindings/geos_3.8.rs b/sys/prebuilt-bindings/geos_3.8.rs index 220ff98..5acc460 100644 --- a/sys/prebuilt-bindings/geos_3.8.rs +++ b/sys/prebuilt-bindings/geos_3.8.rs @@ -2,13 +2,13 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 8; -pub const GEOS_VERSION_PATCH: u32 = 3; -pub const GEOS_VERSION: &[u8; 6usize] = b"3.8.3\0"; +pub const GEOS_VERSION_PATCH: u32 = 1; +pub const GEOS_VERSION: &[u8; 6usize] = b"3.8.1\0"; pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 13; -pub const GEOS_CAPI_VERSION_PATCH: u32 = 4; -pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.8.3-CAPI-1.13.4\0"; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 3; +pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.8.1-CAPI-1.13.3\0"; pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; pub const GEOS_CAPI_LAST_INTERFACE: u32 = 14; pub const GEOS_PREC_NO_TOPO: u32 = 1; @@ -20,8 +20,6 @@ pub type max_align_t = u128; pub struct GEOSContextHandle_HS { _unused: [u8; 0], } -#[doc = " (Abstract) type definitions"] -#[doc = ""] pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; pub type GEOSMessageHandler = ::std::option::Option; @@ -175,8 +173,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Coordinate Sequence functions"] - #[doc = ""] pub fn GEOSCoordSeq_create_r( handle: GEOSContextHandle_t, size: libc::c_uint, @@ -197,7 +193,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -205,7 +201,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -213,7 +209,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -221,8 +217,8 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -230,9 +226,9 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, - z: f64, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -241,7 +237,7 @@ extern "C" { s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -318,9 +314,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Linear referencing functions -- there are more, but these are"] - #[doc = " probably sufficient for most purposes"] - #[doc = ""] pub fn GEOSProject_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -331,7 +324,7 @@ extern "C" { pub fn GEOSInterpolate_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -345,14 +338,14 @@ extern "C" { pub fn GEOSInterpolateNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } @@ -388,7 +381,7 @@ extern "C" { pub fn GEOSBufferParams_setMitreLimit_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -410,35 +403,31 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBufferWithStyle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSOffsetCurve_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry Constructors."] - #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] - #[doc = " All functions return NULL on exception."] - #[doc = ""] pub fn GEOSGeom_createPoint_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, @@ -447,8 +436,8 @@ extern "C" { extern "C" { pub fn GEOSGeom_createPointFromXY_r( handle: GEOSContextHandle_t, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -501,13 +490,9 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Memory management"] - #[doc = ""] pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); } extern "C" { - #[doc = " Topology operations - return NULL on exception."] - #[doc = ""] pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } @@ -613,10 +598,10 @@ extern "C" { pub fn GEOSClipByRect_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -668,14 +653,14 @@ extern "C" { pub fn GEOSSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSTopologyPreserveSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -696,14 +681,14 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSDelaunayTriangulation_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } @@ -712,28 +697,26 @@ extern "C" { extHandle: GEOSContextHandle_t, g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSSegmentIntersection_r( extHandle: GEOSContextHandle_t, - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSDisjoint_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -794,7 +777,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { @@ -812,8 +795,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSPrepare_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -893,8 +874,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " STRtree functions"] - #[doc = ""] pub fn GEOSSTRtree_create_r( handle: GEOSContextHandle_t, nodeCapacity: usize, @@ -954,8 +933,6 @@ extern "C" { pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -977,8 +954,6 @@ pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 3; pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 4; -#[doc = " Dimensionally Extended 9 Intersection Model related"] -#[doc = ""] pub type GEOSRelateBoundaryNodeRules = libc::c_uint; extern "C" { pub fn GEOSRelatePattern_r( @@ -1011,8 +986,6 @@ extern "C" { ) -> *mut libc::c_char; } pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; -#[doc = " Validity checking"] -#[doc = ""] pub type GEOSValidFlags = libc::c_uint; extern "C" { pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; @@ -1039,8 +1012,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry info"] - #[doc = ""] pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut libc::c_char; } @@ -1083,31 +1054,14 @@ extern "C" { pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Set the geometry's precision, optionally rounding all its"] - #[doc = " coordinates to the precision grid (if it changes)."] - #[doc = ""] - #[doc = " Note that operations will always be performed in the precision"] - #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] - #[doc = " That same precision will be attached to the operation outputs."] - #[doc = ""] - #[doc = " @param gridSize size of the precision grid, or 0 for FLOATING"] - #[doc = " precision."] - #[doc = " @param flags The bitwise OR of one of more of the"] - #[doc = " @ref GEOS_PREC_NO_TOPO \"precision options\""] - #[doc = " @retuns NULL on exception or a new GEOSGeometry object"] - #[doc = ""] pub fn GEOSGeom_setPrecision_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Get a geometry's precision"] - #[doc = ""] - #[doc = " @return the size of the geometry's precision grid, 0 for FLOATING"] - #[doc = " precision or -1 on exception"] pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; } extern "C" { @@ -1228,8 +1182,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Misc functions"] - #[doc = ""] pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1272,7 +1224,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -1289,7 +1241,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -1308,16 +1260,14 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Algorithms"] - #[doc = ""] pub fn GEOSOrientationIndex_r( handle: GEOSContextHandle_t, - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } #[repr(C)] @@ -1325,8 +1275,6 @@ extern "C" { pub struct GEOSWKTReader_t { _unused: [u8; 0], } -#[doc = " Reader and Writer APIs"] -#[doc = ""] pub type GEOSWKTReader = GEOSWKTReader_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1517,8 +1465,6 @@ extern "C" { pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Coordinate Sequence functions"] - #[doc = ""] pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; } extern "C" { @@ -1528,32 +1474,32 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setXY( s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setXYZ( s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, - z: f64, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1561,7 +1507,7 @@ extern "C" { s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1629,24 +1575,21 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Linear referencing functions -- there are more, but these are"] - #[doc = " probably sufficient for most purposes"] - #[doc = ""] pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; } extern "C" { - pub fn GEOSInterpolate(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; + pub fn GEOSInterpolate(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; } extern "C" { - pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; + pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } @@ -1669,7 +1612,7 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) -> libc::c_int; } extern "C" { @@ -1688,37 +1631,33 @@ extern "C" { pub fn GEOSBufferWithParams( g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBufferWithStyle( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSOffsetCurve( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry Constructors."] - #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] - #[doc = " All functions return NULL on exception."] - #[doc = ""] pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_createPointFromXY(x: f64, y: f64) -> *mut GEOSGeometry; + pub fn GEOSGeom_createPointFromXY(x: libc::c_double, y: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; @@ -1756,13 +1695,9 @@ extern "C" { pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Memory management"] - #[doc = ""] pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); } extern "C" { - #[doc = " Topology operations - return NULL on exception."] - #[doc = ""] pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { @@ -1821,10 +1756,10 @@ extern "C" { extern "C" { pub fn GEOSClipByRect( g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1863,12 +1798,12 @@ extern "C" { pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSTopologyPreserveSimplify( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1881,13 +1816,13 @@ extern "C" { pub fn GEOSSnap( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSDelaunayTriangulation( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } @@ -1895,27 +1830,25 @@ extern "C" { pub fn GEOSVoronoiDiagram( g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSSegmentIntersection( - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -1946,21 +1879,13 @@ extern "C" { pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Determine pointwise equivalence of two geometries, by checking if each vertex of g2 is"] - #[doc = " within tolerance of the corresponding vertex in g1."] - #[doc = " Unlike GEOSEquals, geometries that are topologically equivalent but have different"] - #[doc = " representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not"] - #[doc = " considered equivalent by GEOSEqualsExact."] - #[doc = " returns 2 on exception, 1 on true, 0 on false"] pub fn GEOSEqualsExact( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; } extern "C" { @@ -2077,8 +2002,6 @@ extern "C" { pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -2094,8 +2017,6 @@ extern "C" { pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Dimensionally Extended 9 Intersection Model related"] - #[doc = ""] pub fn GEOSRelatePattern( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -2119,8 +2040,6 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " Validity checking"] - #[doc = ""] pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -2138,8 +2057,6 @@ extern "C" { pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry info"] - #[doc = ""] pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { @@ -2169,7 +2086,7 @@ extern "C" { extern "C" { pub fn GEOSGeom_setPrecision( g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } @@ -2231,8 +2148,6 @@ extern "C" { pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Misc functions"] - #[doc = ""] pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; } extern "C" { @@ -2263,7 +2178,7 @@ extern "C" { pub fn GEOSHausdorffDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -2278,7 +2193,7 @@ extern "C" { pub fn GEOSFrechetDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -2292,20 +2207,16 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Algorithms"] - #[doc = ""] pub fn GEOSOrientationIndex( - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Reader and Writer APIs"] - #[doc = ""] pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; } extern "C" { diff --git a/sys/prebuilt-bindings/geos_3.9.rs b/sys/prebuilt-bindings/geos_3.9.rs index c549225..0306272 100644 --- a/sys/prebuilt-bindings/geos_3.9.rs +++ b/sys/prebuilt-bindings/geos_3.9.rs @@ -20,8 +20,6 @@ pub type max_align_t = u128; pub struct GEOSContextHandle_HS { _unused: [u8; 0], } -#[doc = " (Abstract) type definitions"] -#[doc = ""] pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; pub type GEOSMessageHandler = ::std::option::Option; @@ -175,8 +173,6 @@ extern "C" { ) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Coordinate Sequence functions"] - #[doc = ""] pub fn GEOSCoordSeq_create_r( handle: GEOSContextHandle_t, size: libc::c_uint, @@ -197,7 +193,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -205,7 +201,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -213,7 +209,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -221,8 +217,8 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -230,9 +226,9 @@ extern "C" { handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, - z: f64, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -241,7 +237,7 @@ extern "C" { s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -318,9 +314,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Linear referencing functions -- there are more, but these are"] - #[doc = " probably sufficient for most purposes"] - #[doc = ""] pub fn GEOSProject_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -331,7 +324,7 @@ extern "C" { pub fn GEOSInterpolate_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -345,14 +338,14 @@ extern "C" { pub fn GEOSInterpolateNormalized_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - d: f64, + d: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } @@ -388,7 +381,7 @@ extern "C" { pub fn GEOSBufferParams_setMitreLimit_r( handle: GEOSContextHandle_t, p: *mut GEOSBufferParams, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -410,35 +403,31 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBufferWithStyle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSOffsetCurve_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry Constructors."] - #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] - #[doc = " All functions return NULL on exception."] - #[doc = ""] pub fn GEOSGeom_createPoint_r( handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence, @@ -447,8 +436,8 @@ extern "C" { extern "C" { pub fn GEOSGeom_createPointFromXY_r( handle: GEOSContextHandle_t, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -501,13 +490,9 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Memory management"] - #[doc = ""] pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); } extern "C" { - #[doc = " Topology operations - return NULL on exception."] - #[doc = ""] pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; } @@ -523,7 +508,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -542,7 +527,7 @@ extern "C" { pub fn GEOSMaximumInscribedCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -550,7 +535,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, boundary: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -584,7 +569,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -599,7 +584,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -618,7 +603,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -631,7 +616,7 @@ extern "C" { pub fn GEOSUnaryUnionPrec_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -667,10 +652,10 @@ extern "C" { pub fn GEOSClipByRect_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -722,14 +707,14 @@ extern "C" { pub fn GEOSSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSTopologyPreserveSimplify_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -750,14 +735,14 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSDelaunayTriangulation_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } @@ -766,28 +751,26 @@ extern "C" { extHandle: GEOSContextHandle_t, g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSSegmentIntersection_r( extHandle: GEOSContextHandle_t, - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSDisjoint_r( handle: GEOSContextHandle_t, g1: *const GEOSGeometry, @@ -848,7 +831,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { @@ -866,8 +849,6 @@ extern "C" { ) -> libc::c_char; } extern "C" { - #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSPrepare_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -962,8 +943,6 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " STRtree functions"] - #[doc = ""] pub fn GEOSSTRtree_create_r( handle: GEOSContextHandle_t, nodeCapacity: usize, @@ -1023,8 +1002,6 @@ extern "C" { pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -1046,8 +1023,6 @@ pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 3; pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: GEOSRelateBoundaryNodeRules = 4; -#[doc = " Dimensionally Extended 9 Intersection Model related"] -#[doc = ""] pub type GEOSRelateBoundaryNodeRules = libc::c_uint; extern "C" { pub fn GEOSRelatePattern_r( @@ -1080,8 +1055,6 @@ extern "C" { ) -> *mut libc::c_char; } pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; -#[doc = " Validity checking"] -#[doc = ""] pub type GEOSValidFlags = libc::c_uint; extern "C" { pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; @@ -1108,8 +1081,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry info"] - #[doc = ""] pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut libc::c_char; } @@ -1152,31 +1123,14 @@ extern "C" { pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; } extern "C" { - #[doc = " Set the geometry's precision, optionally rounding all its"] - #[doc = " coordinates to the precision grid (if it changes)."] - #[doc = ""] - #[doc = " Note that operations will always be performed in the precision"] - #[doc = " of the geometry with higher precision (smaller \"gridSize\")."] - #[doc = " That same precision will be attached to the operation outputs."] - #[doc = ""] - #[doc = " @param gridSize size of the precision grid, or 0 for FLOATING"] - #[doc = " precision."] - #[doc = " @param flags The bitwise OR of one of more of the"] - #[doc = " @ref GEOS_PREC_NO_TOPO \"precision options\""] - #[doc = " @retuns NULL on exception or a new GEOSGeometry object"] - #[doc = ""] pub fn GEOSGeom_setPrecision_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Get a geometry's precision"] - #[doc = ""] - #[doc = " @return the size of the geometry's precision grid, 0 for FLOATING"] - #[doc = " precision or -1 on exception"] pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; } extern "C" { @@ -1297,8 +1251,6 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Misc functions"] - #[doc = ""] pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, @@ -1341,7 +1293,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -1358,7 +1310,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -1377,16 +1329,14 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Algorithms"] - #[doc = ""] pub fn GEOSOrientationIndex_r( handle: GEOSContextHandle_t, - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } #[repr(C)] @@ -1584,8 +1534,6 @@ extern "C" { pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; } extern "C" { - #[doc = " Coordinate Sequence functions"] - #[doc = ""] pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; } extern "C" { @@ -1595,32 +1543,32 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: f64) + pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setXY( s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, + x: libc::c_double, + y: libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setXYZ( s: *mut GEOSCoordSequence, idx: libc::c_uint, - x: f64, - y: f64, - z: f64, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1628,7 +1576,7 @@ extern "C" { s: *mut GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: f64, + val: libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1696,24 +1644,21 @@ extern "C" { ) -> libc::c_int; } extern "C" { - #[doc = " Linear referencing functions -- there are more, but these are"] - #[doc = " probably sufficient for most purposes"] - #[doc = ""] pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; } extern "C" { - pub fn GEOSInterpolate(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; + pub fn GEOSInterpolate(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; } extern "C" { - pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: f64) -> *mut GEOSGeometry; + pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, ) -> *mut GEOSGeometry; } @@ -1736,7 +1681,7 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: f64) + pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) -> libc::c_int; } extern "C" { @@ -1755,37 +1700,33 @@ extern "C" { pub fn GEOSBufferWithParams( g: *const GEOSGeometry, p: *const GEOSBufferParams, - width: f64, + width: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBufferWithStyle( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, endCapStyle: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSOffsetCurve( g: *const GEOSGeometry, - width: f64, + width: libc::c_double, quadsegs: libc::c_int, joinStyle: libc::c_int, - mitreLimit: f64, + mitreLimit: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry Constructors."] - #[doc = " GEOSCoordSequence* arguments will become ownership of the returned object."] - #[doc = " All functions return NULL on exception."] - #[doc = ""] pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_createPointFromXY(x: f64, y: f64) -> *mut GEOSGeometry; + pub fn GEOSGeom_createPointFromXY(x: libc::c_double, y: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; @@ -1823,13 +1764,9 @@ extern "C" { pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Memory management"] - #[doc = ""] pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); } extern "C" { - #[doc = " Topology operations - return NULL on exception."] - #[doc = ""] pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { @@ -1839,7 +1776,7 @@ extern "C" { pub fn GEOSIntersectionPrec( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1849,13 +1786,13 @@ extern "C" { pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; + pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSLargestEmptyCircle( g: *const GEOSGeometry, boundary: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1874,7 +1811,7 @@ extern "C" { pub fn GEOSDifferencePrec( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1885,7 +1822,7 @@ extern "C" { pub fn GEOSSymDifferencePrec( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1898,14 +1835,14 @@ extern "C" { pub fn GEOSUnionPrec( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: f64) -> *mut GEOSGeometry; + pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -1929,10 +1866,10 @@ extern "C" { extern "C" { pub fn GEOSClipByRect( g: *const GEOSGeometry, - xmin: f64, - ymin: f64, - xmax: f64, - ymax: f64, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1971,12 +1908,12 @@ extern "C" { pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: f64) -> *mut GEOSGeometry; + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSTopologyPreserveSimplify( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { @@ -1989,13 +1926,13 @@ extern "C" { pub fn GEOSSnap( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSDelaunayTriangulation( g: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } @@ -2003,27 +1940,25 @@ extern "C" { pub fn GEOSVoronoiDiagram( g: *const GEOSGeometry, env: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, onlyEdges: libc::c_int, ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSSegmentIntersection( - ax0: f64, - ay0: f64, - ax1: f64, - ay1: f64, - bx0: f64, - by0: f64, - bx1: f64, - by1: f64, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, cx: *mut f64, cy: *mut f64, ) -> libc::c_int; } extern "C" { - #[doc = " Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -2054,21 +1989,13 @@ extern "C" { pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Determine pointwise equivalence of two geometries, by checking if each vertex of g2 is"] - #[doc = " within tolerance of the corresponding vertex in g1."] - #[doc = " Unlike GEOSEquals, geometries that are topologically equivalent but have different"] - #[doc = " representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not"] - #[doc = " considered equivalent by GEOSEqualsExact."] - #[doc = " returns 2 on exception, 1 on true, 0 on false"] pub fn GEOSEqualsExact( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - tolerance: f64, + tolerance: libc::c_double, ) -> libc::c_char; } extern "C" { - #[doc = " Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; } extern "C" { @@ -2198,8 +2125,6 @@ extern "C" { pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); } extern "C" { - #[doc = " Unary predicate - return 2 on exception, 1 on true, 0 on false"] - #[doc = ""] pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -2215,8 +2140,6 @@ extern "C" { pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { - #[doc = " Dimensionally Extended 9 Intersection Model related"] - #[doc = ""] pub fn GEOSRelatePattern( g1: *const GEOSGeometry, g2: *const GEOSGeometry, @@ -2240,8 +2163,6 @@ extern "C" { ) -> *mut libc::c_char; } extern "C" { - #[doc = " Validity checking"] - #[doc = ""] pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; } extern "C" { @@ -2259,8 +2180,6 @@ extern "C" { pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Geometry info"] - #[doc = ""] pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; } extern "C" { @@ -2290,7 +2209,7 @@ extern "C" { extern "C" { pub fn GEOSGeom_setPrecision( g: *const GEOSGeometry, - gridSize: f64, + gridSize: libc::c_double, flags: libc::c_int, ) -> *mut GEOSGeometry; } @@ -2352,8 +2271,6 @@ extern "C" { pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - #[doc = " Misc functions"] - #[doc = ""] pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; } extern "C" { @@ -2384,7 +2301,7 @@ extern "C" { pub fn GEOSHausdorffDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -2399,7 +2316,7 @@ extern "C" { pub fn GEOSFrechetDistanceDensify( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - densifyFrac: f64, + densifyFrac: libc::c_double, dist: *mut f64, ) -> libc::c_int; } @@ -2413,20 +2330,16 @@ extern "C" { ) -> *mut GEOSCoordSequence; } extern "C" { - #[doc = " Algorithms"] - #[doc = ""] pub fn GEOSOrientationIndex( - Ax: f64, - Ay: f64, - Bx: f64, - By: f64, - Px: f64, - Py: f64, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, ) -> libc::c_int; } extern "C" { - #[doc = " Reader and Writer APIs"] - #[doc = ""] pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; } extern "C" { From b1b3931c3fc7694f87fd74ad44a8feb48f692530 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 21 Jun 2022 17:27:46 -0700 Subject: [PATCH 17/31] Fix missed f64 => c_double --- geos-sys-bind/src/main.rs | 4 +- sys/README.md | 9 ++ sys/prebuilt-bindings/geos_3.10.rs | 174 +++++++++++++------------- sys/prebuilt-bindings/geos_3.11.rs | 192 ++++++++++++++--------------- sys/prebuilt-bindings/geos_3.6.rs | 66 +++++----- sys/prebuilt-bindings/geos_3.7.rs | 106 ++++++++-------- sys/prebuilt-bindings/geos_3.8.rs | 138 ++++++++++----------- sys/prebuilt-bindings/geos_3.9.rs | 134 ++++++++++---------- 8 files changed, 416 insertions(+), 407 deletions(-) diff --git a/geos-sys-bind/src/main.rs b/geos-sys-bind/src/main.rs index 3bb0e7e..7fa17be 100644 --- a/geos-sys-bind/src/main.rs +++ b/geos-sys-bind/src/main.rs @@ -132,8 +132,8 @@ fn write_bindings(include_dir: &Path, out_path: &Path) { // replace f64 => c_double, f32 => c_float let mut content = fs::read_to_string(out_path).expect("Could not read generated bindings"); content = content - .replace(": f64", ": libc::c_double") - .replace(": f32", ": libc::c_float"); + .replace(" f64", " libc::c_double") + .replace(" f32", " libc::c_float"); fs::write(out_path, content).expect("Unable to write bindings to file"); println!("Bindings generated successfully; please review the results"); diff --git a/sys/README.md b/sys/README.md index 17d5108..32d4e51 100644 --- a/sys/README.md +++ b/sys/README.md @@ -28,4 +28,13 @@ need to have `cmake` and a C++ compiler. Building GEOS may take several minutes. Pre-built bindings are available for all supported GEOS versions. +Use the version feature for the version of GEOS that you want to target; your +installed version of GEOS must be greater than or equal to this version. + +Example: + +```bash +cargo build --features v3_8_0 +``` + New bindings can be created using the sibling `geos-sys-bind` crate. diff --git a/sys/prebuilt-bindings/geos_3.10.rs b/sys/prebuilt-bindings/geos_3.10.rs index 2991014..aba1446 100644 --- a/sys/prebuilt-bindings/geos_3.10.rs +++ b/sys/prebuilt-bindings/geos_3.10.rs @@ -84,7 +84,7 @@ pub type GEOSDistanceCallback = ::std::option::Option< unsafe extern "C" fn( item1: *const libc::c_void, item2: *const libc::c_void, - distance: *mut f64, + distance: *mut libc::c_double, userdata: *mut libc::c_void, ) -> libc::c_int, >; @@ -140,7 +140,7 @@ extern "C" { extern "C" { pub fn GEOSCoordSeq_copyFromBuffer_r( handle: GEOSContextHandle_t, - buf: *const f64, + buf: *const libc::c_double, size: libc::c_uint, hasZ: libc::c_int, hasM: libc::c_int, @@ -149,10 +149,10 @@ extern "C" { extern "C" { pub fn GEOSCoordSeq_copyFromArrays_r( handle: GEOSContextHandle_t, - x: *const f64, - y: *const f64, - z: *const f64, - m: *const f64, + x: *const libc::c_double, + y: *const libc::c_double, + z: *const libc::c_double, + m: *const libc::c_double, size: libc::c_uint, ) -> *mut GEOSCoordSequence; } @@ -160,7 +160,7 @@ extern "C" { pub fn GEOSCoordSeq_copyToBuffer_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, - buf: *mut f64, + buf: *mut libc::c_double, hasZ: libc::c_int, hasM: libc::c_int, ) -> libc::c_int; @@ -169,10 +169,10 @@ extern "C" { pub fn GEOSCoordSeq_copyToArrays_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, - x: *mut f64, - y: *mut f64, - z: *mut f64, - m: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, + m: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -241,7 +241,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -249,7 +249,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -257,7 +257,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -265,8 +265,8 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -274,9 +274,9 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, - z: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -285,7 +285,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -314,7 +314,7 @@ extern "C" { handle: GEOSContextHandle_t, line: *const GEOSGeometry, point: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate_r( @@ -328,7 +328,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized_r( @@ -557,7 +557,7 @@ extern "C" { pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - distance: *mut f64, + distance: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -644,7 +644,7 @@ extern "C" { pub fn GEOSMinimumBoundingCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - radius: *mut f64, + radius: *mut libc::c_double, center: *mut *mut GEOSGeometry, ) -> *mut GEOSGeometry; } @@ -775,8 +775,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -948,7 +948,7 @@ extern "C" { handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1186,7 +1186,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1204,21 +1204,21 @@ extern "C" { pub fn GEOSGeomGetX_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - x: *mut f64, + x: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - y: *mut f64, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetZ_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - z: *mut f64, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1262,28 +1262,28 @@ extern "C" { pub fn GEOSGeom_getXMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getXMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1309,14 +1309,14 @@ extern "C" { pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - area: *mut f64, + area: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1324,7 +1324,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1340,7 +1340,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1348,7 +1348,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1357,7 +1357,7 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1365,7 +1365,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1374,14 +1374,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1632,7 +1632,7 @@ extern "C" { } extern "C" { pub fn GEOSCoordSeq_copyFromBuffer( - buf: *const f64, + buf: *const libc::c_double, size: libc::c_uint, hasZ: libc::c_int, hasM: libc::c_int, @@ -1640,17 +1640,17 @@ extern "C" { } extern "C" { pub fn GEOSCoordSeq_copyFromArrays( - x: *const f64, - y: *const f64, - z: *const f64, - m: *const f64, + x: *const libc::c_double, + y: *const libc::c_double, + z: *const libc::c_double, + m: *const libc::c_double, size: libc::c_uint, ) -> *mut GEOSCoordSequence; } extern "C" { pub fn GEOSCoordSeq_copyToBuffer( s: *const GEOSCoordSequence, - buf: *mut f64, + buf: *mut libc::c_double, hasZ: libc::c_int, hasM: libc::c_int, ) -> libc::c_int; @@ -1658,10 +1658,10 @@ extern "C" { extern "C" { pub fn GEOSCoordSeq_copyToArrays( s: *const GEOSCoordSequence, - x: *mut f64, - y: *mut f64, - z: *mut f64, - m: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, + m: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1711,38 +1711,38 @@ extern "C" { pub fn GEOSCoordSeq_getX( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getY( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getXY( s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getXYZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, - z: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1750,7 +1750,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1772,13 +1772,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; + pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate(line: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; + pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized( @@ -1973,7 +1973,7 @@ extern "C" { pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -1990,7 +1990,7 @@ extern "C" { extern "C" { pub fn GEOSMinimumBoundingCircle( g: *const GEOSGeometry, - radius: *mut f64, + radius: *mut libc::c_double, center: *mut *mut GEOSGeometry, ) -> *mut GEOSGeometry; } @@ -2091,8 +2091,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2208,7 +2208,7 @@ extern "C" { pub fn GEOSPreparedDistance( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2382,7 +2382,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; @@ -2391,13 +2391,13 @@ extern "C" { pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; @@ -2418,16 +2418,16 @@ extern "C" { pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; @@ -2439,16 +2439,16 @@ extern "C" { pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2462,14 +2462,14 @@ extern "C" { pub fn GEOSDistanceIndexed( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2477,14 +2477,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSFrechetDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2492,11 +2492,11 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSNearestPoints( diff --git a/sys/prebuilt-bindings/geos_3.11.rs b/sys/prebuilt-bindings/geos_3.11.rs index 4a8316c..f48b786 100644 --- a/sys/prebuilt-bindings/geos_3.11.rs +++ b/sys/prebuilt-bindings/geos_3.11.rs @@ -83,12 +83,12 @@ pub type GEOSDistanceCallback = ::std::option::Option< unsafe extern "C" fn( item1: *const libc::c_void, item2: *const libc::c_void, - distance: *mut f64, + distance: *mut libc::c_double, userdata: *mut libc::c_void, ) -> libc::c_int, >; pub type GEOSTransformXYCallback = ::std::option::Option< - unsafe extern "C" fn(x: *mut f64, y: *mut f64, userdata: *mut libc::c_void) -> libc::c_int, + unsafe extern "C" fn(x: *mut libc::c_double, y: *mut libc::c_double, userdata: *mut libc::c_void) -> libc::c_int, >; pub type GEOSInterruptCallback = ::std::option::Option; extern "C" { @@ -142,7 +142,7 @@ extern "C" { extern "C" { pub fn GEOSCoordSeq_copyFromBuffer_r( handle: GEOSContextHandle_t, - buf: *const f64, + buf: *const libc::c_double, size: libc::c_uint, hasZ: libc::c_int, hasM: libc::c_int, @@ -151,10 +151,10 @@ extern "C" { extern "C" { pub fn GEOSCoordSeq_copyFromArrays_r( handle: GEOSContextHandle_t, - x: *const f64, - y: *const f64, - z: *const f64, - m: *const f64, + x: *const libc::c_double, + y: *const libc::c_double, + z: *const libc::c_double, + m: *const libc::c_double, size: libc::c_uint, ) -> *mut GEOSCoordSequence; } @@ -162,7 +162,7 @@ extern "C" { pub fn GEOSCoordSeq_copyToBuffer_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, - buf: *mut f64, + buf: *mut libc::c_double, hasZ: libc::c_int, hasM: libc::c_int, ) -> libc::c_int; @@ -171,10 +171,10 @@ extern "C" { pub fn GEOSCoordSeq_copyToArrays_r( handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, - x: *mut f64, - y: *mut f64, - z: *mut f64, - m: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, + m: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -243,7 +243,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -251,7 +251,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -259,7 +259,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -267,8 +267,8 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -276,9 +276,9 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, - z: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -287,7 +287,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -316,7 +316,7 @@ extern "C" { handle: GEOSContextHandle_t, line: *const GEOSGeometry, point: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate_r( @@ -330,7 +330,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized_r( @@ -602,7 +602,7 @@ extern "C" { pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - distance: *mut f64, + distance: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -689,7 +689,7 @@ extern "C" { pub fn GEOSMinimumBoundingCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - radius: *mut f64, + radius: *mut libc::c_double, center: *mut *mut GEOSGeometry, ) -> *mut GEOSGeometry; } @@ -826,8 +826,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -999,7 +999,7 @@ extern "C" { handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1244,7 +1244,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1262,21 +1262,21 @@ extern "C" { pub fn GEOSGeomGetX_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - x: *mut f64, + x: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - y: *mut f64, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetZ_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - z: *mut f64, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1320,38 +1320,38 @@ extern "C" { pub fn GEOSGeom_getXMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getXMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getExtent_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - xmin: *mut f64, - ymin: *mut f64, - xmax: *mut f64, - ymax: *mut f64, + xmin: *mut libc::c_double, + ymin: *mut libc::c_double, + xmax: *mut libc::c_double, + ymax: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1377,14 +1377,14 @@ extern "C" { pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - area: *mut f64, + area: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1392,7 +1392,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1408,7 +1408,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1416,7 +1416,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1425,7 +1425,7 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1433,7 +1433,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1442,7 +1442,7 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1458,7 +1458,7 @@ extern "C" { pub fn GEOSGeomGetLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1720,7 +1720,7 @@ extern "C" { } extern "C" { pub fn GEOSCoordSeq_copyFromBuffer( - buf: *const f64, + buf: *const libc::c_double, size: libc::c_uint, hasZ: libc::c_int, hasM: libc::c_int, @@ -1728,17 +1728,17 @@ extern "C" { } extern "C" { pub fn GEOSCoordSeq_copyFromArrays( - x: *const f64, - y: *const f64, - z: *const f64, - m: *const f64, + x: *const libc::c_double, + y: *const libc::c_double, + z: *const libc::c_double, + m: *const libc::c_double, size: libc::c_uint, ) -> *mut GEOSCoordSequence; } extern "C" { pub fn GEOSCoordSeq_copyToBuffer( s: *const GEOSCoordSequence, - buf: *mut f64, + buf: *mut libc::c_double, hasZ: libc::c_int, hasM: libc::c_int, ) -> libc::c_int; @@ -1746,10 +1746,10 @@ extern "C" { extern "C" { pub fn GEOSCoordSeq_copyToArrays( s: *const GEOSCoordSequence, - x: *mut f64, - y: *mut f64, - z: *mut f64, - m: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, + m: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1799,38 +1799,38 @@ extern "C" { pub fn GEOSCoordSeq_getX( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getY( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getXY( s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getXYZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, - z: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1838,7 +1838,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1930,7 +1930,7 @@ extern "C" { pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; @@ -1939,13 +1939,13 @@ extern "C" { pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; @@ -1966,24 +1966,24 @@ extern "C" { pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getExtent( g: *const GEOSGeometry, - xmin: *mut f64, - ymin: *mut f64, - xmax: *mut f64, - ymax: *mut f64, + xmin: *mut libc::c_double, + ymin: *mut libc::c_double, + xmax: *mut libc::c_double, + ymax: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2061,7 +2061,7 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -2070,19 +2070,19 @@ extern "C" { pub fn GEOSRemoveRepeatedPoints(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2096,7 +2096,7 @@ extern "C" { pub fn GEOSDistanceIndexed( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2109,7 +2109,7 @@ extern "C" { pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2117,14 +2117,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSFrechetDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2132,17 +2132,17 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { - pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; + pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate(line: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> f64; + pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized( @@ -2348,7 +2348,7 @@ extern "C" { extern "C" { pub fn GEOSMinimumBoundingCircle( g: *const GEOSGeometry, - radius: *mut f64, + radius: *mut libc::c_double, center: *mut *mut GEOSGeometry, ) -> *mut GEOSGeometry; } @@ -2591,7 +2591,7 @@ extern "C" { pub fn GEOSPreparedDistance( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2661,8 +2661,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { diff --git a/sys/prebuilt-bindings/geos_3.6.rs b/sys/prebuilt-bindings/geos_3.6.rs index d7d643c..8a5e46a 100644 --- a/sys/prebuilt-bindings/geos_3.6.rs +++ b/sys/prebuilt-bindings/geos_3.6.rs @@ -77,7 +77,7 @@ pub type GEOSDistanceCallback = ::std::option::Option< unsafe extern "C" fn( item1: *const libc::c_void, item2: *const libc::c_void, - distance: *mut f64, + distance: *mut libc::c_double, userdata: *mut libc::c_void, ) -> libc::c_int, >; @@ -226,7 +226,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -234,7 +234,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -242,7 +242,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -251,7 +251,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -273,7 +273,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate_r( @@ -287,7 +287,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized_r( @@ -479,7 +479,7 @@ extern "C" { pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - distance: *mut f64, + distance: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -959,7 +959,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -977,14 +977,14 @@ extern "C" { pub fn GEOSGeomGetX_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - x: *mut f64, + x: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - y: *mut f64, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1047,14 +1047,14 @@ extern "C" { pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - area: *mut f64, + area: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1062,7 +1062,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1070,7 +1070,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1079,14 +1079,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1334,21 +1334,21 @@ extern "C" { pub fn GEOSCoordSeq_getX( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getY( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1356,7 +1356,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1372,13 +1372,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; + pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; + pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; @@ -1507,7 +1507,7 @@ extern "C" { pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -1846,7 +1846,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; @@ -1855,10 +1855,10 @@ extern "C" { pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; @@ -1888,23 +1888,23 @@ extern "C" { pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1912,11 +1912,11 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSNearestPoints( diff --git a/sys/prebuilt-bindings/geos_3.7.rs b/sys/prebuilt-bindings/geos_3.7.rs index 9621582..a5fda42 100644 --- a/sys/prebuilt-bindings/geos_3.7.rs +++ b/sys/prebuilt-bindings/geos_3.7.rs @@ -77,7 +77,7 @@ pub type GEOSDistanceCallback = ::std::option::Option< unsafe extern "C" fn( item1: *const libc::c_void, item2: *const libc::c_void, - distance: *mut f64, + distance: *mut libc::c_double, userdata: *mut libc::c_void, ) -> libc::c_int, >; @@ -226,7 +226,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -234,7 +234,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -242,7 +242,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -251,7 +251,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -280,7 +280,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate_r( @@ -294,7 +294,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized_r( @@ -486,7 +486,7 @@ extern "C" { pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - distance: *mut f64, + distance: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -640,8 +640,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -984,7 +984,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1002,21 +1002,21 @@ extern "C" { pub fn GEOSGeomGetX_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - x: *mut f64, + x: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - y: *mut f64, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetZ_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - z: *mut f64, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1060,28 +1060,28 @@ extern "C" { pub fn GEOSGeom_getXMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getXMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1107,14 +1107,14 @@ extern "C" { pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - area: *mut f64, + area: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1122,7 +1122,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1130,7 +1130,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1138,7 +1138,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1147,7 +1147,7 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1155,7 +1155,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1164,14 +1164,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1419,21 +1419,21 @@ extern "C" { pub fn GEOSCoordSeq_getX( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getY( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1441,7 +1441,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1463,13 +1463,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; + pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; + pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; @@ -1598,7 +1598,7 @@ extern "C" { pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -1710,8 +1710,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1954,7 +1954,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; @@ -1963,13 +1963,13 @@ extern "C" { pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; @@ -1990,16 +1990,16 @@ extern "C" { pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; @@ -2011,30 +2011,30 @@ extern "C" { pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSDistanceIndexed( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2042,14 +2042,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSFrechetDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2057,11 +2057,11 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSNearestPoints( diff --git a/sys/prebuilt-bindings/geos_3.8.rs b/sys/prebuilt-bindings/geos_3.8.rs index 5acc460..21a3bc0 100644 --- a/sys/prebuilt-bindings/geos_3.8.rs +++ b/sys/prebuilt-bindings/geos_3.8.rs @@ -2,13 +2,13 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 8; -pub const GEOS_VERSION_PATCH: u32 = 1; -pub const GEOS_VERSION: &[u8; 6usize] = b"3.8.1\0"; +pub const GEOS_VERSION_PATCH: u32 = 3; +pub const GEOS_VERSION: &[u8; 6usize] = b"3.8.3\0"; pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 13; -pub const GEOS_CAPI_VERSION_PATCH: u32 = 3; -pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.8.1-CAPI-1.13.3\0"; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 4; +pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.8.3-CAPI-1.13.4\0"; pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; pub const GEOS_CAPI_LAST_INTERFACE: u32 = 14; pub const GEOS_PREC_NO_TOPO: u32 = 1; @@ -77,7 +77,7 @@ pub type GEOSDistanceCallback = ::std::option::Option< unsafe extern "C" fn( item1: *const libc::c_void, item2: *const libc::c_void, - distance: *mut f64, + distance: *mut libc::c_double, userdata: *mut libc::c_void, ) -> libc::c_int, >; @@ -245,7 +245,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -253,7 +253,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -261,7 +261,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -269,8 +269,8 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -278,9 +278,9 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, - z: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -289,7 +289,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -318,7 +318,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate_r( @@ -332,7 +332,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized_r( @@ -531,7 +531,7 @@ extern "C" { pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - distance: *mut f64, + distance: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -587,7 +587,7 @@ extern "C" { pub fn GEOSMinimumBoundingCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - radius: *mut f64, + radius: *mut libc::c_double, center: *mut *mut GEOSGeometry, ) -> *mut GEOSGeometry; } @@ -712,8 +712,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1062,7 +1062,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1080,21 +1080,21 @@ extern "C" { pub fn GEOSGeomGetX_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - x: *mut f64, + x: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - y: *mut f64, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetZ_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - z: *mut f64, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1138,28 +1138,28 @@ extern "C" { pub fn GEOSGeom_getXMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getXMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1185,14 +1185,14 @@ extern "C" { pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - area: *mut f64, + area: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1200,7 +1200,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1208,7 +1208,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1216,7 +1216,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1225,7 +1225,7 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1233,7 +1233,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1242,14 +1242,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1514,38 +1514,38 @@ extern "C" { pub fn GEOSCoordSeq_getX( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getY( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getXY( s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getXYZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, - z: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1553,7 +1553,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1575,13 +1575,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; + pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; + pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; @@ -1713,7 +1713,7 @@ extern "C" { pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -1746,7 +1746,7 @@ extern "C" { extern "C" { pub fn GEOSMinimumBoundingCircle( g: *const GEOSGeometry, - radius: *mut f64, + radius: *mut libc::c_double, center: *mut *mut GEOSGeometry, ) -> *mut GEOSGeometry; } @@ -1844,8 +1844,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2091,7 +2091,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; @@ -2100,13 +2100,13 @@ extern "C" { pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; @@ -2127,16 +2127,16 @@ extern "C" { pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; @@ -2148,30 +2148,30 @@ extern "C" { pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSDistanceIndexed( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2179,14 +2179,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSFrechetDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2194,11 +2194,11 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSNearestPoints( diff --git a/sys/prebuilt-bindings/geos_3.9.rs b/sys/prebuilt-bindings/geos_3.9.rs index 0306272..c7f82f3 100644 --- a/sys/prebuilt-bindings/geos_3.9.rs +++ b/sys/prebuilt-bindings/geos_3.9.rs @@ -77,7 +77,7 @@ pub type GEOSDistanceCallback = ::std::option::Option< unsafe extern "C" fn( item1: *const libc::c_void, item2: *const libc::c_void, - distance: *mut f64, + distance: *mut libc::c_double, userdata: *mut libc::c_void, ) -> libc::c_int, >; @@ -245,7 +245,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -253,7 +253,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -261,7 +261,7 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -269,8 +269,8 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -278,9 +278,9 @@ extern "C" { handle: GEOSContextHandle_t, s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, - z: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -289,7 +289,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -318,7 +318,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate_r( @@ -332,7 +332,7 @@ extern "C" { handle: GEOSContextHandle_t, g: *const GEOSGeometry, p: *const GEOSGeometry, - ) -> f64; + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized_r( @@ -554,7 +554,7 @@ extern "C" { pub fn GEOSMinimumClearance_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - distance: *mut f64, + distance: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -641,7 +641,7 @@ extern "C" { pub fn GEOSMinimumBoundingCircle_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - radius: *mut f64, + radius: *mut libc::c_double, center: *mut *mut GEOSGeometry, ) -> *mut GEOSGeometry; } @@ -766,8 +766,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -939,7 +939,7 @@ extern "C" { handle: GEOSContextHandle_t, pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1131,7 +1131,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1149,21 +1149,21 @@ extern "C" { pub fn GEOSGeomGetX_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - x: *mut f64, + x: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetY_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - y: *mut f64, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetZ_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - z: *mut f64, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1207,28 +1207,28 @@ extern "C" { pub fn GEOSGeom_getXMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMin_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getXMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeom_getYMax_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - value: *mut f64, + value: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1254,14 +1254,14 @@ extern "C" { pub fn GEOSArea_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - area: *mut f64, + area: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1269,7 +1269,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1277,7 +1277,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1285,7 +1285,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1294,7 +1294,7 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1302,7 +1302,7 @@ extern "C" { handle: GEOSContextHandle_t, g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1311,14 +1311,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetLength_r( handle: GEOSContextHandle_t, g: *const GEOSGeometry, - length: *mut f64, + length: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1583,38 +1583,38 @@ extern "C" { pub fn GEOSCoordSeq_getX( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getY( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getXY( s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_getXYZ( s: *const GEOSCoordSequence, idx: libc::c_uint, - x: *mut f64, - y: *mut f64, - z: *mut f64, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1622,7 +1622,7 @@ extern "C" { s: *const GEOSCoordSequence, idx: libc::c_uint, dim: libc::c_uint, - val: *mut f64, + val: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -1644,13 +1644,13 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; + pub fn GEOSProject(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolate(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> f64; + pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; @@ -1799,7 +1799,7 @@ extern "C" { pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut f64) -> libc::c_int; + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -1856,7 +1856,7 @@ extern "C" { extern "C" { pub fn GEOSMinimumBoundingCircle( g: *const GEOSGeometry, - radius: *mut f64, + radius: *mut libc::c_double, center: *mut *mut GEOSGeometry, ) -> *mut GEOSGeometry; } @@ -1954,8 +1954,8 @@ extern "C" { by0: libc::c_double, bx1: libc::c_double, by1: libc::c_double, - cx: *mut f64, - cy: *mut f64, + cx: *mut libc::c_double, + cy: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2071,7 +2071,7 @@ extern "C" { pub fn GEOSPreparedDistance( pg1: *const GEOSPreparedGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2214,7 +2214,7 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> f64; + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; @@ -2223,13 +2223,13 @@ extern "C" { pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; @@ -2250,16 +2250,16 @@ extern "C" { pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut f64) -> libc::c_int; + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; @@ -2271,30 +2271,30 @@ extern "C" { pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSArea(g: *const GEOSGeometry, area: *mut f64) -> libc::c_int; + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; } extern "C" { - pub fn GEOSLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSDistanceIndexed( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSHausdorffDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2302,14 +2302,14 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { pub fn GEOSFrechetDistance( g1: *const GEOSGeometry, g2: *const GEOSGeometry, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { @@ -2317,11 +2317,11 @@ extern "C" { g1: *const GEOSGeometry, g2: *const GEOSGeometry, densifyFrac: libc::c_double, - dist: *mut f64, + dist: *mut libc::c_double, ) -> libc::c_int; } extern "C" { - pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut f64) -> libc::c_int; + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; } extern "C" { pub fn GEOSNearestPoints( From ee20878845f1786d3dc65adc8391bf75f36f56da Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 21 Jun 2022 17:29:13 -0700 Subject: [PATCH 18/31] Fix CI typos --- .github/workflows/CI.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1eefd37..32e362a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -140,32 +140,32 @@ jobs: cargo build - name: Build GEOS 3.6.0 features - if: ${{ startsWith(matrix.geos, '3.6') + if: ${{ startsWith(matrix.geos, '3.6') }} run: | cargo build --features v3_6_0 - name: Build GEOS 3.7.0 features - if: ${{ startsWith(matrix.geos, '3.7') + if: ${{ startsWith(matrix.geos, '3.7') }} run: | cargo build --features v3_7_0 - name: Build GEOS 3.8.0 features - if: ${{ startsWith(matrix.geos, '3.8') + if: ${{ startsWith(matrix.geos, '3.8') }} run: | cargo build --features v3_8_0 - name: Build GEOS 3.9.0 features - if: ${{ startsWith(matrix.geos, '3.9') + if: ${{ startsWith(matrix.geos, '3.9') }} run: | cargo build --features v3_9_0 - name: Build GEOS 3.10.0 features - if: ${{ startsWith(matrix.geos, '3.10') + if: ${{ startsWith(matrix.geos, '3.10') }} run: | cargo build --features v3_10_0 - name: Build GEOS 3.11.0 features - if: ${{ startsWith(matrix.geos, '3.11') + if: ${{ startsWith(matrix.geos, '3.11') }} run: | cargo build --features v3_11_0 @@ -175,37 +175,37 @@ jobs: cargo test --features 'geo,json' - name: Test GEOS 3.6.0 features - if: ${{ startsWith(matrix.geos, '3.6') + if: ${{ startsWith(matrix.geos, '3.6') }} run: | cargo test --features v3_6_0 cargo test --features 'v3_6_0,geo,json' - name: Test GEOS 3.7.0 features - if: ${{ startsWith(matrix.geos, '3.7') + if: ${{ startsWith(matrix.geos, '3.7') }} run: | cargo test --features v3_7_0 cargo test --features 'v3_7_0,geo,json' - name: Test GEOS 3.8.0 features - if: ${{ startsWith(matrix.geos, '3.8') + if: ${{ startsWith(matrix.geos, '3.8') }} run: | cargo test --features v3_8_0 cargo test --features 'v3_8_0,geo,json' - name: Test GEOS 3.9.0 features - if: ${{ startsWith(matrix.geos, '3.9') + if: ${{ startsWith(matrix.geos, '3.9') }} run: | cargo test --features v3_9_0 cargo test --features 'v3_9_0,geo,json' - name: Test GEOS 3.10.0 features - if: ${{ startsWith(matrix.geos, '3.10') + if: ${{ startsWith(matrix.geos, '3.10') }} run: | cargo test --features v3_10_0 cargo test --features 'v3_10_0,geo,json' - name: Test GEOS 3.11.0 features - if: ${{ startsWith(matrix.geos, '3.11') + if: ${{ startsWith(matrix.geos, '3.11') }} run: | cargo test --features v3_11_0 cargo test --features 'v3_11_0,geo,json' From 2dab3614452cf486f93f73d3ecc66582e0a4684f Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 21 Jun 2022 17:40:17 -0700 Subject: [PATCH 19/31] Fix use of version features --- sys/Cargo.toml | 10 +++++----- sys/build.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/Cargo.toml b/sys/Cargo.toml index fdbe925..11584a4 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -32,8 +32,8 @@ default = [] static = ["geos-src", "link-cplusplus"] v3_6_0 = [] -v3_7_0 = ["v3_6_0"] -v3_8_0 = ["v3_7_0"] -v3_9_0 = ["v3_8_0"] -v3_10_0 = ["v3_9_0"] -v3_11_0 = ["v3_10_0"] +v3_7_0 = [] +v3_8_0 = [] +v3_9_0 = [] +v3_10_0 = [] +v3_11_0 = [] diff --git a/sys/build.rs b/sys/build.rs index a216b7e..182c7b3 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -192,23 +192,23 @@ fn main() { let mut binding_version = Version::parse(MINIMUM_GEOS_VERSION).unwrap(); - if cfg!(feature = "v3_7") { + if cfg!(feature = "v3_7_0") { binding_version = Version::new(3, 7, 0); } - if cfg!(feature = "v3_8") { + if cfg!(feature = "v3_8_0") { binding_version = Version::new(3, 8, 0); } - if cfg!(feature = "v3_9") { + if cfg!(feature = "v3_9_0") { binding_version = Version::new(3, 9, 0); } - if cfg!(feature = "v3_10") { + if cfg!(feature = "v3_10_0") { binding_version = Version::new(3, 10, 0); } - if cfg!(feature = "v3_11") { + if cfg!(feature = "v3_11_0") { // binding_version = Version::new(3, 11, 0); // FIXME: remove string parsing once released From 2e8c30efd2ac56486e243b2c21fa5024e0f5052f Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 21 Jun 2022 17:53:25 -0700 Subject: [PATCH 20/31] Fix lint errors --- geos-sys-bind/src/main.rs | 21 +++++++-------------- sys/build.rs | 17 +++++++++-------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/geos-sys-bind/src/main.rs b/geos-sys-bind/src/main.rs index 7fa17be..09cbe60 100644 --- a/geos-sys-bind/src/main.rs +++ b/geos-sys-bind/src/main.rs @@ -43,7 +43,7 @@ fn detect_geos_via_geos_config() -> Option { Some(GEOSConfig { include_dir: PathBuf::from(geos_config[0].trim()), - version: parse_geos_version(&geos_config[1]), + version: parse_geos_version(geos_config[1]), }) } Err(_) => None, @@ -146,30 +146,23 @@ fn main() { let version_env = env::var_os("GEOS_VERSION"); if include_dir_env.is_some() || version_env.is_some() { - let version: Version; - let include_dir: PathBuf; - // GEOS_INCLUDE_DIR - match include_dir_env { - Some(path) => { - include_dir = PathBuf::from(path); - } + let include_dir = match include_dir_env { + Some(path) => PathBuf::from(path), None => { println!("GEOS_INCLUDE_DIR must be set"); exit(1); } - } + }; // GEOS_VERSION - match version_env { - Some(raw_version) => { - version = parse_geos_version(&raw_version.to_string_lossy().to_string()); - } + let version = match version_env { + Some(raw_version) => parse_geos_version(&raw_version.to_string_lossy().to_string()), None => { println!("GEOS_VERSION must be set"); exit(1); } - } + }; config = Some(GEOSConfig { include_dir, diff --git a/sys/build.rs b/sys/build.rs index 182c7b3..e17416b 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,6 +1,6 @@ use semver::Version; use std::env; -use std::path::{PathBuf}; +use std::path::PathBuf; use std::process::Command; const MINIMUM_GEOS_VERSION: &str = "3.6.0"; @@ -40,7 +40,7 @@ fn detect_geos_via_geos_config() -> Option { geos_config[0].replace("-L", "") ); - Some(parse_geos_version(&geos_config[1])) + Some(parse_geos_version(geos_config[1])) } Err(_) => None, } @@ -77,7 +77,6 @@ fn detect_geos_via_pkg_config() -> Option { } } - /// Hardcode a prebuilt binding version while generating docs. /// Otherwise docs.rs will explode due to not actually having libgeos installed. fn set_bindings_for_docs(out_path: &PathBuf) { @@ -116,7 +115,7 @@ fn main() { let mut version: Option; let lib_dir_env = env::var_os("GEOS_LIB_DIR"); - let version_env = env::var_os("GEOS_VERSION"); + let version_env = env::var_os("GEOS_VERSION"); // static feature includes building the included GEOS prior to this build step. // The statically-linked GEOS is the version pinned in the GEOS submodule @@ -130,8 +129,9 @@ fn main() { println!("cargo:rustc-link-search=native={}", geos_path); println!("cargo:includedir={}/include", geos_path); - version = Some(Version::parse(BUNDLED_GEOS_VERSION).expect("Could not parse bundled GEOS version")); - + version = Some( + Version::parse(BUNDLED_GEOS_VERSION).expect("Could not parse bundled GEOS version"), + ); } else if lib_dir_env.is_some() || version_env.is_some() { // if any env vars are set, all must be set println!("cargo:rustc-link-lib=dylib=geos_c"); @@ -150,7 +150,9 @@ fn main() { // GEOS_VERSION match version_env { Some(raw_version) => { - version = Some(parse_geos_version(&raw_version.to_string_lossy().to_string())); + version = Some(parse_geos_version( + &raw_version.to_string_lossy().to_string(), + )); } None => { panic!("GEOS_VERSION must be set"); @@ -170,7 +172,6 @@ fn main() { } } - let version = version.unwrap(); let min_geos_version = Version::parse(MINIMUM_GEOS_VERSION).unwrap(); From fb959ab5cabffe2097dcabd15bc5b847aa03a5ae Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 21 Jun 2022 18:06:07 -0700 Subject: [PATCH 21/31] Fix more lint errors --- sys/build.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/build.rs b/sys/build.rs index e17416b..aa962e9 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -150,9 +150,7 @@ fn main() { // GEOS_VERSION match version_env { Some(raw_version) => { - version = Some(parse_geos_version( - &raw_version.to_string_lossy().to_string(), - )); + version = Some(parse_geos_version(&raw_version.to_string_lossy())); } None => { panic!("GEOS_VERSION must be set"); From 7c82626b87e9141c21d833b8ed004bb2ed7faf1b Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Wed, 22 Jun 2022 11:10:12 -0700 Subject: [PATCH 22/31] Update bindings, simplify binding generation, PR feedback --- geos-sys-bind/Cargo.toml | 3 +- geos-sys-bind/src/main.rs | 61 ++++++++++++----------------- sys/Cargo.toml | 3 +- sys/prebuilt-bindings/geos_3.10.rs | 52 ++++++++++++++++-------- sys/prebuilt-bindings/geos_3.11.rs | 63 +++++++++++++++++++++--------- sys/prebuilt-bindings/geos_3.6.rs | 42 +++++++++++++------- sys/prebuilt-bindings/geos_3.7.rs | 42 +++++++++++++------- sys/prebuilt-bindings/geos_3.8.rs | 42 +++++++++++++------- sys/prebuilt-bindings/geos_3.9.rs | 52 ++++++++++++++++-------- 9 files changed, 222 insertions(+), 138 deletions(-) diff --git a/geos-sys-bind/Cargo.toml b/geos-sys-bind/Cargo.toml index cd5145e..1e5b2ba 100644 --- a/geos-sys-bind/Cargo.toml +++ b/geos-sys-bind/Cargo.toml @@ -5,8 +5,7 @@ edition = "2021" description = "Generate GEOS C API bindings" - [dependencies] bindgen = "0.60.1" pkg-config = "0.3.25" -semver = "1.0" \ No newline at end of file +semver = "1.0" diff --git a/geos-sys-bind/src/main.rs b/geos-sys-bind/src/main.rs index 09cbe60..ad59173 100644 --- a/geos-sys-bind/src/main.rs +++ b/geos-sys-bind/src/main.rs @@ -2,7 +2,6 @@ use bindgen::Builder; use pkg_config::Config; use semver::Version; use std::env; -use std::fs; use std::io; use std::path::{Path, PathBuf}; use std::process::{exit, Command}; @@ -94,48 +93,38 @@ fn write_bindings(include_dir: &Path, out_path: &Path) { .clang_arg(include_dir.to_str().unwrap()) // use libc instead of default std::os::raw .ctypes_prefix("libc") + // avoid converting double / float to f64 / f32 + .no_convert_floats() // drop GEOS comments due to license constraints .generate_comments(false) + // block strings that aren't handed properly and can be trivially generated later + .blocklist_item("GEOS_VERSION") + .blocklist_item("GEOS_CAPI_VERSION") + // block unnecessary consts + .blocklist_item("GEOS_JTS_PORT") + .blocklist_item("GEOS_CAPI_FIRST_INTERFACE") + .blocklist_item("GEOS_CAPI_LAST_INTERFACE") // block deprecated APIs (both plain and "_r" variants) - .blocklist_function("initGEOS") - .blocklist_function("initGEOS_r") - .blocklist_function("finishGEOS") - .blocklist_function("finishGEOS_r") - .blocklist_function("GEOSGeomFromWKT") - .blocklist_function("GEOSGeomFromWKT_r") - .blocklist_function("GEOSGeomToWKT") - .blocklist_function("GEOSGeomToWKT_r") - .blocklist_function("GEOSSingleSidedBuffer") - .blocklist_function("GEOSSingleSidedBuffer_r") - .blocklist_function("GEOSUnionCascaded") - .blocklist_function("GEOSUnionCascaded_r") + .blocklist_function("initGEOS.*") + .blocklist_function("finishGEOS.*") + .blocklist_function("GEOSGeomFromWKT.*") + .blocklist_function("GEOSGeomToWKT.*") + .blocklist_function("GEOSSingleSidedBuffer.*") + .blocklist_function("GEOSUnionCascaded.*") + // TODO: remove; these were deprecated a long time ago but are still used here - // .blocklist_function("GEOS_getWKBOutputDims") - // .blocklist_function("GEOS_getWKBOutputDims_r") - // .blocklist_function("GEOS_setWKBOutputDims") - // .blocklist_function("GEOS_setWKBOutputDims_r") - // .blocklist_function("GEOS_getWKBByteOrder") - // .blocklist_function("GEOS_getWKBByteOrder_r") - // .blocklist_function("GEOS_setWKBByteOrder") - // .blocklist_function("GEOS_setWKBByteOrder_r") - // .blocklist_function("GEOSGeomFromWKB_buf") - // .blocklist_function("GEOSGeomFromWKB_buf_r") - // .blocklist_function("GEOSGeomToWKB_buf") - // .blocklist_function("GEOSGeomToWKB_buf_r") - // .blocklist_function("GEOSGeomFromHEX_buf") - // .blocklist_function("GEOSGeomFromHEX_buf_r") + // .blocklist_function("GEOS_getWKBOutputDims.*") + // .blocklist_function("GEOS_setWKBOutputDims.*") + // .blocklist_function("GEOS_getWKBByteOrder.*") + // .blocklist_function("GEOS_setWKBByteOrder.*") + // .blocklist_function("GEOSGeomFromWKB_buf.*") + // .blocklist_function("GEOSGeomToWKB_buf.*") + // .blocklist_function("GEOSGeomFromHEX_buf.*") .generate() .expect("Unable to generate bindings") .write_to_file(out_path) .expect("Unable to write bindings to file"); - // replace f64 => c_double, f32 => c_float - let mut content = fs::read_to_string(out_path).expect("Could not read generated bindings"); - content = content - .replace(" f64", " libc::c_double") - .replace(" f32", " libc::c_float"); - fs::write(out_path, content).expect("Unable to write bindings to file"); - println!("Bindings generated successfully; please review the results"); } @@ -209,14 +198,14 @@ fn main() { if out_path.exists() { println!("\n\n======================="); println!( - "Prebuilt bindings already exist for GEOS {}.{}\nDo you want to overwrite it (y/n)?", + "Prebuilt bindings already exist for GEOS {}.{}\nDo you want to overwrite it (y/N)?", version.major, version.minor ); let mut input = String::new(); io::stdin().read_line(&mut input).unwrap(); if input.to_string().to_lowercase().trim() != "y" { println!("exiting..."); - exit(0); + return; } } diff --git a/sys/Cargo.toml b/sys/Cargo.toml index 11584a4..8fc080b 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "geos-sys" -version = "2.1.0" # TODO: set correct version +version = "2.0.4" authors = ["Guillaume Gomez "] description = "GEOS C API bindings" @@ -30,7 +30,6 @@ name = "geos_sys" [features] default = [] static = ["geos-src", "link-cplusplus"] - v3_6_0 = [] v3_7_0 = [] v3_8_0 = [] diff --git a/sys/prebuilt-bindings/geos_3.10.rs b/sys/prebuilt-bindings/geos_3.10.rs index aba1446..e56895f 100644 --- a/sys/prebuilt-bindings/geos_3.10.rs +++ b/sys/prebuilt-bindings/geos_3.10.rs @@ -3,14 +3,9 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 10; pub const GEOS_VERSION_PATCH: u32 = 3; -pub const GEOS_VERSION: &[u8; 7usize] = b"3.10.3\0"; -pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.18.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 16; pub const GEOS_CAPI_VERSION_PATCH: u32 = 1; -pub const GEOS_CAPI_VERSION: &[u8; 19usize] = b"3.10.3-CAPI-1.16.1\0"; -pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; -pub const GEOS_CAPI_LAST_INTERFACE: u32 = 17; pub type wchar_t = libc::c_int; pub type max_align_t = u128; #[repr(C)] @@ -1186,7 +1181,10 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; + pub fn GEOSGeom_getPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1671,16 +1669,25 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setX( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setXY( @@ -1778,7 +1785,10 @@ extern "C" { pub fn GEOSInterpolate(line: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> libc::c_double; + pub fn GEOSProjectNormalized( + line: *const GEOSGeometry, + point: *const GEOSGeometry, + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized( @@ -1812,8 +1822,10 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) - -> libc::c_int; + pub fn GEOSBufferParams_setMitreLimit( + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSBufferParams_setQuadrantSegments( @@ -1948,7 +1960,10 @@ extern "C" { pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSUnaryUnionPrec( + g: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -1960,7 +1975,10 @@ extern "C" { pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSMaximumInscribedCircle( + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSLargestEmptyCircle( diff --git a/sys/prebuilt-bindings/geos_3.11.rs b/sys/prebuilt-bindings/geos_3.11.rs index f48b786..1f0b05e 100644 --- a/sys/prebuilt-bindings/geos_3.11.rs +++ b/sys/prebuilt-bindings/geos_3.11.rs @@ -2,14 +2,9 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 11; -pub const GEOS_VERSION: &[u8; 12usize] = b"3.11.0beta2\0"; -pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.18.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 16; pub const GEOS_CAPI_VERSION_PATCH: u32 = 0; -pub const GEOS_CAPI_VERSION: &[u8; 24usize] = b"3.11.0beta2-CAPI-1.16.0\0"; -pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; -pub const GEOS_CAPI_LAST_INTERFACE: u32 = 17; pub type wchar_t = libc::c_int; pub type max_align_t = u128; #[repr(C)] @@ -88,7 +83,11 @@ pub type GEOSDistanceCallback = ::std::option::Option< ) -> libc::c_int, >; pub type GEOSTransformXYCallback = ::std::option::Option< - unsafe extern "C" fn(x: *mut libc::c_double, y: *mut libc::c_double, userdata: *mut libc::c_void) -> libc::c_int, + unsafe extern "C" fn( + x: *mut libc::c_double, + y: *mut libc::c_double, + userdata: *mut libc::c_void, + ) -> libc::c_int, >; pub type GEOSInterruptCallback = ::std::option::Option; extern "C" { @@ -1244,7 +1243,10 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; + pub fn GEOSGeom_getPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1759,16 +1761,25 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setX( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setXY( @@ -2067,7 +2078,10 @@ extern "C" { pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSRemoveRepeatedPoints(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSRemoveRepeatedPoints( + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; @@ -2142,7 +2156,10 @@ extern "C" { pub fn GEOSInterpolate(line: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSProjectNormalized(line: *const GEOSGeometry, point: *const GEOSGeometry) -> libc::c_double; + pub fn GEOSProjectNormalized( + line: *const GEOSGeometry, + point: *const GEOSGeometry, + ) -> libc::c_double; } extern "C" { pub fn GEOSInterpolateNormalized( @@ -2195,7 +2212,10 @@ extern "C" { pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSUnaryUnionPrec( + g: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; @@ -2238,8 +2258,10 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) - -> libc::c_int; + pub fn GEOSBufferParams_setMitreLimit( + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSBufferParams_setQuadrantSegments( @@ -2327,7 +2349,10 @@ extern "C" { pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSMaximumInscribedCircle( + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSLargestEmptyCircle( diff --git a/sys/prebuilt-bindings/geos_3.6.rs b/sys/prebuilt-bindings/geos_3.6.rs index 8a5e46a..4d619c3 100644 --- a/sys/prebuilt-bindings/geos_3.6.rs +++ b/sys/prebuilt-bindings/geos_3.6.rs @@ -3,14 +3,9 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 6; pub const GEOS_VERSION_PATCH: u32 = 5; -pub const GEOS_VERSION: &[u8; 6usize] = b"3.6.5\0"; -pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 10; pub const GEOS_CAPI_VERSION_PATCH: u32 = 5; -pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.6.5-CAPI-1.10.5\0"; -pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; -pub const GEOS_CAPI_LAST_INTERFACE: u32 = 11; pub const GEOS_PREC_NO_TOPO: u32 = 1; pub const GEOS_PREC_KEEP_COLLAPSED: u32 = 2; pub type wchar_t = libc::c_int; @@ -959,7 +954,10 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; + pub fn GEOSGeom_getPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1311,16 +1309,25 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setX( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setOrdinate( @@ -1381,7 +1388,10 @@ extern "C" { pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { - pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSInterpolateNormalized( + g: *const GEOSGeometry, + d: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer( @@ -1409,8 +1419,10 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) - -> libc::c_int; + pub fn GEOSBufferParams_setMitreLimit( + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSBufferParams_setQuadrantSegments( diff --git a/sys/prebuilt-bindings/geos_3.7.rs b/sys/prebuilt-bindings/geos_3.7.rs index a5fda42..019f607 100644 --- a/sys/prebuilt-bindings/geos_3.7.rs +++ b/sys/prebuilt-bindings/geos_3.7.rs @@ -3,14 +3,9 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 7; pub const GEOS_VERSION_PATCH: u32 = 5; -pub const GEOS_VERSION: &[u8; 6usize] = b"3.7.5\0"; -pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 11; pub const GEOS_CAPI_VERSION_PATCH: u32 = 5; -pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.7.5-CAPI-1.11.5\0"; -pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; -pub const GEOS_CAPI_LAST_INTERFACE: u32 = 12; pub const GEOS_PREC_NO_TOPO: u32 = 1; pub const GEOS_PREC_KEEP_COLLAPSED: u32 = 2; pub type wchar_t = libc::c_int; @@ -984,7 +979,10 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; + pub fn GEOSGeom_getPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1396,16 +1394,25 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setX( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setOrdinate( @@ -1472,7 +1479,10 @@ extern "C" { pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { - pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSInterpolateNormalized( + g: *const GEOSGeometry, + d: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer( @@ -1500,8 +1510,10 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) - -> libc::c_int; + pub fn GEOSBufferParams_setMitreLimit( + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSBufferParams_setQuadrantSegments( diff --git a/sys/prebuilt-bindings/geos_3.8.rs b/sys/prebuilt-bindings/geos_3.8.rs index 21a3bc0..85ea52a 100644 --- a/sys/prebuilt-bindings/geos_3.8.rs +++ b/sys/prebuilt-bindings/geos_3.8.rs @@ -3,14 +3,9 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 8; pub const GEOS_VERSION_PATCH: u32 = 3; -pub const GEOS_VERSION: &[u8; 6usize] = b"3.8.3\0"; -pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.13.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 13; pub const GEOS_CAPI_VERSION_PATCH: u32 = 4; -pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.8.3-CAPI-1.13.4\0"; -pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; -pub const GEOS_CAPI_LAST_INTERFACE: u32 = 14; pub const GEOS_PREC_NO_TOPO: u32 = 1; pub const GEOS_PREC_KEEP_COLLAPSED: u32 = 2; pub type wchar_t = libc::c_int; @@ -1062,7 +1057,10 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; + pub fn GEOSGeom_getPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1474,16 +1472,25 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setX( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setXY( @@ -1584,7 +1591,10 @@ extern "C" { pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { - pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSInterpolateNormalized( + g: *const GEOSGeometry, + d: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer( @@ -1612,8 +1622,10 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) - -> libc::c_int; + pub fn GEOSBufferParams_setMitreLimit( + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSBufferParams_setQuadrantSegments( diff --git a/sys/prebuilt-bindings/geos_3.9.rs b/sys/prebuilt-bindings/geos_3.9.rs index c7f82f3..a4623ac 100644 --- a/sys/prebuilt-bindings/geos_3.9.rs +++ b/sys/prebuilt-bindings/geos_3.9.rs @@ -3,14 +3,9 @@ pub const GEOS_VERSION_MAJOR: u32 = 3; pub const GEOS_VERSION_MINOR: u32 = 9; pub const GEOS_VERSION_PATCH: u32 = 3; -pub const GEOS_VERSION: &[u8; 6usize] = b"3.9.3\0"; -pub const GEOS_JTS_PORT: &[u8; 7usize] = b"1.17.0\0"; pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; pub const GEOS_CAPI_VERSION_MINOR: u32 = 14; pub const GEOS_CAPI_VERSION_PATCH: u32 = 3; -pub const GEOS_CAPI_VERSION: &[u8; 18usize] = b"3.9.3-CAPI-1.14.3\0"; -pub const GEOS_CAPI_FIRST_INTERFACE: u32 = 1; -pub const GEOS_CAPI_LAST_INTERFACE: u32 = 15; pub const GEOS_PREC_NO_TOPO: u32 = 1; pub const GEOS_PREC_KEEP_COLLAPSED: u32 = 2; pub type wchar_t = libc::c_int; @@ -1131,7 +1126,10 @@ extern "C" { ) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_double; + pub fn GEOSGeom_getPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_double; } extern "C" { pub fn GEOSGetNumInteriorRings_r( @@ -1543,16 +1541,25 @@ extern "C" { pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); } extern "C" { - pub fn GEOSCoordSeq_setX(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setX( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setY(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { - pub fn GEOSCoordSeq_setZ(s: *mut GEOSCoordSequence, idx: libc::c_uint, val: libc::c_double) - -> libc::c_int; + pub fn GEOSCoordSeq_setZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSCoordSeq_setXY( @@ -1653,7 +1660,10 @@ extern "C" { pub fn GEOSProjectNormalized(g: *const GEOSGeometry, p: *const GEOSGeometry) -> libc::c_double; } extern "C" { - pub fn GEOSInterpolateNormalized(g: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSInterpolateNormalized( + g: *const GEOSGeometry, + d: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSBuffer( @@ -1681,8 +1691,10 @@ extern "C" { ) -> libc::c_int; } extern "C" { - pub fn GEOSBufferParams_setMitreLimit(p: *mut GEOSBufferParams, mitreLimit: libc::c_double) - -> libc::c_int; + pub fn GEOSBufferParams_setMitreLimit( + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; } extern "C" { pub fn GEOSBufferParams_setQuadrantSegments( @@ -1786,7 +1798,10 @@ extern "C" { pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSMaximumInscribedCircle(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSMaximumInscribedCircle( + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSLargestEmptyCircle( @@ -1842,7 +1857,10 @@ extern "C" { pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; } extern "C" { - pub fn GEOSUnaryUnionPrec(g: *const GEOSGeometry, gridSize: libc::c_double) -> *mut GEOSGeometry; + pub fn GEOSUnaryUnionPrec( + g: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; } extern "C" { pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; From ccc43340f8e82863a602e77997d09ef10aa946f7 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Thu, 23 Jun 2022 10:57:53 -0700 Subject: [PATCH 23/31] use CLI param for GEOS header file path instead of env vars --- geos-sys-bind/Cargo.toml | 2 + geos-sys-bind/README.md | 19 ++++---- geos-sys-bind/src/main.rs | 91 ++++++++++++++++++++++++--------------- 3 files changed, 69 insertions(+), 43 deletions(-) diff --git a/geos-sys-bind/Cargo.toml b/geos-sys-bind/Cargo.toml index 1e5b2ba..4a35308 100644 --- a/geos-sys-bind/Cargo.toml +++ b/geos-sys-bind/Cargo.toml @@ -7,5 +7,7 @@ description = "Generate GEOS C API bindings" [dependencies] bindgen = "0.60.1" +clap = { version = "3.2.6", features = ["derive"] } pkg-config = "0.3.25" +regex = "1.5" semver = "1.0" diff --git a/geos-sys-bind/README.md b/geos-sys-bind/README.md index 6f91c20..0be9fac 100644 --- a/geos-sys-bind/README.md +++ b/geos-sys-bind/README.md @@ -17,22 +17,23 @@ This crate will attempt to automatically detect your installation of GEOS: - `pkg-config` is used to automatically detect GEOS >= 3.9 - `geos-config` is used to automatically detect GEOS < 3.9 -If GEOS is in a custom location, you can instead use environment variables to -configure GEOS detection (both must be set): - -- `GEOS_INCLUDE_DIR` -- `GEOS_VERSION` - ## Adding a new GEOS version ### 1. Generate new bindings -Install the desired GEOS version on your system and then run: +By default, the bindings are generated against your installed version of GEOS: ```bash cargo run ``` +You can also use the `-h` / `--header` command line flag to specify the location +of the GEOS header file: + +```bash +cargo run -- --header +``` + This will produce a new binding in `geos-sys/prebuilt-bindings/geos_..rs` based on the major and minor version of your system-installed GEOS. @@ -42,9 +43,9 @@ will be problematic to integrate in Rust, such as data types that vary by architecture. Common data types are provided using `libc`. You can compare to bindings from a previous version of GEOS for reference. -### 2. Add new feature +### 2. Add feature entry for new version -Add a new version feature for this GEOS version with the pattern +Add a new feature entry for this GEOS version with the pattern `"v__0"` to `Cargo.toml` in the root of this repository and `sys/Cargo.toml`. The feature for each newer version of GEOS depends on the previous version. diff --git a/geos-sys-bind/src/main.rs b/geos-sys-bind/src/main.rs index ad59173..6bf60c1 100644 --- a/geos-sys-bind/src/main.rs +++ b/geos-sys-bind/src/main.rs @@ -1,7 +1,9 @@ use bindgen::Builder; +use clap::Parser; use pkg_config::Config; +use regex::Regex; use semver::Version; -use std::env; +use std::fs; use std::io; use std::path::{Path, PathBuf}; use std::process::{exit, Command}; @@ -9,7 +11,7 @@ use std::process::{exit, Command}; const MINIMUM_GEOS_VERSION: &str = "3.6.0"; struct GEOSConfig { - include_dir: PathBuf, + header: String, version: Version, } @@ -41,7 +43,11 @@ fn detect_geos_via_geos_config() -> Option { assert!(geos_config.len() == 2); Some(GEOSConfig { - include_dir: PathBuf::from(geos_config[0].trim()), + header: PathBuf::from(geos_config[0].trim()) + .join("geos_c.h") + .to_str() + .unwrap() + .to_string(), version: parse_geos_version(geos_config[1]), }) } @@ -61,10 +67,12 @@ fn detect_geos_via_pkg_config() -> Option { match &geos_pkg_config { Ok(geos) => { // GEOS should only have one include path for geos_c.h header - // include_path = PathBuf::from(geos.include_paths.first().unwrap()); - // version = parse_geos_version(&geos.version); Some(GEOSConfig { - include_dir: PathBuf::from(geos.include_paths.first().unwrap()), + header: PathBuf::from(geos.include_paths.first().unwrap()) + .join("geos_c.h") + .to_str() + .unwrap() + .to_string(), version: parse_geos_version(&geos.version), }) } @@ -81,16 +89,12 @@ fn detect_geos_via_pkg_config() -> Option { } /// Generate bindings based on GEOS header file -fn write_bindings(include_dir: &Path, out_path: &Path) { - let geos_header = include_dir.join("geos_c.h").to_str().unwrap().to_string(); - +fn write_bindings(geos_header: &str, out_path: &Path) { println!("Generating bindings using GEOS header: {}", geos_header); Builder::default() .size_t_is_usize(true) .header(geos_header) - .clang_arg("-I") - .clang_arg(include_dir.to_str().unwrap()) // use libc instead of default std::os::raw .ctypes_prefix("libc") // avoid converting double / float to f64 / f32 @@ -111,7 +115,6 @@ fn write_bindings(include_dir: &Path, out_path: &Path) { .blocklist_function("GEOSGeomToWKT.*") .blocklist_function("GEOSSingleSidedBuffer.*") .blocklist_function("GEOSUnionCascaded.*") - // TODO: remove; these were deprecated a long time ago but are still used here // .blocklist_function("GEOS_getWKBOutputDims.*") // .blocklist_function("GEOS_setWKBOutputDims.*") @@ -128,34 +131,54 @@ fn write_bindings(include_dir: &Path, out_path: &Path) { println!("Bindings generated successfully; please review the results"); } +#[derive(Parser, Debug)] +#[clap(about)] +struct Args { + /// GEOS geos_c.h header file path + #[clap(short = 'h', long = "header")] + header: Option, +} + fn main() { + let args = Args::parse(); + let mut config: Option; - let include_dir_env = env::var_os("GEOS_INCLUDE_DIR"); - let version_env = env::var_os("GEOS_VERSION"); + if args.header.is_some() { + let header_path = args.header.unwrap(); - if include_dir_env.is_some() || version_env.is_some() { - // GEOS_INCLUDE_DIR - let include_dir = match include_dir_env { - Some(path) => PathBuf::from(path), - None => { - println!("GEOS_INCLUDE_DIR must be set"); - exit(1); - } - }; + if !header_path.exists() { + println!("header path {:?} does not exist", header_path); + exit(1); + } - // GEOS_VERSION - let version = match version_env { - Some(raw_version) => parse_geos_version(&raw_version.to_string_lossy().to_string()), - None => { - println!("GEOS_VERSION must be set"); - exit(1); - } - }; + if !header_path.is_file() { + println!("header path {:?} is not a file", header_path); + exit(1); + } + + let header = header_path + .canonicalize() + .unwrap() + .to_str() + .unwrap() + .to_string(); + + // Extract version from header; always follows a consistent pattern + let content = fs::read_to_string(&header).expect("Could not read GEOS header file"); + let re = Regex::new(r#"define GEOS_VERSION "\S+""#).unwrap(); + let raw_version = re + .find(&content) + .map(|x| { + let mut split = x.as_str().split('"'); + split.next(); + split.next().unwrap() + }) + .expect("Could not read GEOS_VERSION from GEOS header file"); config = Some(GEOSConfig { - include_dir, - version, + header, + version: parse_geos_version(raw_version), }) } else { // try to detect using pkg-config, if available @@ -209,5 +232,5 @@ fn main() { } } - write_bindings(&detected.include_dir, &out_path); + write_bindings(&detected.header, &out_path); } From 201c7ca00317460fbf08c4f967d98bdec8932ef8 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Thu, 23 Jun 2022 13:37:40 -0700 Subject: [PATCH 24/31] Remove 3.11, simplify CI, don't link to bindings if building docs --- .github/workflows/CI.yml | 78 +- sys/Cargo.toml | 1 + sys/build.rs | 42 +- sys/prebuilt-bindings/geos_3.11.rs | 2900 ---------------------------- sys/src/lib.rs | 1 + 5 files changed, 17 insertions(+), 3005 deletions(-) delete mode 100644 sys/prebuilt-bindings/geos_3.11.rs diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 32e362a..2f11fc3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -71,6 +71,7 @@ jobs: LD_LIBRARY_PATH: /usr/local/lib GEOS_LIB_DIR: "/usr/lib/x86_64-linux-gnu" GEOS_VERSION: ${{ matrix.geos }} + strategy: fail-fast: false matrix: @@ -80,11 +81,9 @@ jobs: geos: - "3.6.5" - "3.7.5" - - "3.8.1" # TEMP: since 3.8.1 worked previously - "3.8.3" - "3.9.3" - "3.10.3" - - "3.11.0beta1" steps: - uses: actions/checkout@v2 @@ -135,80 +134,23 @@ jobs: cmake -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release .. sudo ninja install - - name: Build geos crate - run: | - cargo build - - - name: Build GEOS 3.6.0 features - if: ${{ startsWith(matrix.geos, '3.6') }} - run: | - cargo build --features v3_6_0 - - - name: Build GEOS 3.7.0 features - if: ${{ startsWith(matrix.geos, '3.7') }} + - name: Set version feature env run: | - cargo build --features v3_7_0 + echo "VERSION_FEATURE=v$(echo ${{ matrix.geos }} | sed 's/\./_/g')" >> $GITHUB_ENV - - name: Build GEOS 3.8.0 features - if: ${{ startsWith(matrix.geos, '3.8') }} - run: | - cargo build --features v3_8_0 - - - name: Build GEOS 3.9.0 features - if: ${{ startsWith(matrix.geos, '3.9') }} - run: | - cargo build --features v3_9_0 - - - name: Build GEOS 3.10.0 features - if: ${{ startsWith(matrix.geos, '3.10') }} - run: | - cargo build --features v3_10_0 - - - name: Build GEOS 3.11.0 features - if: ${{ startsWith(matrix.geos, '3.11') }} + - name: Build geos crate run: | - cargo build --features v3_11_0 + cargo build + cargo build --features 'geo,json' + cargo build --features $VERSION_FEATURE + cargo build --features '$VERSION_FEATURE,geo,son' - name: Run geos tests run: | cargo test cargo test --features 'geo,json' - - - name: Test GEOS 3.6.0 features - if: ${{ startsWith(matrix.geos, '3.6') }} - run: | - cargo test --features v3_6_0 - cargo test --features 'v3_6_0,geo,json' - - - name: Test GEOS 3.7.0 features - if: ${{ startsWith(matrix.geos, '3.7') }} - run: | - cargo test --features v3_7_0 - cargo test --features 'v3_7_0,geo,json' - - - name: Test GEOS 3.8.0 features - if: ${{ startsWith(matrix.geos, '3.8') }} - run: | - cargo test --features v3_8_0 - cargo test --features 'v3_8_0,geo,json' - - - name: Test GEOS 3.9.0 features - if: ${{ startsWith(matrix.geos, '3.9') }} - run: | - cargo test --features v3_9_0 - cargo test --features 'v3_9_0,geo,json' - - - name: Test GEOS 3.10.0 features - if: ${{ startsWith(matrix.geos, '3.10') }} - run: | - cargo test --features v3_10_0 - cargo test --features 'v3_10_0,geo,json' - - - name: Test GEOS 3.11.0 features - if: ${{ startsWith(matrix.geos, '3.11') }} - run: | - cargo test --features v3_11_0 - cargo test --features 'v3_11_0,geo,json' + cargo test --features $VERSION_FEATURE + cargo test --features '$VERSION_FEATURE,geo,son' - name: Check doc generation run: | diff --git a/sys/Cargo.toml b/sys/Cargo.toml index 8fc080b..efebee1 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -29,6 +29,7 @@ name = "geos_sys" [features] default = [] +dox = [] static = ["geos-src", "link-cplusplus"] v3_6_0 = [] v3_7_0 = [] diff --git a/sys/build.rs b/sys/build.rs index aa962e9..09e893d 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -77,41 +77,16 @@ fn detect_geos_via_pkg_config() -> Option { } } -/// Hardcode a prebuilt binding version while generating docs. -/// Otherwise docs.rs will explode due to not actually having libgeos installed. -fn set_bindings_for_docs(out_path: &PathBuf) { - let version = Version::parse(BUNDLED_GEOS_VERSION).expect("invalid version for docs.rs"); - println!( - "cargo:rustc-cfg=geos_sys_{}_{}_{}", - version.major, version.minor, version.patch - ); - - let binding_path = PathBuf::from(format!( - "prebuilt-bindings/geos_{}.{}.rs", - version.major, version.minor - )); - - if !binding_path.exists() { - panic!("Missing bindings for docs.rs (version {})", version); - } - - std::fs::copy(&binding_path, &out_path).expect("Can't copy bindings to output directory"); -} +#[cfg(feature = "dox")] +fn main() {} // skip linking to bindings if generating docs +#[cfg(not(feature = "dox"))] fn main() { println!("cargo:rerun-if-changed=build.rs"); - println!("cargo:rerun-if-env-changed=GEOS_INCLUDE_DIR"); println!("cargo:rerun-if-env-changed=GEOS_LIB_DIR"); - // println!("cargo:rerun-if-env-changed=GEOS_VERSION"); + println!("cargo:rerun-if-env-changed=GEOS_VERSION"); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs"); - // let mut version = Version::new(0, 0, 0); - // let include_path: PathBuf; - - if env::var("DOCS_RS").is_ok() { - set_bindings_for_docs(&out_path); - return; - } let mut version: Option; let lib_dir_env = env::var_os("GEOS_LIB_DIR"); @@ -207,13 +182,6 @@ fn main() { binding_version = Version::new(3, 10, 0); } - if cfg!(feature = "v3_11_0") { - // binding_version = Version::new(3, 11, 0); - - // FIXME: remove string parsing once released - binding_version = Version::parse("3.11.0-beta2").unwrap(); - } - if version < binding_version { panic!("You requested a version of GEOS ({}.{}) that is greater than your installed GEOS version ({}.{}.{})", binding_version.major, binding_version.minor, version.major, version.minor, version.patch); } @@ -233,7 +201,7 @@ fn main() { std::fs::copy(&binding_path, &out_path).expect("Can't copy bindings to output directory"); println!( - "cargo:rustc-cfg=geos_sys_{}_{}", + "cargo:rustc-cfg=geos_sys_{}_{}_0", binding_version.major, binding_version.minor ); } diff --git a/sys/prebuilt-bindings/geos_3.11.rs b/sys/prebuilt-bindings/geos_3.11.rs deleted file mode 100644 index 1f0b05e..0000000 --- a/sys/prebuilt-bindings/geos_3.11.rs +++ /dev/null @@ -1,2900 +0,0 @@ -/* automatically generated by rust-bindgen 0.60.1 */ - -pub const GEOS_VERSION_MAJOR: u32 = 3; -pub const GEOS_VERSION_MINOR: u32 = 11; -pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; -pub const GEOS_CAPI_VERSION_MINOR: u32 = 16; -pub const GEOS_CAPI_VERSION_PATCH: u32 = 0; -pub type wchar_t = libc::c_int; -pub type max_align_t = u128; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSContextHandle_HS { - _unused: [u8; 0], -} -pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; -pub type GEOSMessageHandler = - ::std::option::Option; -pub type GEOSMessageHandler_r = ::std::option::Option< - unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSGeom_t { - _unused: [u8; 0], -} -pub type GEOSGeometry = GEOSGeom_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSPrepGeom_t { - _unused: [u8; 0], -} -pub type GEOSPreparedGeometry = GEOSPrepGeom_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSCoordSeq_t { - _unused: [u8; 0], -} -pub type GEOSCoordSequence = GEOSCoordSeq_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSSTRtree_t { - _unused: [u8; 0], -} -pub type GEOSSTRtree = GEOSSTRtree_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSBufParams_t { - _unused: [u8; 0], -} -pub type GEOSBufferParams = GEOSBufParams_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSMakeValidParams_t { - _unused: [u8; 0], -} -pub type GEOSMakeValidParams = GEOSMakeValidParams_t; -pub type GEOSGeom = *mut GEOSGeometry; -pub type GEOSCoordSeq = *mut GEOSCoordSequence; -pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; -pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; -pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; -pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; -pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; -pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; -pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; -pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; -pub type GEOSGeomTypes = libc::c_uint; -pub const GEOSWKBByteOrders_GEOS_WKB_XDR: GEOSWKBByteOrders = 0; -pub const GEOSWKBByteOrders_GEOS_WKB_NDR: GEOSWKBByteOrders = 1; -pub type GEOSWKBByteOrders = libc::c_uint; -pub const GEOSWKBFlavors_GEOS_WKB_EXTENDED: GEOSWKBFlavors = 1; -pub const GEOSWKBFlavors_GEOS_WKB_ISO: GEOSWKBFlavors = 2; -pub type GEOSWKBFlavors = libc::c_uint; -pub type GEOSQueryCallback = ::std::option::Option< - unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), ->; -pub type GEOSDistanceCallback = ::std::option::Option< - unsafe extern "C" fn( - item1: *const libc::c_void, - item2: *const libc::c_void, - distance: *mut libc::c_double, - userdata: *mut libc::c_void, - ) -> libc::c_int, ->; -pub type GEOSTransformXYCallback = ::std::option::Option< - unsafe extern "C" fn( - x: *mut libc::c_double, - y: *mut libc::c_double, - userdata: *mut libc::c_void, - ) -> libc::c_int, ->; -pub type GEOSInterruptCallback = ::std::option::Option; -extern "C" { - pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; -} -extern "C" { - pub fn GEOS_interruptRequest(); -} -extern "C" { - pub fn GEOS_interruptCancel(); -} -extern "C" { - pub fn GEOS_init_r() -> GEOSContextHandle_t; -} -extern "C" { - pub fn GEOS_finish_r(handle: GEOSContextHandle_t); -} -extern "C" { - pub fn GEOSContext_setNoticeHandler_r( - extHandle: GEOSContextHandle_t, - nf: GEOSMessageHandler, - ) -> GEOSMessageHandler; -} -extern "C" { - pub fn GEOSContext_setErrorHandler_r( - extHandle: GEOSContextHandle_t, - ef: GEOSMessageHandler, - ) -> GEOSMessageHandler; -} -extern "C" { - pub fn GEOSContext_setNoticeMessageHandler_r( - extHandle: GEOSContextHandle_t, - nf: GEOSMessageHandler_r, - userData: *mut libc::c_void, - ) -> GEOSMessageHandler_r; -} -extern "C" { - pub fn GEOSContext_setErrorMessageHandler_r( - extHandle: GEOSContextHandle_t, - ef: GEOSMessageHandler_r, - userData: *mut libc::c_void, - ) -> GEOSMessageHandler_r; -} -extern "C" { - pub fn GEOSCoordSeq_create_r( - handle: GEOSContextHandle_t, - size: libc::c_uint, - dims: libc::c_uint, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSCoordSeq_copyFromBuffer_r( - handle: GEOSContextHandle_t, - buf: *const libc::c_double, - size: libc::c_uint, - hasZ: libc::c_int, - hasM: libc::c_int, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSCoordSeq_copyFromArrays_r( - handle: GEOSContextHandle_t, - x: *const libc::c_double, - y: *const libc::c_double, - z: *const libc::c_double, - m: *const libc::c_double, - size: libc::c_uint, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSCoordSeq_copyToBuffer_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - buf: *mut libc::c_double, - hasZ: libc::c_int, - hasM: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_copyToArrays_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - x: *mut libc::c_double, - y: *mut libc::c_double, - z: *mut libc::c_double, - m: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_clone_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); -} -extern "C" { - pub fn GEOSCoordSeq_setX_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - val: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setY_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - val: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setZ_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - val: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setXY_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - x: libc::c_double, - y: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setXYZ_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - x: libc::c_double, - y: libc::c_double, - z: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setOrdinate_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - dim: libc::c_uint, - val: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getX_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: libc::c_uint, - val: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getY_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: libc::c_uint, - val: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getZ_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: libc::c_uint, - val: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getXY_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: libc::c_uint, - x: *mut libc::c_double, - y: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getXYZ_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: libc::c_uint, - x: *mut libc::c_double, - y: *mut libc::c_double, - z: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getOrdinate_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - idx: libc::c_uint, - dim: libc::c_uint, - val: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getSize_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - size: *mut libc::c_uint, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getDimensions_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - dims: *mut libc::c_uint, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_isCCW_r( - handle: GEOSContextHandle_t, - s: *const GEOSCoordSequence, - is_ccw: *mut libc::c_char, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSProject_r( - handle: GEOSContextHandle_t, - line: *const GEOSGeometry, - point: *const GEOSGeometry, - ) -> libc::c_double; -} -extern "C" { - pub fn GEOSInterpolate_r( - handle: GEOSContextHandle_t, - line: *const GEOSGeometry, - d: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSProjectNormalized_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - p: *const GEOSGeometry, - ) -> libc::c_double; -} -extern "C" { - pub fn GEOSInterpolateNormalized_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - d: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBuffer_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - width: libc::c_double, - quadsegs: libc::c_int, - ) -> *mut GEOSGeometry; -} -pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; -pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; -pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; -pub type GEOSBufCapStyles = libc::c_uint; -pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; -pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; -pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; -pub type GEOSBufJoinStyles = libc::c_uint; -extern "C" { - pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; -} -extern "C" { - pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); -} -extern "C" { - pub fn GEOSBufferParams_setEndCapStyle_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - style: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferParams_setJoinStyle_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - joinStyle: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferParams_setMitreLimit_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - mitreLimit: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferParams_setQuadrantSegments_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - quadSegs: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferParams_setSingleSided_r( - handle: GEOSContextHandle_t, - p: *mut GEOSBufferParams, - singleSided: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferWithParams_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - p: *const GEOSBufferParams, - width: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBufferWithStyle_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - width: libc::c_double, - quadsegs: libc::c_int, - endCapStyle: libc::c_int, - joinStyle: libc::c_int, - mitreLimit: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSDensify_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSOffsetCurve_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - width: libc::c_double, - quadsegs: libc::c_int, - joinStyle: libc::c_int, - mitreLimit: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createPoint_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createPointFromXY_r( - handle: GEOSContextHandle_t, - x: libc::c_double, - y: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createLinearRing_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createLineString_r( - handle: GEOSContextHandle_t, - s: *mut GEOSCoordSequence, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createPolygon_r( - handle: GEOSContextHandle_t, - shell: *mut GEOSGeometry, - holes: *mut *mut GEOSGeometry, - nholes: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createCollection_r( - handle: GEOSContextHandle_t, - type_: libc::c_int, - geoms: *mut *mut GEOSGeometry, - ngeoms: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createEmptyCollection_r( - handle: GEOSContextHandle_t, - type_: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createRectangle_r( - handle: GEOSContextHandle_t, - xmin: libc::c_double, - ymin: libc::c_double, - xmax: libc::c_double, - ymax: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_clone_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); -} -extern "C" { - pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) - -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSIntersection_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSIntersectionPrec_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSConvexHull_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSConcaveHull_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ratio: libc::c_double, - allowHoles: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonHullSimplify_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - isOuter: libc::c_uint, - vertexNumFraction: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonHullSimplifyMode_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - isOuter: libc::c_uint, - parameterMode: libc::c_uint, - parameter: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSConcaveHullOfPolygons_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - lengthRatio: libc::c_double, - isTight: libc::c_uint, - isHolesAllowed: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMinimumRotatedRectangle_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMaximumInscribedCircle_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSLargestEmptyCircle_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - boundary: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMinimumWidth_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMinimumClearanceLine_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMinimumClearance_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - distance: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSDifference_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSDifferencePrec_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSymDifference_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSymDifferencePrec_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) - -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSUnion_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSUnionPrec_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSUnaryUnion_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSUnaryUnionPrec_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSCoverageUnion_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPointOnSurface_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGetCentroid_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMinimumBoundingCircle_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - radius: *mut libc::c_double, - center: *mut *mut GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSClipByRect_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - xmin: libc::c_double, - ymin: libc::c_double, - xmax: libc::c_double, - ymax: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonize_r( - handle: GEOSContextHandle_t, - geoms: *const *const GEOSGeometry, - ngeoms: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonize_valid_r( - handle: GEOSContextHandle_t, - geoms: *const *const GEOSGeometry, - ngems: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonizer_getCutEdges_r( - handle: GEOSContextHandle_t, - geoms: *const *const GEOSGeometry, - ngeoms: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonize_full_r( - handle: GEOSContextHandle_t, - input: *const GEOSGeometry, - cuts: *mut *mut GEOSGeometry, - dangles: *mut *mut GEOSGeometry, - invalidRings: *mut *mut GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBuildArea_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSLineMerge_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSLineMergeDirected_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSimplify_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSTopologyPreserveSimplify_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_extractUniquePoints_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSharedPaths_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSnap_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSDelaunayTriangulation_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: libc::c_double, - onlyEdges: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSConstrainedDelaunayTriangulation_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSVoronoiDiagram_r( - extHandle: GEOSContextHandle_t, - g: *const GEOSGeometry, - env: *const GEOSGeometry, - tolerance: libc::c_double, - onlyEdges: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSegmentIntersection_r( - extHandle: GEOSContextHandle_t, - ax0: libc::c_double, - ay0: libc::c_double, - ax1: libc::c_double, - ay1: libc::c_double, - bx0: libc::c_double, - by0: libc::c_double, - bx1: libc::c_double, - by1: libc::c_double, - cx: *mut libc::c_double, - cy: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSDisjoint_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSTouches_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSIntersects_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSCrosses_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSWithin_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSContains_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSOverlaps_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSEquals_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSEqualsExact_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSCovers_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSCoveredBy_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPrepare_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *const GEOSPreparedGeometry; -} -extern "C" { - pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); -} -extern "C" { - pub fn GEOSPreparedContains_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedContainsProperly_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedCoveredBy_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedCovers_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedCrosses_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedDisjoint_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedIntersects_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedOverlaps_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedTouches_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedWithin_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedNearestPoints_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSPreparedDistance_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSPreparedDistanceWithin_r( - handle: GEOSContextHandle_t, - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - dist: libc::c_double, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSSTRtree_create_r( - handle: GEOSContextHandle_t, - nodeCapacity: usize, - ) -> *mut GEOSSTRtree; -} -extern "C" { - pub fn GEOSSTRtree_insert_r( - handle: GEOSContextHandle_t, - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - item: *mut libc::c_void, - ); -} -extern "C" { - pub fn GEOSSTRtree_query_r( - handle: GEOSContextHandle_t, - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - callback: GEOSQueryCallback, - userdata: *mut libc::c_void, - ); -} -extern "C" { - pub fn GEOSSTRtree_nearest_r( - handle: GEOSContextHandle_t, - tree: *mut GEOSSTRtree, - geom: *const GEOSGeometry, - ) -> *const GEOSGeometry; -} -extern "C" { - pub fn GEOSSTRtree_nearest_generic_r( - handle: GEOSContextHandle_t, - tree: *mut GEOSSTRtree, - item: *const libc::c_void, - itemEnvelope: *const GEOSGeometry, - distancefn: GEOSDistanceCallback, - userdata: *mut libc::c_void, - ) -> *const libc::c_void; -} -extern "C" { - pub fn GEOSSTRtree_iterate_r( - handle: GEOSContextHandle_t, - tree: *mut GEOSSTRtree, - callback: GEOSQueryCallback, - userdata: *mut libc::c_void, - ); -} -extern "C" { - pub fn GEOSSTRtree_remove_r( - handle: GEOSContextHandle_t, - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - item: *mut libc::c_void, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); -} -extern "C" { - pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; -} -pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; -pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; -pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; -pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: - GEOSRelateBoundaryNodeRules = 3; -pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: - GEOSRelateBoundaryNodeRules = 4; -pub type GEOSRelateBoundaryNodeRules = libc::c_uint; -extern "C" { - pub fn GEOSRelatePattern_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - pat: *const libc::c_char, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSRelate_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSRelatePatternMatch_r( - handle: GEOSContextHandle_t, - mat: *const libc::c_char, - pat: *const libc::c_char, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSRelateBoundaryNodeRule_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - bnr: libc::c_int, - ) -> *mut libc::c_char; -} -pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; -pub type GEOSValidFlags = libc::c_uint; -extern "C" { - pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSisValidReason_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSisValidDetail_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - flags: libc::c_int, - reason: *mut *mut libc::c_char, - location: *mut *mut GEOSGeometry, - ) -> libc::c_char; -} -pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_LINEWORK: GEOSMakeValidMethods = 0; -pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_STRUCTURE: GEOSMakeValidMethods = 1; -pub type GEOSMakeValidMethods = libc::c_uint; -extern "C" { - pub fn GEOSMakeValidParams_create_r(extHandle: GEOSContextHandle_t) - -> *mut GEOSMakeValidParams; -} -extern "C" { - pub fn GEOSMakeValidParams_destroy_r( - handle: GEOSContextHandle_t, - parms: *mut GEOSMakeValidParams, - ); -} -extern "C" { - pub fn GEOSMakeValidParams_setKeepCollapsed_r( - handle: GEOSContextHandle_t, - p: *mut GEOSMakeValidParams, - style: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSMakeValidParams_setMethod_r( - handle: GEOSContextHandle_t, - p: *mut GEOSMakeValidParams, - method: GEOSMakeValidMethods, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSMakeValid_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMakeValidWithParams_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - makeValidParams: *const GEOSMakeValidParams, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSRemoveRepeatedPoints_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) - -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); -} -extern "C" { - pub fn GEOSGeom_getUserData_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut libc::c_void; -} -extern "C" { - pub fn GEOSGeom_setUserData_r( - handle: GEOSContextHandle_t, - g: *mut GEOSGeometry, - userData: *mut libc::c_void, - ); -} -extern "C" { - pub fn GEOSGetNumGeometries_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGetGeometryN_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - n: libc::c_int, - ) -> *const GEOSGeometry; -} -extern "C" { - pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; -} -pub const GEOSPrecisionRules_GEOS_PREC_VALID_OUTPUT: GEOSPrecisionRules = 0; -pub const GEOSPrecisionRules_GEOS_PREC_NO_TOPO: GEOSPrecisionRules = 1; -pub const GEOSPrecisionRules_GEOS_PREC_KEEP_COLLAPSED: GEOSPrecisionRules = 2; -pub type GEOSPrecisionRules = libc::c_uint; -extern "C" { - pub fn GEOSGeom_setPrecision_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - gridSize: libc::c_double, - flags: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_getPrecision_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> libc::c_double; -} -extern "C" { - pub fn GEOSGetNumInteriorRings_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetNumPoints_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetX_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - x: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetY_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - y: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetZ_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - z: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGetInteriorRingN_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - n: libc::c_int, - ) -> *const GEOSGeometry; -} -extern "C" { - pub fn GEOSGetExteriorRing_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *const GEOSGeometry; -} -extern "C" { - pub fn GEOSGetNumCoordinates_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getCoordSeq_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *const GEOSCoordSequence; -} -extern "C" { - pub fn GEOSGeom_getDimensions_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getCoordinateDimension_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getXMin_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - value: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getYMin_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - value: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getXMax_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - value: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getYMax_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - value: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getExtent_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - xmin: *mut libc::c_double, - ymin: *mut libc::c_double, - xmax: *mut libc::c_double, - ymax: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetPointN_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - n: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomGetStartPoint_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomGetEndPoint_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSArea_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - area: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSLength_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - length: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSDistance_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSDistanceWithin_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: libc::c_double, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSDistanceIndexed_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSHausdorffDistance_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSHausdorffDistanceDensify_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - densifyFrac: libc::c_double, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSFrechetDistance_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSFrechetDistanceDensify_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - densifyFrac: libc::c_double, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSHilbertCode_r( - handle: GEOSContextHandle_t, - geom: *const GEOSGeometry, - extent: *const GEOSGeometry, - level: libc::c_uint, - code: *mut libc::c_uint, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetLength_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - length: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSNearestPoints_r( - handle: GEOSContextHandle_t, - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSGeom_transformXY_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - callback: GEOSTransformXYCallback, - userdata: *mut libc::c_void, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSOrientationIndex_r( - handle: GEOSContextHandle_t, - Ax: libc::c_double, - Ay: libc::c_double, - Bx: libc::c_double, - By: libc::c_double, - Px: libc::c_double, - Py: libc::c_double, - ) -> libc::c_int; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSWKTReader_t { - _unused: [u8; 0], -} -pub type GEOSWKTReader = GEOSWKTReader_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSWKTWriter_t { - _unused: [u8; 0], -} -pub type GEOSWKTWriter = GEOSWKTWriter_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSWKBReader_t { - _unused: [u8; 0], -} -pub type GEOSWKBReader = GEOSWKBReader_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSWKBWriter_t { - _unused: [u8; 0], -} -pub type GEOSWKBWriter = GEOSWKBWriter_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSGeoJSONReader_t { - _unused: [u8; 0], -} -pub type GEOSGeoJSONReader = GEOSGeoJSONReader_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GEOSGeoJSONWriter_t { - _unused: [u8; 0], -} -pub type GEOSGeoJSONWriter = GEOSGeoJSONWriter_t; -extern "C" { - pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; -} -extern "C" { - pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); -} -extern "C" { - pub fn GEOSWKTReader_read_r( - handle: GEOSContextHandle_t, - reader: *mut GEOSWKTReader, - wkt: *const libc::c_char, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; -} -extern "C" { - pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); -} -extern "C" { - pub fn GEOSWKTWriter_write_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - g: *const GEOSGeometry, - ) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSWKTWriter_setTrim_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - trim: libc::c_char, - ); -} -extern "C" { - pub fn GEOSWKTWriter_setRoundingPrecision_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - precision: libc::c_int, - ); -} -extern "C" { - pub fn GEOSWKTWriter_setOutputDimension_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - dim: libc::c_int, - ); -} -extern "C" { - pub fn GEOSWKTWriter_getOutputDimension_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKTWriter_setOld3D_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKTWriter, - useOld3D: libc::c_int, - ); -} -extern "C" { - pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; -} -extern "C" { - pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); -} -extern "C" { - pub fn GEOSWKBReader_read_r( - handle: GEOSContextHandle_t, - reader: *mut GEOSWKBReader, - wkb: *const libc::c_uchar, - size: usize, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSWKBReader_readHEX_r( - handle: GEOSContextHandle_t, - reader: *mut GEOSWKBReader, - hex: *const libc::c_uchar, - size: usize, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; -} -extern "C" { - pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); -} -extern "C" { - pub fn GEOSWKBWriter_write_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - g: *const GEOSGeometry, - size: *mut usize, - ) -> *mut libc::c_uchar; -} -extern "C" { - pub fn GEOSWKBWriter_writeHEX_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - g: *const GEOSGeometry, - size: *mut usize, - ) -> *mut libc::c_uchar; -} -extern "C" { - pub fn GEOSWKBWriter_getOutputDimension_r( - handle: GEOSContextHandle_t, - writer: *const GEOSWKBWriter, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKBWriter_setOutputDimension_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - newDimension: libc::c_int, - ); -} -extern "C" { - pub fn GEOSWKBWriter_getByteOrder_r( - handle: GEOSContextHandle_t, - writer: *const GEOSWKBWriter, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKBWriter_setByteOrder_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - byteOrder: libc::c_int, - ); -} -extern "C" { - pub fn GEOSWKBWriter_getFlavor_r( - handle: GEOSContextHandle_t, - writer: *const GEOSWKBWriter, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKBWriter_setFlavor_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - flavor: libc::c_int, - ); -} -extern "C" { - pub fn GEOSWKBWriter_getIncludeSRID_r( - handle: GEOSContextHandle_t, - writer: *const GEOSWKBWriter, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSWKBWriter_setIncludeSRID_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSWKBWriter, - writeSRID: libc::c_char, - ); -} -extern "C" { - pub fn GEOSGeoJSONReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONReader; -} -extern "C" { - pub fn GEOSGeoJSONReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSGeoJSONReader); -} -extern "C" { - pub fn GEOSGeoJSONReader_readGeometry_r( - handle: GEOSContextHandle_t, - reader: *mut GEOSGeoJSONReader, - geojson: *const libc::c_char, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeoJSONWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONWriter; -} -extern "C" { - pub fn GEOSGeoJSONWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSGeoJSONWriter); -} -extern "C" { - pub fn GEOSGeoJSONWriter_writeGeometry_r( - handle: GEOSContextHandle_t, - writer: *mut GEOSGeoJSONWriter, - g: *const GEOSGeometry, - indent: libc::c_int, - ) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); -} -extern "C" { - pub fn GEOSversion() -> *const libc::c_char; -} -extern "C" { - pub fn GEOSFree(buffer: *mut libc::c_void); -} -extern "C" { - pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSCoordSeq_copyFromBuffer( - buf: *const libc::c_double, - size: libc::c_uint, - hasZ: libc::c_int, - hasM: libc::c_int, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSCoordSeq_copyFromArrays( - x: *const libc::c_double, - y: *const libc::c_double, - z: *const libc::c_double, - m: *const libc::c_double, - size: libc::c_uint, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSCoordSeq_copyToBuffer( - s: *const GEOSCoordSequence, - buf: *mut libc::c_double, - hasZ: libc::c_int, - hasM: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_copyToArrays( - s: *const GEOSCoordSequence, - x: *mut libc::c_double, - y: *mut libc::c_double, - z: *mut libc::c_double, - m: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); -} -extern "C" { - pub fn GEOSCoordSeq_setX( - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - val: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setY( - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - val: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setZ( - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - val: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setXY( - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - x: libc::c_double, - y: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setXYZ( - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - x: libc::c_double, - y: libc::c_double, - z: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_setOrdinate( - s: *mut GEOSCoordSequence, - idx: libc::c_uint, - dim: libc::c_uint, - val: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getX( - s: *const GEOSCoordSequence, - idx: libc::c_uint, - val: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getY( - s: *const GEOSCoordSequence, - idx: libc::c_uint, - val: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getZ( - s: *const GEOSCoordSequence, - idx: libc::c_uint, - val: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getXY( - s: *const GEOSCoordSequence, - idx: libc::c_uint, - x: *mut libc::c_double, - y: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getXYZ( - s: *const GEOSCoordSequence, - idx: libc::c_uint, - x: *mut libc::c_double, - y: *mut libc::c_double, - z: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getOrdinate( - s: *const GEOSCoordSequence, - idx: libc::c_uint, - dim: libc::c_uint, - val: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getSize( - s: *const GEOSCoordSequence, - size: *mut libc::c_uint, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_getDimensions( - s: *const GEOSCoordSequence, - dims: *mut libc::c_uint, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSCoordSeq_isCCW( - s: *const GEOSCoordSequence, - is_ccw: *mut libc::c_char, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createPointFromXY(x: libc::c_double, y: libc::c_double) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createPolygon( - shell: *mut GEOSGeometry, - holes: *mut *mut GEOSGeometry, - nholes: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createCollection( - type_: libc::c_int, - geoms: *mut *mut GEOSGeometry, - ngeoms: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_createRectangle( - xmin: libc::c_double, - ymin: libc::c_double, - xmax: libc::c_double, - ymax: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); -} -extern "C" { - pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; -} -extern "C" { - pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> libc::c_double; -} -extern "C" { - pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; -} -extern "C" { - pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; -} -extern "C" { - pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; -} -extern "C" { - pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_getExtent( - g: *const GEOSGeometry, - xmin: *mut libc::c_double, - ymin: *mut libc::c_double, - xmax: *mut libc::c_double, - ymax: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); -} -extern "C" { - pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); -} -extern "C" { - pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; -} -extern "C" { - pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSisValidDetail( - g: *const GEOSGeometry, - flags: libc::c_int, - reason: *mut *mut libc::c_char, - location: *mut *mut GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMakeValidWithParams( - g: *const GEOSGeometry, - makeValidParams: *const GEOSMakeValidParams, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMakeValidParams_create() -> *mut GEOSMakeValidParams; -} -extern "C" { - pub fn GEOSMakeValidParams_destroy(parms: *mut GEOSMakeValidParams); -} -extern "C" { - pub fn GEOSMakeValidParams_setMethod( - p: *mut GEOSMakeValidParams, - method: GEOSMakeValidMethods, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSMakeValidParams_setKeepCollapsed( - p: *mut GEOSMakeValidParams, - keepCollapsed: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSRemoveRepeatedPoints( - g: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; -} -extern "C" { - pub fn GEOSDistance( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSDistanceWithin( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: libc::c_double, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSDistanceIndexed( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSNearestPoints( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSHausdorffDistance( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSHausdorffDistanceDensify( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - densifyFrac: libc::c_double, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSFrechetDistance( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSFrechetDistanceDensify( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - densifyFrac: libc::c_double, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> libc::c_double; -} -extern "C" { - pub fn GEOSInterpolate(line: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSProjectNormalized( - line: *const GEOSGeometry, - point: *const GEOSGeometry, - ) -> libc::c_double; -} -extern "C" { - pub fn GEOSInterpolateNormalized( - line: *const GEOSGeometry, - proportion: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSIntersectionPrec( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSDifferencePrec( - ga: *const GEOSGeometry, - gb: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSymDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) - -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSymDifferencePrec( - ga: *const GEOSGeometry, - gb: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSUnion(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSUnionPrec( - ga: *const GEOSGeometry, - gb: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSUnaryUnionPrec( - g: *const GEOSGeometry, - gridSize: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSClipByRect( - g: *const GEOSGeometry, - xmin: libc::c_double, - ymin: libc::c_double, - xmax: libc::c_double, - ymax: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBuffer( - g: *const GEOSGeometry, - width: libc::c_double, - quadsegs: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; -} -extern "C" { - pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); -} -extern "C" { - pub fn GEOSBufferParams_setEndCapStyle( - p: *mut GEOSBufferParams, - style: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferParams_setJoinStyle( - p: *mut GEOSBufferParams, - joinStyle: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferParams_setMitreLimit( - p: *mut GEOSBufferParams, - mitreLimit: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferParams_setQuadrantSegments( - p: *mut GEOSBufferParams, - quadSegs: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferParams_setSingleSided( - p: *mut GEOSBufferParams, - singleSided: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSBufferWithParams( - g: *const GEOSGeometry, - p: *const GEOSBufferParams, - width: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBufferWithStyle( - g: *const GEOSGeometry, - width: libc::c_double, - quadsegs: libc::c_int, - endCapStyle: libc::c_int, - joinStyle: libc::c_int, - mitreLimit: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSOffsetCurve( - g: *const GEOSGeometry, - width: libc::c_double, - quadsegs: libc::c_int, - joinStyle: libc::c_int, - mitreLimit: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSConcaveHull( - g: *const GEOSGeometry, - ratio: libc::c_double, - allowHoles: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonHullSimplify( - g: *const GEOSGeometry, - isOuter: libc::c_uint, - vertexNumFraction: libc::c_double, - ) -> *mut GEOSGeometry; -} -pub const GEOSPolygonHullParameterModes_GEOSHULL_PARAM_VERTEX_RATIO: GEOSPolygonHullParameterModes = - 1; -pub const GEOSPolygonHullParameterModes_GEOSHULL_PARAM_AREA_RATIO: GEOSPolygonHullParameterModes = - 2; -pub type GEOSPolygonHullParameterModes = libc::c_uint; -extern "C" { - pub fn GEOSPolygonHullSimplifyMode( - g: *const GEOSGeometry, - isOuter: libc::c_uint, - parameterMode: libc::c_uint, - parameter: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSConcaveHullOfPolygons( - g: *const GEOSGeometry, - lengthRatio: libc::c_double, - isTight: libc::c_uint, - isHolesAllowed: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMaximumInscribedCircle( - g: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSLargestEmptyCircle( - obstacles: *const GEOSGeometry, - boundary: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSMinimumBoundingCircle( - g: *const GEOSGeometry, - radius: *mut libc::c_double, - center: *mut *mut GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSDelaunayTriangulation( - g: *const GEOSGeometry, - tolerance: libc::c_double, - onlyEdges: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSConstrainedDelaunayTriangulation(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSVoronoiDiagram( - g: *const GEOSGeometry, - env: *const GEOSGeometry, - tolerance: libc::c_double, - onlyEdges: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonize( - geoms: *const *const GEOSGeometry, - ngeoms: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonize_valid( - geoms: *const *const GEOSGeometry, - ngeoms: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonizer_getCutEdges( - geoms: *const *const GEOSGeometry, - ngeoms: libc::c_uint, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSPolygonize_full( - input: *const GEOSGeometry, - cuts: *mut *mut GEOSGeometry, - dangles: *mut *mut GEOSGeometry, - invalid: *mut *mut GEOSGeometry, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSDensify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSLineMergeDirected(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSTopologyPreserveSimplify( - g: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSHilbertCode( - geom: *const GEOSGeometry, - extent: *const GEOSGeometry, - level: libc::c_uint, - code: *mut libc::c_uint, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeom_transformXY( - g: *const GEOSGeometry, - callback: GEOSTransformXYCallback, - userdata: *mut libc::c_void, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSSnap( - input: *const GEOSGeometry, - snap_target: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeom_setPrecision( - g: *const GEOSGeometry, - gridSize: libc::c_double, - flags: libc::c_int, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; -} -extern "C" { - pub fn GEOSEqualsExact( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - tolerance: libc::c_double, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSRelatePattern( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - pat: *const libc::c_char, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSRelatePatternMatch( - mat: *const libc::c_char, - pat: *const libc::c_char, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSRelateBoundaryNodeRule( - g1: *const GEOSGeometry, - g2: *const GEOSGeometry, - bnr: libc::c_int, - ) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; -} -extern "C" { - pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); -} -extern "C" { - pub fn GEOSPreparedContains( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedContainsProperly( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedCoveredBy( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedCovers( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedCrosses( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedDisjoint( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedIntersects( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedOverlaps( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedTouches( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedWithin( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSPreparedNearestPoints( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - ) -> *mut GEOSCoordSequence; -} -extern "C" { - pub fn GEOSPreparedDistance( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - dist: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSPreparedDistanceWithin( - pg1: *const GEOSPreparedGeometry, - g2: *const GEOSGeometry, - dist: libc::c_double, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; -} -extern "C" { - pub fn GEOSSTRtree_insert( - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - item: *mut libc::c_void, - ); -} -extern "C" { - pub fn GEOSSTRtree_query( - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - callback: GEOSQueryCallback, - userdata: *mut libc::c_void, - ); -} -extern "C" { - pub fn GEOSSTRtree_nearest( - tree: *mut GEOSSTRtree, - geom: *const GEOSGeometry, - ) -> *const GEOSGeometry; -} -extern "C" { - pub fn GEOSSTRtree_nearest_generic( - tree: *mut GEOSSTRtree, - item: *const libc::c_void, - itemEnvelope: *const GEOSGeometry, - distancefn: GEOSDistanceCallback, - userdata: *mut libc::c_void, - ) -> *const libc::c_void; -} -extern "C" { - pub fn GEOSSTRtree_iterate( - tree: *mut GEOSSTRtree, - callback: GEOSQueryCallback, - userdata: *mut libc::c_void, - ); -} -extern "C" { - pub fn GEOSSTRtree_remove( - tree: *mut GEOSSTRtree, - g: *const GEOSGeometry, - item: *mut libc::c_void, - ) -> libc::c_char; -} -extern "C" { - pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); -} -extern "C" { - pub fn GEOSSegmentIntersection( - ax0: libc::c_double, - ay0: libc::c_double, - ax1: libc::c_double, - ay1: libc::c_double, - bx0: libc::c_double, - by0: libc::c_double, - bx1: libc::c_double, - by1: libc::c_double, - cx: *mut libc::c_double, - cy: *mut libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSOrientationIndex( - Ax: libc::c_double, - Ay: libc::c_double, - Bx: libc::c_double, - By: libc::c_double, - Px: libc::c_double, - Py: libc::c_double, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; -} -extern "C" { - pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); -} -extern "C" { - pub fn GEOSWKTReader_read( - reader: *mut GEOSWKTReader, - wkt: *const libc::c_char, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; -} -extern "C" { - pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); -} -extern "C" { - pub fn GEOSWKTWriter_write( - writer: *mut GEOSWKTWriter, - g: *const GEOSGeometry, - ) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); -} -extern "C" { - pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); -} -extern "C" { - pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); -} -extern "C" { - pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); -} -extern "C" { - pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; -} -extern "C" { - pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); -} -extern "C" { - pub fn GEOSWKBReader_read( - reader: *mut GEOSWKBReader, - wkb: *const libc::c_uchar, - size: usize, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSWKBReader_readHEX( - reader: *mut GEOSWKBReader, - hex: *const libc::c_uchar, - size: usize, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; -} -extern "C" { - pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); -} -extern "C" { - pub fn GEOSWKBWriter_write( - writer: *mut GEOSWKBWriter, - g: *const GEOSGeometry, - size: *mut usize, - ) -> *mut libc::c_uchar; -} -extern "C" { - pub fn GEOSWKBWriter_writeHEX( - writer: *mut GEOSWKBWriter, - g: *const GEOSGeometry, - size: *mut usize, - ) -> *mut libc::c_uchar; -} -extern "C" { - pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); -} -extern "C" { - pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); -} -extern "C" { - pub fn GEOSWKBWriter_getFlavor(writer: *const GEOSWKBWriter) -> libc::c_int; -} -extern "C" { - pub fn GEOSWKBWriter_setFlavor(writer: *mut GEOSWKBWriter, flavor: libc::c_int); -} -extern "C" { - pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; -} -extern "C" { - pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); -} -extern "C" { - pub fn GEOSGeoJSONReader_create() -> *mut GEOSGeoJSONReader; -} -extern "C" { - pub fn GEOSGeoJSONReader_destroy(reader: *mut GEOSGeoJSONReader); -} -extern "C" { - pub fn GEOSGeoJSONReader_readGeometry( - reader: *mut GEOSGeoJSONReader, - geojson: *const libc::c_char, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeoJSONWriter_create() -> *mut GEOSGeoJSONWriter; -} -extern "C" { - pub fn GEOSGeoJSONWriter_destroy(writer: *mut GEOSGeoJSONWriter); -} -extern "C" { - pub fn GEOSGeoJSONWriter_writeGeometry( - writer: *mut GEOSGeoJSONWriter, - g: *const GEOSGeometry, - indent: libc::c_int, - ) -> *mut libc::c_char; -} -extern "C" { - pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; -} -extern "C" { - pub fn GEOS_setWKBOutputDims_r( - handle: GEOSContextHandle_t, - newDims: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; -} -extern "C" { - pub fn GEOS_setWKBByteOrder_r( - handle: GEOSContextHandle_t, - byteOrder: libc::c_int, - ) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomFromWKB_buf_r( - handle: GEOSContextHandle_t, - wkb: *const libc::c_uchar, - size: usize, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomToWKB_buf_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - size: *mut usize, - ) -> *mut libc::c_uchar; -} -extern "C" { - pub fn GEOSGeomFromHEX_buf_r( - handle: GEOSContextHandle_t, - hex: *const libc::c_uchar, - size: usize, - ) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomToHEX_buf_r( - handle: GEOSContextHandle_t, - g: *const GEOSGeometry, - size: *mut usize, - ) -> *mut libc::c_uchar; -} -extern "C" { - pub fn GEOS_getWKBOutputDims() -> libc::c_int; -} -extern "C" { - pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; -} -extern "C" { - pub fn GEOS_getWKBByteOrder() -> libc::c_int; -} -extern "C" { - pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; -} -extern "C" { - pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; -} -extern "C" { - pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; -} -extern "C" { - pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; -} diff --git a/sys/src/lib.rs b/sys/src/lib.rs index ef5d171..566dc82 100644 --- a/sys/src/lib.rs +++ b/sys/src/lib.rs @@ -21,4 +21,5 @@ extern crate libc; #[cfg(feature = "static")] extern crate link_cplusplus; +#[cfg(not(feature = "dox"))] include!(concat!(env!("OUT_DIR"), "/bindings.rs")); From 1cec8d6c95d5656d215dfc7274d6f20e4152c15e Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Thu, 23 Jun 2022 13:52:02 -0700 Subject: [PATCH 25/31] Fix CI version feature --- .github/workflows/CI.yml | 37 ++++++++++++++++++++++--------------- sys/Cargo.toml | 1 - 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2f11fc3..531cea0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -78,13 +78,16 @@ jobs: toolchain: - stable - nightly - geos: - - "3.6.5" - - "3.7.5" - - "3.8.3" - - "3.9.3" - - "3.10.3" - + geos: ["3.6.5", "3.7.5", "3.8.3", "3.9.3", "3.10.3"] + include: + - geos: "3.7.5" + version_feature: "v3_7_0" + - geos: "3.8.3" + version_feature: "v3_8_0" + - geos: "3.9.3" + version_feature: "v3_9_0" + - geos: "3.10.3" + version_feature: "v3_10_0" steps: - uses: actions/checkout@v2 with: @@ -134,23 +137,27 @@ jobs: cmake -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release .. sudo ninja install - - name: Set version feature env - run: | - echo "VERSION_FEATURE=v$(echo ${{ matrix.geos }} | sed 's/\./_/g')" >> $GITHUB_ENV - - name: Build geos crate run: | cargo build cargo build --features 'geo,json' - cargo build --features $VERSION_FEATURE - cargo build --features '$VERSION_FEATURE,geo,son' + + - name: Build geos crate for GEOS version > 3.6 + if: ${{ matrix.version_feature }} + run: | + cargo build --features ${{ matrix.version_feature }} + cargo build --features '${{ matrix.version_feature }},geo,json' - name: Run geos tests run: | cargo test cargo test --features 'geo,json' - cargo test --features $VERSION_FEATURE - cargo test --features '$VERSION_FEATURE,geo,son' + + - name: Run geos tests for GEOS version > 3.6 + if: ${{ matrix.version_feature }} + run: | + cargo test --features ${{ matrix.version_feature }} + cargo test --features '${{ matrix.version_feature }},geo,json' - name: Check doc generation run: | diff --git a/sys/Cargo.toml b/sys/Cargo.toml index efebee1..8c30be6 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -31,7 +31,6 @@ name = "geos_sys" default = [] dox = [] static = ["geos-src", "link-cplusplus"] -v3_6_0 = [] v3_7_0 = [] v3_8_0 = [] v3_9_0 = [] From 49138e6f9955479e6c57e52ab6312ebd7a4b44f7 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Thu, 23 Jun 2022 14:10:39 -0700 Subject: [PATCH 26/31] Fix remove of v3_6_0 from main crate --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2825e5e..336a119 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ geo = ["geo-types", "wkt"] json = ["geojson"] static = ["geos-sys/static"] -v3_6_0 = ["geos-sys/v3_6_0"] +v3_6_0 = [] v3_7_0 = ["geos-sys/v3_7_0", "v3_6_0"] v3_8_0 = ["geos-sys/v3_8_0", "v3_7_0"] v3_9_0 = ["geos-sys/v3_9_0", "v3_8_0"] From 30e8232935db4ef40f016811edec632bc372a390 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Sat, 9 Jul 2022 07:29:01 -0700 Subject: [PATCH 27/31] Add GEOS 3.11 now that officially released --- .github/workflows/CI.yml | 4 +- sys/prebuilt-bindings/geos_3.11.rs | 2921 ++++++++++++++++++++++++++++ 2 files changed, 2924 insertions(+), 1 deletion(-) create mode 100644 sys/prebuilt-bindings/geos_3.11.rs diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 531cea0..1cf2eb3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -78,7 +78,7 @@ jobs: toolchain: - stable - nightly - geos: ["3.6.5", "3.7.5", "3.8.3", "3.9.3", "3.10.3"] + geos: ["3.6.5", "3.7.5", "3.8.3", "3.9.3", "3.10.3", "3.11.0"] include: - geos: "3.7.5" version_feature: "v3_7_0" @@ -88,6 +88,8 @@ jobs: version_feature: "v3_9_0" - geos: "3.10.3" version_feature: "v3_10_0" + - geos: "3.11.0" + version_feature: "v3_11_0" steps: - uses: actions/checkout@v2 with: diff --git a/sys/prebuilt-bindings/geos_3.11.rs b/sys/prebuilt-bindings/geos_3.11.rs new file mode 100644 index 0000000..d7488fa --- /dev/null +++ b/sys/prebuilt-bindings/geos_3.11.rs @@ -0,0 +1,2921 @@ +/* automatically generated by rust-bindgen 0.60.1 */ + +pub const GEOS_VERSION_MAJOR: u32 = 3; +pub const GEOS_VERSION_MINOR: u32 = 11; +pub const GEOS_VERSION_PATCH: u32 = 0; +pub const GEOS_CAPI_VERSION_MAJOR: u32 = 1; +pub const GEOS_CAPI_VERSION_MINOR: u32 = 17; +pub const GEOS_CAPI_VERSION_PATCH: u32 = 0; +pub type wchar_t = libc::c_int; +pub type max_align_t = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSContextHandle_HS { + _unused: [u8; 0], +} +pub type GEOSContextHandle_t = *mut GEOSContextHandle_HS; +pub type GEOSMessageHandler = + ::std::option::Option; +pub type GEOSMessageHandler_r = ::std::option::Option< + unsafe extern "C" fn(message: *const libc::c_char, userdata: *mut libc::c_void), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeom_t { + _unused: [u8; 0], +} +pub type GEOSGeometry = GEOSGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSPrepGeom_t { + _unused: [u8; 0], +} +pub type GEOSPreparedGeometry = GEOSPrepGeom_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSCoordSeq_t { + _unused: [u8; 0], +} +pub type GEOSCoordSequence = GEOSCoordSeq_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSSTRtree_t { + _unused: [u8; 0], +} +pub type GEOSSTRtree = GEOSSTRtree_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSBufParams_t { + _unused: [u8; 0], +} +pub type GEOSBufferParams = GEOSBufParams_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSMakeValidParams_t { + _unused: [u8; 0], +} +pub type GEOSMakeValidParams = GEOSMakeValidParams_t; +pub type GEOSGeom = *mut GEOSGeometry; +pub type GEOSCoordSeq = *mut GEOSCoordSequence; +pub const GEOSGeomTypes_GEOS_POINT: GEOSGeomTypes = 0; +pub const GEOSGeomTypes_GEOS_LINESTRING: GEOSGeomTypes = 1; +pub const GEOSGeomTypes_GEOS_LINEARRING: GEOSGeomTypes = 2; +pub const GEOSGeomTypes_GEOS_POLYGON: GEOSGeomTypes = 3; +pub const GEOSGeomTypes_GEOS_MULTIPOINT: GEOSGeomTypes = 4; +pub const GEOSGeomTypes_GEOS_MULTILINESTRING: GEOSGeomTypes = 5; +pub const GEOSGeomTypes_GEOS_MULTIPOLYGON: GEOSGeomTypes = 6; +pub const GEOSGeomTypes_GEOS_GEOMETRYCOLLECTION: GEOSGeomTypes = 7; +pub type GEOSGeomTypes = libc::c_uint; +pub const GEOSWKBByteOrders_GEOS_WKB_XDR: GEOSWKBByteOrders = 0; +pub const GEOSWKBByteOrders_GEOS_WKB_NDR: GEOSWKBByteOrders = 1; +pub type GEOSWKBByteOrders = libc::c_uint; +pub const GEOSWKBFlavors_GEOS_WKB_EXTENDED: GEOSWKBFlavors = 1; +pub const GEOSWKBFlavors_GEOS_WKB_ISO: GEOSWKBFlavors = 2; +pub type GEOSWKBFlavors = libc::c_uint; +pub type GEOSQueryCallback = ::std::option::Option< + unsafe extern "C" fn(item: *mut libc::c_void, userdata: *mut libc::c_void), +>; +pub type GEOSDistanceCallback = ::std::option::Option< + unsafe extern "C" fn( + item1: *const libc::c_void, + item2: *const libc::c_void, + distance: *mut libc::c_double, + userdata: *mut libc::c_void, + ) -> libc::c_int, +>; +pub type GEOSTransformXYCallback = ::std::option::Option< + unsafe extern "C" fn( + x: *mut libc::c_double, + y: *mut libc::c_double, + userdata: *mut libc::c_void, + ) -> libc::c_int, +>; +pub type GEOSInterruptCallback = ::std::option::Option; +extern "C" { + pub fn GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback) -> GEOSInterruptCallback; +} +extern "C" { + pub fn GEOS_interruptRequest(); +} +extern "C" { + pub fn GEOS_interruptCancel(); +} +extern "C" { + pub fn GEOS_init_r() -> GEOSContextHandle_t; +} +extern "C" { + pub fn GEOS_finish_r(handle: GEOSContextHandle_t); +} +extern "C" { + pub fn GEOSContext_setNoticeHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setErrorHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler, + ) -> GEOSMessageHandler; +} +extern "C" { + pub fn GEOSContext_setNoticeMessageHandler_r( + extHandle: GEOSContextHandle_t, + nf: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + pub fn GEOSContext_setErrorMessageHandler_r( + extHandle: GEOSContextHandle_t, + ef: GEOSMessageHandler_r, + userData: *mut libc::c_void, + ) -> GEOSMessageHandler_r; +} +extern "C" { + pub fn GEOSCoordSeq_create_r( + handle: GEOSContextHandle_t, + size: libc::c_uint, + dims: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_copyFromBuffer_r( + handle: GEOSContextHandle_t, + buf: *const libc::c_double, + size: libc::c_uint, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_copyFromArrays_r( + handle: GEOSContextHandle_t, + x: *const libc::c_double, + y: *const libc::c_double, + z: *const libc::c_double, + m: *const libc::c_double, + size: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_copyToBuffer_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + buf: *mut libc::c_double, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_copyToArrays_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, + m: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_clone_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXY_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: libc::c_double, + y: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXYZ_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXY_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut libc::c_double, + y: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXYZ_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_isCCW_r( + handle: GEOSContextHandle_t, + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSProject_r( + handle: GEOSContextHandle_t, + line: *const GEOSGeometry, + point: *const GEOSGeometry, + ) -> libc::c_double; +} +extern "C" { + pub fn GEOSInterpolate_r( + handle: GEOSContextHandle_t, + line: *const GEOSGeometry, + d: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSGeometry, + ) -> libc::c_double; +} +extern "C" { + pub fn GEOSInterpolateNormalized_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + d: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +pub const GEOSBufCapStyles_GEOSBUF_CAP_ROUND: GEOSBufCapStyles = 1; +pub const GEOSBufCapStyles_GEOSBUF_CAP_FLAT: GEOSBufCapStyles = 2; +pub const GEOSBufCapStyles_GEOSBUF_CAP_SQUARE: GEOSBufCapStyles = 3; +pub type GEOSBufCapStyles = libc::c_uint; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_ROUND: GEOSBufJoinStyles = 1; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_MITRE: GEOSBufJoinStyles = 2; +pub const GEOSBufJoinStyles_GEOSBUF_JOIN_BEVEL: GEOSBufJoinStyles = 3; +pub type GEOSBufJoinStyles = libc::c_uint; +extern "C" { + pub fn GEOSBufferParams_create_r(handle: GEOSContextHandle_t) -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided_r( + handle: GEOSContextHandle_t, + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDensify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPoint_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPointFromXY_r( + handle: GEOSContextHandle_t, + x: libc::c_double, + y: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString_r( + handle: GEOSContextHandle_t, + s: *mut GEOSCoordSequence, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon_r( + handle: GEOSContextHandle_t, + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection_r( + handle: GEOSContextHandle_t, + type_: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createRectangle_r( + handle: GEOSContextHandle_t, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry); +} +extern "C" { + pub fn GEOSEnvelope_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersectionPrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConcaveHull_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ratio: libc::c_double, + allowHoles: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonHullSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + isOuter: libc::c_uint, + vertexNumFraction: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonHullSimplifyMode_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + isOuter: libc::c_uint, + parameterMode: libc::c_uint, + parameter: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConcaveHullOfPolygons_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + lengthRatio: libc::c_double, + isTight: libc::c_uint, + isHolesAllowed: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMaximumInscribedCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLargestEmptyCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + boundary: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearanceLine_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumClearance_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + distance: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifferencePrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifferencePrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnionPrec_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnionPrec_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSCoverageUnion_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumBoundingCircle_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + radius: *mut libc::c_double, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_valid_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngems: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges_r( + handle: GEOSContextHandle_t, + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full_r( + handle: GEOSContextHandle_t, + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalidRings: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuildArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMergeDirected_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSReverse_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConstrainedDelaunayTriangulation_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram_r( + extHandle: GEOSContextHandle_t, + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: libc::c_double, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSegmentIntersection_r( + extHandle: GEOSContextHandle_t, + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, + cx: *mut libc::c_double, + cy: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDisjoint_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSEqualsExact_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPrepare_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedNearestPoints_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSPreparedDistance_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSPreparedDistanceWithin_r( + handle: GEOSContextHandle_t, + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: libc::c_double, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_create_r( + handle: GEOSContextHandle_t, + nodeCapacity: usize, + ) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove_r( + handle: GEOSContextHandle_t, + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: *mut GEOSSTRtree); +} +extern "C" { + pub fn GEOSisEmpty_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisSimple_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MOD2: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_OGC: GEOSRelateBoundaryNodeRules = 1; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_ENDPOINT: GEOSRelateBoundaryNodeRules = 2; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MULTIVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 3; +pub const GEOSRelateBoundaryNodeRules_GEOSRELATE_BNR_MONOVALENT_ENDPOINT: + GEOSRelateBoundaryNodeRules = 4; +pub type GEOSRelateBoundaryNodeRules = libc::c_uint; +extern "C" { + pub fn GEOSRelatePattern_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch_r( + handle: GEOSContextHandle_t, + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +pub const GEOSValidFlags_GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE: GEOSValidFlags = 1; +pub type GEOSValidFlags = libc::c_uint; +extern "C" { + pub fn GEOSisValid_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_LINEWORK: GEOSMakeValidMethods = 0; +pub const GEOSMakeValidMethods_GEOS_MAKE_VALID_STRUCTURE: GEOSMakeValidMethods = 1; +pub type GEOSMakeValidMethods = libc::c_uint; +extern "C" { + pub fn GEOSMakeValidParams_create_r(extHandle: GEOSContextHandle_t) + -> *mut GEOSMakeValidParams; +} +extern "C" { + pub fn GEOSMakeValidParams_destroy_r( + handle: GEOSContextHandle_t, + parms: *mut GEOSMakeValidParams, + ); +} +extern "C" { + pub fn GEOSMakeValidParams_setKeepCollapsed_r( + handle: GEOSContextHandle_t, + p: *mut GEOSMakeValidParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSMakeValidParams_setMethod_r( + handle: GEOSContextHandle_t, + p: *mut GEOSMakeValidParams, + method: GEOSMakeValidMethods, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSMakeValid_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMakeValidWithParams_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + makeValidParams: *const GEOSMakeValidParams, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSRemoveRepeatedPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomType_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) + -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID_r(handle: GEOSContextHandle_t, g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSSetSRID_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_getUserData_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGeom_setUserData_r( + handle: GEOSContextHandle_t, + g: *mut GEOSGeometry, + userData: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSGetNumGeometries_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSNormalize_r(handle: GEOSContextHandle_t, g: *mut GEOSGeometry) -> libc::c_int; +} +pub const GEOSPrecisionRules_GEOS_PREC_VALID_OUTPUT: GEOSPrecisionRules = 0; +pub const GEOSPrecisionRules_GEOS_PREC_NO_TOPO: GEOSPrecisionRules = 1; +pub const GEOSPrecisionRules_GEOS_PREC_KEEP_COLLAPSED: GEOSPrecisionRules = 2; +pub type GEOSPrecisionRules = libc::c_uint; +extern "C" { + pub fn GEOSGeom_setPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + gridSize: libc::c_double, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_getPrecision_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_double; +} +extern "C" { + pub fn GEOSGetNumInteriorRings_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + x: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + y: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetZ_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + z: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMin_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMax_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + value: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getExtent_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + xmin: *mut libc::c_double, + ymin: *mut libc::c_double, + xmax: *mut libc::c_double, + ymax: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + n: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSArea_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + area: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistanceWithin_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: libc::c_double, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSDistanceIndexed_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: libc::c_double, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistance_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistanceDensify_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: libc::c_double, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHilbertCode_r( + handle: GEOSContextHandle_t, + geom: *const GEOSGeometry, + extent: *const GEOSGeometry, + level: libc::c_uint, + code: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + length: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints_r( + handle: GEOSContextHandle_t, + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_transformXY_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + callback: GEOSTransformXYCallback, + userdata: *mut libc::c_void, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOrientationIndex_r( + handle: GEOSContextHandle_t, + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, + ) -> libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTReader_t { + _unused: [u8; 0], +} +pub type GEOSWKTReader = GEOSWKTReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKTWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKTWriter = GEOSWKTWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBReader_t { + _unused: [u8; 0], +} +pub type GEOSWKBReader = GEOSWKBReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSWKBWriter_t { + _unused: [u8; 0], +} +pub type GEOSWKBWriter = GEOSWKBWriter_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeoJSONReader_t { + _unused: [u8; 0], +} +pub type GEOSGeoJSONReader = GEOSGeoJSONReader_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GEOSGeoJSONWriter_t { + _unused: [u8; 0], +} +pub type GEOSGeoJSONWriter = GEOSGeoJSONWriter_t; +extern "C" { + pub fn GEOSWKTReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTReader_setFixStructure_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKTReader, + doFix: libc::c_char, + ); +} +extern "C" { + pub fn GEOSWKTWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + trim: libc::c_char, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + precision: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + dim: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKTWriter, + useOld3D: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_setFixStructure_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + doFix: libc::c_char, + ); +} +extern "C" { + pub fn GEOSWKBReader_read_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + newDimension: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + byteOrder: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getFlavor_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setFlavor_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + flavor: libc::c_int, + ); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *const GEOSWKBWriter, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSWKBWriter, + writeSRID: libc::c_char, + ); +} +extern "C" { + pub fn GEOSGeoJSONReader_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONReader; +} +extern "C" { + pub fn GEOSGeoJSONReader_destroy_r(handle: GEOSContextHandle_t, reader: *mut GEOSGeoJSONReader); +} +extern "C" { + pub fn GEOSGeoJSONReader_readGeometry_r( + handle: GEOSContextHandle_t, + reader: *mut GEOSGeoJSONReader, + geojson: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeoJSONWriter_create_r(handle: GEOSContextHandle_t) -> *mut GEOSGeoJSONWriter; +} +extern "C" { + pub fn GEOSGeoJSONWriter_destroy_r(handle: GEOSContextHandle_t, writer: *mut GEOSGeoJSONWriter); +} +extern "C" { + pub fn GEOSGeoJSONWriter_writeGeometry_r( + handle: GEOSContextHandle_t, + writer: *mut GEOSGeoJSONWriter, + g: *const GEOSGeometry, + indent: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSFree_r(handle: GEOSContextHandle_t, buffer: *mut libc::c_void); +} +extern "C" { + pub fn GEOSversion() -> *const libc::c_char; +} +extern "C" { + pub fn GEOSFree(buffer: *mut libc::c_void); +} +extern "C" { + pub fn GEOSCoordSeq_create(size: libc::c_uint, dims: libc::c_uint) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_copyFromBuffer( + buf: *const libc::c_double, + size: libc::c_uint, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_copyFromArrays( + x: *const libc::c_double, + y: *const libc::c_double, + z: *const libc::c_double, + m: *const libc::c_double, + size: libc::c_uint, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_copyToBuffer( + s: *const GEOSCoordSequence, + buf: *mut libc::c_double, + hasZ: libc::c_int, + hasM: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_copyToArrays( + s: *const GEOSCoordSequence, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, + m: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_clone(s: *const GEOSCoordSequence) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSCoordSeq_destroy(s: *mut GEOSCoordSequence); +} +extern "C" { + pub fn GEOSCoordSeq_setX( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXY( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: libc::c_double, + y: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setXYZ( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + x: libc::c_double, + y: libc::c_double, + z: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_setOrdinate( + s: *mut GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getX( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + val: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXY( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut libc::c_double, + y: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getXYZ( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + x: *mut libc::c_double, + y: *mut libc::c_double, + z: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getOrdinate( + s: *const GEOSCoordSequence, + idx: libc::c_uint, + dim: libc::c_uint, + val: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getSize( + s: *const GEOSCoordSequence, + size: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_getDimensions( + s: *const GEOSCoordSequence, + dims: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSCoordSeq_isCCW( + s: *const GEOSCoordSequence, + is_ccw: *mut libc::c_char, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_createPoint(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPointFromXY(x: libc::c_double, y: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPoint() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLinearRing(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createLineString(s: *mut GEOSCoordSequence) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyLineString() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyPolygon() -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createPolygon( + shell: *mut GEOSGeometry, + holes: *mut *mut GEOSGeometry, + nholes: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createCollection( + type_: libc::c_int, + geoms: *mut *mut GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createEmptyCollection(type_: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_createRectangle( + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_clone(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_destroy(g: *mut GEOSGeometry); +} +extern "C" { + pub fn GEOSGeomType(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSGeomTypeId(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetSRID(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getUserData(g: *const GEOSGeometry) -> *mut libc::c_void; +} +extern "C" { + pub fn GEOSGetNumGeometries(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetGeometryN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_getPrecision(g: *const GEOSGeometry) -> libc::c_double; +} +extern "C" { + pub fn GEOSGetNumInteriorRings(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetNumPoints(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetX(g: *const GEOSGeometry, x: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetY(g: *const GEOSGeometry, y: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetZ(g: *const GEOSGeometry, z: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSGetInteriorRingN(g: *const GEOSGeometry, n: libc::c_int) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetExteriorRing(g: *const GEOSGeometry) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSGetNumCoordinates(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordSeq(g: *const GEOSGeometry) -> *const GEOSCoordSequence; +} +extern "C" { + pub fn GEOSGeom_getDimensions(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getCoordinateDimension(g: *const GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMin(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getXMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getYMax(g: *const GEOSGeometry, value: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_getExtent( + g: *const GEOSGeometry, + xmin: *mut libc::c_double, + ymin: *mut libc::c_double, + xmax: *mut libc::c_double, + ymax: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetPointN(g: *const GEOSGeometry, n: libc::c_int) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetStartPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomGetEndPoint(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSisEmpty(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisRing(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSHasZ(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisClosed(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSSetSRID(g: *mut GEOSGeometry, SRID: libc::c_int); +} +extern "C" { + pub fn GEOSGeom_setUserData(g: *mut GEOSGeometry, userData: *mut libc::c_void); +} +extern "C" { + pub fn GEOSNormalize(g: *mut GEOSGeometry) -> libc::c_int; +} +extern "C" { + pub fn GEOSisSimple(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValid(g: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSisValidReason(g: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSisValidDetail( + g: *const GEOSGeometry, + flags: libc::c_int, + reason: *mut *mut libc::c_char, + location: *mut *mut GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSMakeValid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMakeValidWithParams( + g: *const GEOSGeometry, + makeValidParams: *const GEOSMakeValidParams, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMakeValidParams_create() -> *mut GEOSMakeValidParams; +} +extern "C" { + pub fn GEOSMakeValidParams_destroy(parms: *mut GEOSMakeValidParams); +} +extern "C" { + pub fn GEOSMakeValidParams_setMethod( + p: *mut GEOSMakeValidParams, + method: GEOSMakeValidMethods, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSMakeValidParams_setKeepCollapsed( + p: *mut GEOSMakeValidParams, + keepCollapsed: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSMinimumClearance(g: *const GEOSGeometry, d: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSMinimumClearanceLine(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSRemoveRepeatedPoints( + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSArea(g: *const GEOSGeometry, area: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomGetLength(g: *const GEOSGeometry, length: *mut libc::c_double) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSDistanceWithin( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: libc::c_double, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSDistanceIndexed( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSNearestPoints( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSHausdorffDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSHausdorffDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: libc::c_double, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistance( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSFrechetDistanceDensify( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + densifyFrac: libc::c_double, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSProject(line: *const GEOSGeometry, point: *const GEOSGeometry) -> libc::c_double; +} +extern "C" { + pub fn GEOSInterpolate(line: *const GEOSGeometry, d: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSProjectNormalized( + line: *const GEOSGeometry, + point: *const GEOSGeometry, + ) -> libc::c_double; +} +extern "C" { + pub fn GEOSInterpolateNormalized( + line: *const GEOSGeometry, + proportion: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersection(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSIntersectionPrec( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDifferencePrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifference(ga: *const GEOSGeometry, gb: *const GEOSGeometry) + -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSymDifferencePrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnion(ga: *const GEOSGeometry, gb: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnionPrec( + ga: *const GEOSGeometry, + gb: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSUnaryUnionPrec( + g: *const GEOSGeometry, + gridSize: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSCoverageUnion(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSClipByRect( + g: *const GEOSGeometry, + xmin: libc::c_double, + ymin: libc::c_double, + xmax: libc::c_double, + ymax: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSharedPaths(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuffer( + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferParams_create() -> *mut GEOSBufferParams; +} +extern "C" { + pub fn GEOSBufferParams_destroy(parms: *mut GEOSBufferParams); +} +extern "C" { + pub fn GEOSBufferParams_setEndCapStyle( + p: *mut GEOSBufferParams, + style: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setJoinStyle( + p: *mut GEOSBufferParams, + joinStyle: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setMitreLimit( + p: *mut GEOSBufferParams, + mitreLimit: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setQuadrantSegments( + p: *mut GEOSBufferParams, + quadSegs: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferParams_setSingleSided( + p: *mut GEOSBufferParams, + singleSided: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSBufferWithParams( + g: *const GEOSGeometry, + p: *const GEOSBufferParams, + width: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBufferWithStyle( + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + endCapStyle: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSOffsetCurve( + g: *const GEOSGeometry, + width: libc::c_double, + quadsegs: libc::c_int, + joinStyle: libc::c_int, + mitreLimit: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSEnvelope(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBoundary(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConvexHull(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConcaveHull( + g: *const GEOSGeometry, + ratio: libc::c_double, + allowHoles: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonHullSimplify( + g: *const GEOSGeometry, + isOuter: libc::c_uint, + vertexNumFraction: libc::c_double, + ) -> *mut GEOSGeometry; +} +pub const GEOSPolygonHullParameterModes_GEOSHULL_PARAM_VERTEX_RATIO: GEOSPolygonHullParameterModes = + 1; +pub const GEOSPolygonHullParameterModes_GEOSHULL_PARAM_AREA_RATIO: GEOSPolygonHullParameterModes = + 2; +pub type GEOSPolygonHullParameterModes = libc::c_uint; +extern "C" { + pub fn GEOSPolygonHullSimplifyMode( + g: *const GEOSGeometry, + isOuter: libc::c_uint, + parameterMode: libc::c_uint, + parameter: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConcaveHullOfPolygons( + g: *const GEOSGeometry, + lengthRatio: libc::c_double, + isTight: libc::c_uint, + isHolesAllowed: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumRotatedRectangle(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMaximumInscribedCircle( + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLargestEmptyCircle( + obstacles: *const GEOSGeometry, + boundary: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumWidth(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPointOnSurface(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGetCentroid(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSMinimumBoundingCircle( + g: *const GEOSGeometry, + radius: *mut libc::c_double, + center: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDelaunayTriangulation( + g: *const GEOSGeometry, + tolerance: libc::c_double, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSConstrainedDelaunayTriangulation(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSVoronoiDiagram( + g: *const GEOSGeometry, + env: *const GEOSGeometry, + tolerance: libc::c_double, + onlyEdges: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSNode(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_valid( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonizer_getCutEdges( + geoms: *const *const GEOSGeometry, + ngeoms: libc::c_uint, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSPolygonize_full( + input: *const GEOSGeometry, + cuts: *mut *mut GEOSGeometry, + dangles: *mut *mut GEOSGeometry, + invalid: *mut *mut GEOSGeometry, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSBuildArea(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDensify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMerge(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSLineMergeDirected(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSReverse(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSimplify(g: *const GEOSGeometry, tolerance: libc::c_double) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSTopologyPreserveSimplify( + g: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_extractUniquePoints(g: *const GEOSGeometry) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSHilbertCode( + geom: *const GEOSGeometry, + extent: *const GEOSGeometry, + level: libc::c_uint, + code: *mut libc::c_uint, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeom_transformXY( + g: *const GEOSGeometry, + callback: GEOSTransformXYCallback, + userdata: *mut libc::c_void, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSSnap( + input: *const GEOSGeometry, + snap_target: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeom_setPrecision( + g: *const GEOSGeometry, + gridSize: libc::c_double, + flags: libc::c_int, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSDisjoint(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSTouches(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSIntersects(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCrosses(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSWithin(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSContains(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSOverlaps(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSEquals(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCovers(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSCoveredBy(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> libc::c_char; +} +extern "C" { + pub fn GEOSEqualsExact( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + tolerance: libc::c_double, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelatePattern( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelate(g1: *const GEOSGeometry, g2: *const GEOSGeometry) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSRelatePatternMatch( + mat: *const libc::c_char, + pat: *const libc::c_char, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSRelateBoundaryNodeRule( + g1: *const GEOSGeometry, + g2: *const GEOSGeometry, + bnr: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSPrepare(g: *const GEOSGeometry) -> *const GEOSPreparedGeometry; +} +extern "C" { + pub fn GEOSPreparedGeom_destroy(g: *const GEOSPreparedGeometry); +} +extern "C" { + pub fn GEOSPreparedContains( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedContainsProperly( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCoveredBy( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCovers( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedCrosses( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedDisjoint( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedIntersects( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedOverlaps( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedTouches( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSPreparedNearestPoints( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + ) -> *mut GEOSCoordSequence; +} +extern "C" { + pub fn GEOSPreparedDistance( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSPreparedDistanceWithin( + pg1: *const GEOSPreparedGeometry, + g2: *const GEOSGeometry, + dist: libc::c_double, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_create(nodeCapacity: usize) -> *mut GEOSSTRtree; +} +extern "C" { + pub fn GEOSSTRtree_insert( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_query( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_nearest( + tree: *mut GEOSSTRtree, + geom: *const GEOSGeometry, + ) -> *const GEOSGeometry; +} +extern "C" { + pub fn GEOSSTRtree_nearest_generic( + tree: *mut GEOSSTRtree, + item: *const libc::c_void, + itemEnvelope: *const GEOSGeometry, + distancefn: GEOSDistanceCallback, + userdata: *mut libc::c_void, + ) -> *const libc::c_void; +} +extern "C" { + pub fn GEOSSTRtree_iterate( + tree: *mut GEOSSTRtree, + callback: GEOSQueryCallback, + userdata: *mut libc::c_void, + ); +} +extern "C" { + pub fn GEOSSTRtree_remove( + tree: *mut GEOSSTRtree, + g: *const GEOSGeometry, + item: *mut libc::c_void, + ) -> libc::c_char; +} +extern "C" { + pub fn GEOSSTRtree_destroy(tree: *mut GEOSSTRtree); +} +extern "C" { + pub fn GEOSSegmentIntersection( + ax0: libc::c_double, + ay0: libc::c_double, + ax1: libc::c_double, + ay1: libc::c_double, + bx0: libc::c_double, + by0: libc::c_double, + bx1: libc::c_double, + by1: libc::c_double, + cx: *mut libc::c_double, + cy: *mut libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSOrientationIndex( + Ax: libc::c_double, + Ay: libc::c_double, + Bx: libc::c_double, + By: libc::c_double, + Px: libc::c_double, + Py: libc::c_double, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTReader_create() -> *mut GEOSWKTReader; +} +extern "C" { + pub fn GEOSWKTReader_destroy(reader: *mut GEOSWKTReader); +} +extern "C" { + pub fn GEOSWKTReader_read( + reader: *mut GEOSWKTReader, + wkt: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKTReader_setFixStructure(reader: *mut GEOSWKTReader, doFix: libc::c_char); +} +extern "C" { + pub fn GEOSWKTWriter_create() -> *mut GEOSWKTWriter; +} +extern "C" { + pub fn GEOSWKTWriter_destroy(writer: *mut GEOSWKTWriter); +} +extern "C" { + pub fn GEOSWKTWriter_write( + writer: *mut GEOSWKTWriter, + g: *const GEOSGeometry, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOSWKTWriter_setTrim(writer: *mut GEOSWKTWriter, trim: libc::c_char); +} +extern "C" { + pub fn GEOSWKTWriter_setRoundingPrecision(writer: *mut GEOSWKTWriter, precision: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_setOutputDimension(writer: *mut GEOSWKTWriter, dim: libc::c_int); +} +extern "C" { + pub fn GEOSWKTWriter_getOutputDimension(writer: *mut GEOSWKTWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKTWriter_setOld3D(writer: *mut GEOSWKTWriter, useOld3D: libc::c_int); +} +extern "C" { + pub fn GEOSWKBReader_create() -> *mut GEOSWKBReader; +} +extern "C" { + pub fn GEOSWKBReader_destroy(reader: *mut GEOSWKBReader); +} +extern "C" { + pub fn GEOSWKBReader_setFixStructure(reader: *mut GEOSWKBReader, doFix: libc::c_char); +} +extern "C" { + pub fn GEOSWKBReader_read( + reader: *mut GEOSWKBReader, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBReader_readHEX( + reader: *mut GEOSWKBReader, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSWKBWriter_create() -> *mut GEOSWKBWriter; +} +extern "C" { + pub fn GEOSWKBWriter_destroy(writer: *mut GEOSWKBWriter); +} +extern "C" { + pub fn GEOSWKBWriter_write( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_writeHEX( + writer: *mut GEOSWKBWriter, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSWKBWriter_getOutputDimension(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setOutputDimension(writer: *mut GEOSWKBWriter, newDimension: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getByteOrder(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setByteOrder(writer: *mut GEOSWKBWriter, byteOrder: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getFlavor(writer: *const GEOSWKBWriter) -> libc::c_int; +} +extern "C" { + pub fn GEOSWKBWriter_setFlavor(writer: *mut GEOSWKBWriter, flavor: libc::c_int); +} +extern "C" { + pub fn GEOSWKBWriter_getIncludeSRID(writer: *const GEOSWKBWriter) -> libc::c_char; +} +extern "C" { + pub fn GEOSWKBWriter_setIncludeSRID(writer: *mut GEOSWKBWriter, writeSRID: libc::c_char); +} +extern "C" { + pub fn GEOSGeoJSONReader_create() -> *mut GEOSGeoJSONReader; +} +extern "C" { + pub fn GEOSGeoJSONReader_destroy(reader: *mut GEOSGeoJSONReader); +} +extern "C" { + pub fn GEOSGeoJSONReader_readGeometry( + reader: *mut GEOSGeoJSONReader, + geojson: *const libc::c_char, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeoJSONWriter_create() -> *mut GEOSGeoJSONWriter; +} +extern "C" { + pub fn GEOSGeoJSONWriter_destroy(writer: *mut GEOSGeoJSONWriter); +} +extern "C" { + pub fn GEOSGeoJSONWriter_writeGeometry( + writer: *mut GEOSGeoJSONWriter, + g: *const GEOSGeometry, + indent: libc::c_int, + ) -> *mut libc::c_char; +} +extern "C" { + pub fn GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims_r( + handle: GEOSContextHandle_t, + newDims: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t) -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder_r( + handle: GEOSContextHandle_t, + byteOrder: libc::c_int, + ) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf_r( + handle: GEOSContextHandle_t, + wkb: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf_r( + handle: GEOSContextHandle_t, + hex: *const libc::c_uchar, + size: usize, + ) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf_r( + handle: GEOSContextHandle_t, + g: *const GEOSGeometry, + size: *mut usize, + ) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOS_getWKBOutputDims() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBOutputDims(newDims: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOS_getWKBByteOrder() -> libc::c_int; +} +extern "C" { + pub fn GEOS_setWKBByteOrder(byteOrder: libc::c_int) -> libc::c_int; +} +extern "C" { + pub fn GEOSGeomFromWKB_buf(wkb: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToWKB_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} +extern "C" { + pub fn GEOSGeomFromHEX_buf(hex: *const libc::c_uchar, size: usize) -> *mut GEOSGeometry; +} +extern "C" { + pub fn GEOSGeomToHEX_buf(g: *const GEOSGeometry, size: *mut usize) -> *mut libc::c_uchar; +} From a740a526e262ffa2e350ba98860b4f8e68ef6657 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 15 Jul 2022 17:25:23 -0700 Subject: [PATCH 28/31] Update submodule to 3.11, update build to use cfg for binding version, expand instructions --- Cargo.toml | 2 +- geos-sys-bind/README.md | 29 +++++++++++++++++++++++++++-- sys/build.rs | 39 ++++++++++++++------------------------- sys/geos-src/source | 2 +- sys/src/lib.rs | 25 ++++++++++++++++++++++--- 5 files changed, 65 insertions(+), 32 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 336a119..991a1c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ readme = "README.md" edition = "2021" [features] -dox = ["geo-types", "wkt", "json"] +dox = ["geo-types", "wkt", "json", "geos-sys/dox"] geo = ["geo-types", "wkt"] json = ["geojson"] static = ["geos-sys/static"] diff --git a/geos-sys-bind/README.md b/geos-sys-bind/README.md index 0be9fac..8f7e0fa 100644 --- a/geos-sys-bind/README.md +++ b/geos-sys-bind/README.md @@ -43,14 +43,39 @@ will be problematic to integrate in Rust, such as data types that vary by architecture. Common data types are provided using `libc`. You can compare to bindings from a previous version of GEOS for reference. -### 2. Add feature entry for new version +### 2. Add entry to `build.rs` + +Add a new entry with the following pattern toward the end of `build.rs` to +enable this binding version: + +```rust +if cfg!(feature = "v__0") { + binding_version = Version::new(, , 0); +} +``` + +### 3. Update `lib.rs` + +Add a new cfg entry to `lib.rs` with the following pattern to enable binding +against this version: + +```rust +#[cfg(geos_sys__)] +include!("../prebuilt-bindings/geos_..rs"); +``` + +Update the GEOS version number in the docstring that is used for referencing the +version of GEOS that is included in the docs; it should be based on the latest +version of GEOS. + +### 4. Add feature entry for new version Add a new feature entry for this GEOS version with the pattern `"v__0"` to `Cargo.toml` in the root of this repository and `sys/Cargo.toml`. The feature for each newer version of GEOS depends on the previous version. -### 3. Update included version of GEOS +### 5. Update included version of GEOS * update the GEOS submodule to the latest available GEOS version * update `BUNDLED_GEOS_VERSION` in `sys/build.rs` to match this version \ No newline at end of file diff --git a/sys/build.rs b/sys/build.rs index 09e893d..0acc758 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -4,7 +4,7 @@ use std::path::PathBuf; use std::process::Command; const MINIMUM_GEOS_VERSION: &str = "3.6.0"; -const BUNDLED_GEOS_VERSION: &str = "3.10.0"; +const BUNDLED_GEOS_VERSION: &str = "3.11.0"; /// standardize GEOS prerelease versions to match semver format: fn parse_geos_version(raw_version: &str) -> Version { @@ -58,12 +58,6 @@ fn detect_geos_via_pkg_config() -> Option { match &geos_pkg_config { Ok(geos) => { // GEOS should only have one include path for geos_c.h header - // include_path = PathBuf::from(geos.include_paths.first().unwrap()); - // version = parse_geos_version(&geos.version); - // Some(GEOSConfig { - // include_dir: PathBuf::from(geos.include_paths.first().unwrap()), - // version: parse_geos_version(&geos.version), - // }) Some(parse_geos_version(&geos.version)) } Err(pkg_config_err) => { @@ -78,7 +72,14 @@ fn detect_geos_via_pkg_config() -> Option { } #[cfg(feature = "dox")] -fn main() {} // skip linking to bindings if generating docs +fn main() { + let binding_version = Version::parse(BUNDLED_GEOS_VERSION).expect("Could not parse bundled GEOS version"); + + println!( + "cargo:rustc-cfg=geos_sys_{}_{}", + binding_version.major, binding_version.minor + ); +} #[cfg(not(feature = "dox"))] fn main() { @@ -86,8 +87,6 @@ fn main() { println!("cargo:rerun-if-env-changed=GEOS_LIB_DIR"); println!("cargo:rerun-if-env-changed=GEOS_VERSION"); - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs"); - let mut version: Option; let lib_dir_env = env::var_os("GEOS_LIB_DIR"); let version_env = env::var_os("GEOS_VERSION"); @@ -182,26 +181,16 @@ fn main() { binding_version = Version::new(3, 10, 0); } - if version < binding_version { - panic!("You requested a version of GEOS ({}.{}) that is greater than your installed GEOS version ({}.{}.{})", binding_version.major, binding_version.minor, version.major, version.minor, version.patch); + if cfg!(feature = "v3_11_0") { + binding_version = Version::new(3, 11, 0); } - // copy requested prebuilt binding (if exists) to output directory - let binding_path = PathBuf::from(format!( - "prebuilt-bindings/geos_{}.{}.rs", - binding_version.major, binding_version.minor - )); - - // this shouldn't happen except when a new version feature is added but the - // binding has not yet been created - if !binding_path.exists() { - panic!("No pre-built bindings available for requested GEOS version {}.{}\nUse features to select an available version.", binding_version.major, binding_version.minor); + if version < binding_version { + panic!("You requested a version of GEOS ({}.{}) that is greater than your installed GEOS version ({}.{}.{})", binding_version.major, binding_version.minor, version.major, version.minor, version.patch); } - std::fs::copy(&binding_path, &out_path).expect("Can't copy bindings to output directory"); - println!( - "cargo:rustc-cfg=geos_sys_{}_{}_0", + "cargo:rustc-cfg=geos_sys_{}_{}", binding_version.major, binding_version.minor ); } diff --git a/sys/geos-src/source b/sys/geos-src/source index 89168f1..8e7559c 160000 --- a/sys/geos-src/source +++ b/sys/geos-src/source @@ -1 +1 @@ -Subproject commit 89168f10170175379ded3f2e6bda514c575a9b6a +Subproject commit 8e7559c2f45116348c50c6410c123b203c4fc093 diff --git a/sys/src/lib.rs b/sys/src/lib.rs index 566dc82..2213b5e 100644 --- a/sys/src/lib.rs +++ b/sys/src/lib.rs @@ -1,4 +1,4 @@ -//! Low level [GEOS](https://libgeos.org/) C API bindings for GEOS >= 3.7.0. +//! Low level [GEOS](https://libgeos.org/) C API bindings for GEOS >= 3.6.0. //! //! It provides C-interface as is. If you want to use a more Rust-friendly crate, //! use the [georust/geos](https://github.com/georust/geos) crate. @@ -10,6 +10,10 @@ //! You can build the included version of GEOS using the `static` feature, which //! will also statically link libgeos to this crate. In order to build GEOS, you //! need to have `cmake` and a C++ compiler. +//! +//! This documentation is generated based on GEOS 3.11. Please see the +//! [GEOS Changelog](https://github.com/libgeos/geos/blob/main/NEWS.md) for +//! a listing of which entries were added for each GEOS version. #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -21,5 +25,20 @@ extern crate libc; #[cfg(feature = "static")] extern crate link_cplusplus; -#[cfg(not(feature = "dox"))] -include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +#[cfg(geos_sys_3_6)] +include!("../prebuilt-bindings/geos_3.6.rs"); + +#[cfg(geos_sys_3_7)] +include!("../prebuilt-bindings/geos_3.7.rs"); + +#[cfg(geos_sys_3_8)] +include!("../prebuilt-bindings/geos_3.8.rs"); + +#[cfg(geos_sys_3_9)] +include!("../prebuilt-bindings/geos_3.9.rs"); + +#[cfg(geos_sys_3_10)] +include!("../prebuilt-bindings/geos_3.10.rs"); + +#[cfg(geos_sys_3_11)] +include!("../prebuilt-bindings/geos_3.11.rs"); From 4153f561c9ca30c58bb28bcd3e42493533f250aa Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 15 Jul 2022 17:27:28 -0700 Subject: [PATCH 29/31] lint fix --- sys/build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/build.rs b/sys/build.rs index 0acc758..e0e0bb5 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -73,7 +73,8 @@ fn detect_geos_via_pkg_config() -> Option { #[cfg(feature = "dox")] fn main() { - let binding_version = Version::parse(BUNDLED_GEOS_VERSION).expect("Could not parse bundled GEOS version"); + let binding_version = + Version::parse(BUNDLED_GEOS_VERSION).expect("Could not parse bundled GEOS version"); println!( "cargo:rustc-cfg=geos_sys_{}_{}", From aebdfa9636d05f58901048bc2a342e8b6107f2eb Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 19 Jul 2022 08:50:05 -0700 Subject: [PATCH 30/31] Use version feature for cfg in lib.rs --- geos-sys-bind/README.md | 35 ++++++++++++++++++++++------------- sys/build.rs | 15 ++------------- sys/src/lib.rs | 13 +++++++------ 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/geos-sys-bind/README.md b/geos-sys-bind/README.md index 8f7e0fa..ac123d6 100644 --- a/geos-sys-bind/README.md +++ b/geos-sys-bind/README.md @@ -19,7 +19,12 @@ This crate will attempt to automatically detect your installation of GEOS: ## Adding a new GEOS version -### 1. Generate new bindings +### 1. Update included version of GEOS + +* update the GEOS submodule to the latest available GEOS version +* update `BUNDLED_GEOS_VERSION` in `sys/build.rs` to match this version + +### 2. Generate new bindings By default, the bindings are generated against your installed version of GEOS: @@ -43,7 +48,7 @@ will be problematic to integrate in Rust, such as data types that vary by architecture. Common data types are provided using `libc`. You can compare to bindings from a previous version of GEOS for reference. -### 2. Add entry to `build.rs` +### 3. Add entry to `build.rs` Add a new entry with the following pattern toward the end of `build.rs` to enable this binding version: @@ -54,28 +59,32 @@ if cfg!(feature = "v__0") { } ``` -### 3. Update `lib.rs` +### 4. Update `lib.rs` Add a new cfg entry to `lib.rs` with the following pattern to enable binding against this version: ```rust -#[cfg(geos_sys__)] +#[cfg(any(feature = "v__0", feature = "dox"))] include!("../prebuilt-bindings/geos_..rs"); ``` -Update the GEOS version number in the docstring that is used for referencing the -version of GEOS that is included in the docs; it should be based on the latest -version of GEOS. +NOTE: docs are always generated from the latest version. + -### 4. Add feature entry for new version +Update the entry for the previous version to exclude the latest version: + +```rust +#[cfg(all(feature = "v__0", not(any(feature = "v__0", feature = "dox"))))] +include!("../prebuilt-bindings/geos_..rs"); +``` + +Update the GEOS version number in the docstring at the top of `lib.rs` to the +latest version of GEOS. + +### 5. Add feature entry for new version Add a new feature entry for this GEOS version with the pattern `"v__0"` to `Cargo.toml` in the root of this repository and `sys/Cargo.toml`. The feature for each newer version of GEOS depends on the previous version. - -### 5. Update included version of GEOS - -* update the GEOS submodule to the latest available GEOS version -* update `BUNDLED_GEOS_VERSION` in `sys/build.rs` to match this version \ No newline at end of file diff --git a/sys/build.rs b/sys/build.rs index e0e0bb5..8c9f271 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -4,6 +4,7 @@ use std::path::PathBuf; use std::process::Command; const MINIMUM_GEOS_VERSION: &str = "3.6.0"; +// BUNDLED_GEOS_VERSION is the GEOS version tracked by submodule const BUNDLED_GEOS_VERSION: &str = "3.11.0"; /// standardize GEOS prerelease versions to match semver format: @@ -72,15 +73,8 @@ fn detect_geos_via_pkg_config() -> Option { } #[cfg(feature = "dox")] -fn main() { - let binding_version = - Version::parse(BUNDLED_GEOS_VERSION).expect("Could not parse bundled GEOS version"); +fn main() {} - println!( - "cargo:rustc-cfg=geos_sys_{}_{}", - binding_version.major, binding_version.minor - ); -} #[cfg(not(feature = "dox"))] fn main() { @@ -189,9 +183,4 @@ fn main() { if version < binding_version { panic!("You requested a version of GEOS ({}.{}) that is greater than your installed GEOS version ({}.{}.{})", binding_version.major, binding_version.minor, version.major, version.minor, version.patch); } - - println!( - "cargo:rustc-cfg=geos_sys_{}_{}", - binding_version.major, binding_version.minor - ); } diff --git a/sys/src/lib.rs b/sys/src/lib.rs index 2213b5e..8fcd0ae 100644 --- a/sys/src/lib.rs +++ b/sys/src/lib.rs @@ -25,20 +25,21 @@ extern crate libc; #[cfg(feature = "static")] extern crate link_cplusplus; -#[cfg(geos_sys_3_6)] + +#[cfg(not(any(feature = "v3_7_0", feature = "dox")))] include!("../prebuilt-bindings/geos_3.6.rs"); -#[cfg(geos_sys_3_7)] +#[cfg(all(feature = "v3_7_0", not(any(feature = "v3_8_0", feature = "dox"))))] include!("../prebuilt-bindings/geos_3.7.rs"); -#[cfg(geos_sys_3_8)] +#[cfg(all(feature = "v3_8_0", not(any(feature = "v3_9_0", feature = "dox"))))] include!("../prebuilt-bindings/geos_3.8.rs"); -#[cfg(geos_sys_3_9)] +#[cfg(all(feature = "v3_9_0", not(any(feature = "v3_10_0", feature = "dox"))))] include!("../prebuilt-bindings/geos_3.9.rs"); -#[cfg(geos_sys_3_10)] +#[cfg(all(feature = "v3_10_0", not(any(feature = "v3_11_0", feature = "dox"))))] include!("../prebuilt-bindings/geos_3.10.rs"); -#[cfg(geos_sys_3_11)] +#[cfg(any(feature = "v3_11_0", feature = "dox"))] include!("../prebuilt-bindings/geos_3.11.rs"); From 5776845b9e0ce03137f58bebd67ddb0cc2113636 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Fri, 22 Jul 2022 09:26:05 -0700 Subject: [PATCH 31/31] Fix lint errors --- sys/build.rs | 1 - sys/src/lib.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/sys/build.rs b/sys/build.rs index 8c9f271..ca863f4 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -75,7 +75,6 @@ fn detect_geos_via_pkg_config() -> Option { #[cfg(feature = "dox")] fn main() {} - #[cfg(not(feature = "dox"))] fn main() { println!("cargo:rerun-if-changed=build.rs"); diff --git a/sys/src/lib.rs b/sys/src/lib.rs index 8fcd0ae..34a4a8c 100644 --- a/sys/src/lib.rs +++ b/sys/src/lib.rs @@ -25,7 +25,6 @@ extern crate libc; #[cfg(feature = "static")] extern crate link_cplusplus; - #[cfg(not(any(feature = "v3_7_0", feature = "dox")))] include!("../prebuilt-bindings/geos_3.6.rs");