Rust bindings for the latest stable release of PROJ

Overview

GitHub Workflow Status

PROJ

Coordinate transformation via bindings to the PROJ v7.2.1 API.

Two coordinate transformation operations are currently provided: projection (and inverse projection) and conversion.

Projection is intended for transformations between geodetic and projected coordinates and vice versa (inverse projection), while conversion is intended for transformations between projected coordinate systems. The PROJ documentation explains the distinction between these operations in more detail.

This crate depends on libproj v7.1.x, accessed via the proj-sys crate. By default, proj-sys will try to find a pre-existing installation of libproj on your system. If an appropriate version of libproj cannot be found, the build script will attempt to build libproj from source. You may specify a from-source build with the bundled_proj feature.

Out of the box, any (x, y) numeric tuple can be provided as input to proj. You can conform your own types to the Coord trait to pass them in directly and avoid intermediate allocations. There is a geo-types feature, enabled by default, which implements this trait for types in the geo-types crate.

Methods for conversion and projection of slices of Coords are also available.

Examples

Convert from NAD 83 US Survey Feet to NAD 83 Meters Using EPSG Codes

use proj::Proj;

let from = "EPSG:2230";
let to = "EPSG:26946";
let ft_to_m = Proj::new_known_crs(&from, &to, None).unwrap();
let result = ft_to_m
    .convert((4760096.421921f64, 3744293.729449f64))
    .unwrap();
assert_relative_eq!(result.0, 1450880.2910605003);
assert_relative_eq!(result.1, 1141263.0111604529);

Convert from NAD 83 US Survey Feet to NAD 83 Meters Using the pipeline Operator

Note that as of v5.0.0, PROJ uses the pipeline operator, which allows an arbitrary number of steps in a conversion. The example below works as follows:

  • define the operation as a pipeline operation
  • define step 1 as an inverse transform, yielding geodetic coordinates
  • define step 2 as a forward transform to projected coordinates, yielding metres.
use proj::Proj;

let ft_to_m = Proj::new("
    +proj=pipeline
    +step +inv +proj=lcc +lat_1=33.88333333333333
    +lat_2=32.78333333333333 +lat_0=32.16666666666666
    +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80
    +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs
    +step +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666
    +lon_0=-116.25 +x_0=2000000 +y_0=500000
    +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
").unwrap();

// The Presidio, approximately
let result = ft_to_m.convert((4760096.421921f64, 3744293.729449f64)).unwrap();
assert_relative_eq!(result.0, 1450880.2910605003);
assert_relative_eq!(result.1, 1141263.01116045);

Inverse Projection from Stereo70 to Geodetic

use proj::Proj;

// Carry out an inverse projection from Pulkovo 1942(58) / Stereo70 (EPSG 3844)
// into geodetic lon and lat coordinates (in radians)
let stereo70 = Proj::new("
    +proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 +y_0=500000
    +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84
    +units=m +no_defs
    ").unwrap();
let geodetic_radians_point = stereo70.project(
    (500119.70352012233f64, 500027.77896348457f64), true
).unwrap();
assert_relative_eq!(geodetic_radians_point.0, 0.436332, epsilon=1e-5);
assert_relative_eq!(geodetic_radians_point.1, 0.802851, epsiolon=1e-5);

Usage

There are two options for creating a transformation:

  1. If you don't require additional grids or other customisation:
    • Call Proj::new or Proj::new_known_crs. This creates a transformation instance (Proj)
  2. If you require a grid for the transformation you wish to carry out, or you need to customise the search path or the grid endpoint:

Note:

  1. Both ProjBuilder and Proj implement the Info trait, which can be used to get information about the current state of the PROJ instance;
  2. Proj::new() and ProjBuilder::proj() have the same signature;
  3. Proj::new_known_crs() and ProjBuilder::proj_known_crs() have the same signature.

Requirements

By default, the crate requires libproj 7.1.x to be present on your system. While it may be backwards-compatible with older PROJ 6 versions, this is neither tested nor supported.

Feature Flags

  • geo-types: include trait impls for geo-types. See example.
  • pkg_config: enables the use of pkg-config when linking against libproj — note that pkg-config must be available on your system.
  • bundled_proj: builds libproj from source bundled in the proj-sys crate. Note that this feature requires Sqlite3 and libtiff to be present on your system.
  • network: exposes APIs which, when enabled, can fetch grid data from the internet to improve projection accuracy. See enable_network for details.

Network, Cache, and Search Path Functionality

Grid File Download

proj supports network grid download functionality via the network feature. Network access is disabled by default, and can be activated by passing a true bool to enable_network(). Network functionality status can be queried with network_enabled, and the download endpoint can be queried and set using get_url_endpoint and set_url_endpoint.

Grid File Cache

Up to 300 mb of downloaded grids are cached to save bandwidth: This cache can be enabled or disabled using grid_cache_enable.

Search Path Modification

The path used to search for resource files can be modified using set_search_paths

Conform your own types

If you have your own geometric types, you can conform them to the Coord trait and use proj without any intermediate allocation.

use proj::{Proj, Coord};

struct MyPointOfIntereset {
    lat: f64,
    lon: f64,
}

impl Coord<f64> for MyPointOfIntereset {
    fn x(&self) -> f64 {
        self.lon
    }
    fn y(&self) -> f64 {
        self.lat
    }
    fn from_xy(x: f64, y: f64) -> Self {
        Self { lon: x, lat: y }
    }
}

let donut_shop = MyPointOfIntereset { lat: 34.095620, lon: -118.283555 };

let from = "EPSG:4326";
let to = "EPSG:3309";
let proj = Proj::new_known_crs(&from, &to, None).unwrap();

let result = proj.convert(donut_shop).unwrap();

assert_relative_eq!(result.x(), 158458.67251293268);
assert_relative_eq!(result.y(), -434296.8803996085);

Integration with geo-types

If you've enabled the geo-types feature, you can skip allocating an intermediate representation, and pass the geo-types directly.

# use approx::assert_relative_eq;
use proj::Proj;
use geo_types::Point;

let my_point = Point::new(4760096.421921f64, 3744293.729449f64);

let from = "EPSG:2230";
let to = "EPSG:26946";
let nad_ft_to_m = Proj::new_known_crs(&from, &to, None).unwrap();

let result = nad_ft_to_m.convert(my_point).unwrap();

assert_relative_eq!(result.x(), 1450880.2910605003f64);
assert_relative_eq!(result.y(), 1141263.0111604529f64);

License: MIT/Apache-2.0

Comments
  • upgrade to proj 8.2

    upgrade to proj 8.2

    Just a draft for now as I work through some outstanding issues...

    I've made the update, and rebuilt containers, but I'm still seeing some mysterious failures...

    • ✅ proj-sys on rust-1.57
    • ✅ proj-sys on rust-1.52
    • ✅ proj on rust-1.57
      • ✅ proj w/ --features=bundle
      • ✅ proj using prebuilt proj
    • ⁉️ proj on rust-1.52
      • ✅ proj w/ --features=bundle
      • 🔥 proj using prebuilt proj

    For some reason using the pre-built libproj seems to be causing some smallish discrepencies on older containers. TBH I suspect the base system rather than the actual rust version.

    next step is to try to see if just doing an apt upgrade fixes anything...

    https://github.com/georust/proj/actions/runs/1580354293

    failures:
    ---- proj::test::test_inverse_projection stdout ----
    thread 'proj::test::test_inverse_projection' panicked at 'assert_relative_eq!(t.x(), 0.43633200013698786)
    
        left  = 0.43636512759931073
        right = 0.43633200013698786
    
    ', src/proj.rs:1069:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    ---- proj::test::test_london_inverse stdout ----
    thread 'proj::test::test_london_inverse' panicked at 'assert_relative_eq!(t.x(), 0.0023755864830313977)
    
        left  = 0.002407322568220306
        right = 0.0023755864830313977
    ', src/proj.rs:1086:9
    
    ---- proj::test::test_projection stdout ----
    thread 'proj::test::test_projection' panicked at 'assert_relative_eq!(t.x(), 500119.7035366755, epsilon = 1e-5)
    
        left  = 499972.70746607287
        right = 500119.7035366755
    
    ', src/proj.rs:1054:9
    
    
    failures:
        proj::test::test_inverse_projection
        proj::test::test_london_inverse
        proj::test::test_projection
    
    opened by michaelkirk 27
  • Link failure with `bundled_proj` feature

    Link failure with `bundled_proj` feature

    I tried to build proj with the feature bundled_proj on my fedora 30 since Proj 7.0 aren't in the repo, but I got a link failure. Was my assumption that bundled_proj would download and build Proj 7.0 from source for me?

    Cargo.toml

    [package]
    name = "transform"
    version = "0.1.0"
    authors = ["Robin Moussu <[email protected]>"]
    edition = "2018"
    
    # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
    
    [dependencies]
    proj = { version = "0.16", features = ["bundled_proj"] }
    geo-types = "0.5"
    assert_approx_eq = "1.1"
    

    src/main.rs

    use proj::Proj;
    
    use geo_types::Point;
    use assert_approx_eq::assert_approx_eq;
    
    fn main() {
        let from = "EPSG:2230";
        let to = "EPSG:26946";
        let ft_to_m = Proj::new_known_crs(&from, &to, None).unwrap();
        let result = ft_to_m
            .convert(Point::new(4760096.421921, 3744293.729449))
            .unwrap(); 
        assert_approx_eq!(result.x(), 1450880.29f64);
        assert_approx_eq!(result.y(), 1141263.01f64);
    }
    

    cargo build

    error: linking with `cc` failed: exit code: 1
      |
      = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.1asqkjk3k7ixl6zx.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.2681mjg2g6z9bivh.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.28zm14058s4yuwjn.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.2j17j5peblze6opf.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.2jgha6nmh4kj0dyv.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.2tncncqat6huxea7.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.2utm3xxp8ffopyrz.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.39vsdcc51utj53jh.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.3r74iirza2gxy0hj.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.3v7dnb83goqfhprl.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.3zueut1fhll7xfhp.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.41dbb5ves51j2w7n.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.4ef0by692cipe4xw.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.4zefe07pboib7n8f.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.5dm7jb90v8tyrml8.rcgu.o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.70oqx3mupdculkr.rcgu.o" "-o" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/transform-bdc862550f4f6879.4jtz2m3fpxr5xe14.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps" "-L" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/build/proj-sys-298128c67c6b993f/out/lib" "-L" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/libassert_approx_eq-e81f10bd1f83c9eb.rlib" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/libproj-dffd022518f913c9.rlib" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/libthiserror-8d27e2a343ff8828.rlib" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/libproj_sys-b09900959e6bd43e.rlib" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/liblibc-e8eba7335cdf1c32.rlib" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/libgeo_types-ba34af30d362b55c.rlib" "/home/rmoussu/dev/tour-generation/tour_generation/extract/transform/target/debug/deps/libnum_traits-7de0e66da3207489.rlib" "-Wl,--start-group" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-7c5e456310a1373c.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-b981d9b2a408308f.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-43d0ea1b5ae34d0d.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-09e7f22e773899cd.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-aa74f166651adf6e.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-22c386707b639611.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-db04c9c5cd3bcf45.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-bb27492f721492e8.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-6b95245dbf686e20.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-287409d75db2ecd3.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-a93f70ee2006b6e3.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-566cdfbcc94b4360.rlib" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-7bb8dddc7ce34e92.rlib" "-Wl,--end-group" "/home/rmoussu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b117658e17259aa6.rlib" "-Wl,-Bdynamic" "-lproj" "-lutil" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
      = note: /usr/bin/ld: cannot find -lproj
              collect2: error: ld returned 1 exit status
    
    opened by robinmoussu 21
  • proj w/o geo

    proj w/o geo

    It seems like the potential users of proj would include people who don't need/want to opt into the whole geo ecosystem.

    What would you think about having the proj interface be trait-based and having the geo-integration be a feature?

    If this seems like a reasonable direction, before merging I'd like to update the docs to show:

    1. how you can use this with the greater geo ecosystem
    2. how you can impl your own point type if you're not using geo.
    3. how you can use the built-in (Float, Float) impl

    WDYT @urschrei?

    opened by michaelkirk 17
  • Update to PROJ 8.1.0

    Update to PROJ 8.1.0

    • Update proj source
    • Update proj-sys
    • Update generated bindings
    • Update dependencies

    Merging is blocked on https://github.com/georust/docker-images/pull/13

    opened by urschrei 15
  • Impl drop for HandleData

    Impl drop for HandleData

    This a draft PR to investigate the possibility of improving the safety of the network functionality.

    ATM, this is just a move of the pointer-reconstitution logic into a Drop impl (This is safer than assuming a function will be called, although of course drop() isn't called on panic), but there will hopefully be more to come when I've done some more digging.

    This also fixes some unnecessary mutability and borrows, and makes the struct we pass to libproj repr c.

    opened by urschrei 14
  • use `approx` for better failure output

    use `approx` for better failure output

    Gives output like:

    assert_relative_eq!(t.x(), 1450880.29)
    
        left  = 0.0
        right = 1450880.29
    

    vs previously:

    thread 'proj::test::test_london_inverse' panicked at 'assertion failed: f > 0.99999', src/proj.rs:885:9
    
    opened by michaelkirk 13
  • Assume `tiff` to avoid unnecessary libproj builds.

    Assume `tiff` to avoid unnecessary libproj builds.

    This is a preface to unblocking https://github.com/georust/geo/pull/661 (I've integrated these changes with the geo crate here: https://github.com/georust/geo/tree/mkirk/bump_proj_810)


    This removes the bundled_proj_tiff feature (added in https://github.com/georust/proj/pull/58/files), and we now, once again, assume all proj installations support tiff. Meaning the user either:

    1. If the user has a recent system installation of libproj, it supports libtiff.
    2. Else if the user has no recent system installation of libproj, build.rs will compile it from source, which requires linking in libtiff

    The previous "bundled_proj_tiff" unfortunately conflated needing tiff with needing to build from source, even though most system proj installs will already support tiff.

    Longer explanation

    proj-sys requires a compatible libproj installation. build.rs will either use a pre-existing system installation of libproj or build libproj from source. Building from source takes a while, so it's preferable to use the system installation if it's compatible.

    tiff support is used by libproj's network grid. tiff support is required by libproj by default, though it's possible to opt out.

    When Apple first released aarch64 (M1), libtiff was failing to build, so as a stop gap we added a "bundled_proj_tiff" feature which:

    1. forced a from-source build
    2. explicitly enabled tiff support, else tiff support would be disabled, allowing us to build the proj crate on aarch64

    The underlying build failures in libtiff have now been fixed, so the original motivation for this feature no longer exists.

    There was a cost associated with keeping it - unnecessarily triggering source builds from, e.g. georust/geo crate, whose proj/network feature wants to ensure tiff is enabled. Given that most installations will have this feature, I think it will give most of our users a better experience if we can avoid the compile.

    To be clear, there is potential downside with this approach. It's still conceivable that environments exists where tiff is not, or can not be installed, but weighing that against the more common case of having libproj installed with the default configuration, and I think this approach wins.

    If this poops on too many parties, we can revisit something like the former behavior in a way that's less deleterious to the default use case - e.g. have a tiff feature that will still use the local install if it supports tiff.

    opened by michaelkirk 12
  • Put reqwest behind optional network feature

    Put reqwest behind optional network feature

    The network stuff adds quite a bit to proj dependencies and build times.

    Considering the developer has to opt in to networking anyway by calling enable_network on the context, what would you think about making them jump through one more hoop to make things better for the default user?

    With reqwest: builds 166 crates

    cargo build --release --features network
    1019.33s user 22.84s system 658% cpu 2:38.36 total
    

    Without reqwest: builds 81 crates

    cargo build --release  
    446.73s user 9.64s system 670% cpu 1:08.02 total
    

    If you think it's a good idea, I can open a PR to plumb this feature through geo.

    dependency tree:

    proj v0.20.3 (/Users/mkirk/src/georust/proj)
    ├── geo-types v0.6.0
    │   ├── approx v0.3.2
    │   │   └── num-traits v0.2.12
    │   │       [build-dependencies]
    │   │       └── autocfg v1.0.0
    │   └── num-traits v0.2.12 (*)
    ├── libc v0.2.73
    ├── num-traits v0.2.12 (*)
    ├── proj-sys v0.18.2
    │   [build-dependencies]
    │   ├── bindgen v0.52.0
    │   │   ├── bitflags v1.2.1
    │   │   ├── cexpr v0.3.6
    │   │   │   └── nom v4.2.3
    │   │   │       └── memchr v2.3.3
    │   │   │       [build-dependencies]
    │   │   │       └── version_check v0.1.5
    │   │   ├── cfg-if v0.1.10
    │   │   ├── clang-sys v0.28.1
    │   │   │   ├── glob v0.3.0
    │   │   │   ├── libc v0.2.73
    │   │   │   └── libloading v0.5.2
    │   │   │       [build-dependencies]
    │   │   │       └── cc v1.0.58
    │   │   │   [build-dependencies]
    │   │   │   └── glob v0.3.0
    │   │   ├── clap v2.33.1
    │   │   │   ├── ansi_term v0.11.0
    │   │   │   ├── atty v0.2.14
    │   │   │   │   └── libc v0.2.73
    │   │   │   ├── bitflags v1.2.1
    │   │   │   ├── strsim v0.8.0
    │   │   │   ├── textwrap v0.11.0
    │   │   │   │   └── unicode-width v0.1.8
    │   │   │   ├── unicode-width v0.1.8
    │   │   │   └── vec_map v0.8.2
    │   │   ├── env_logger v0.7.1
    │   │   │   ├── atty v0.2.14 (*)
    │   │   │   ├── humantime v1.3.0
    │   │   │   │   └── quick-error v1.2.3
    │   │   │   ├── log v0.4.11
    │   │   │   │   └── cfg-if v0.1.10
    │   │   │   ├── regex v1.3.9
    │   │   │   │   ├── aho-corasick v0.7.13
    │   │   │   │   │   └── memchr v2.3.3
    │   │   │   │   ├── memchr v2.3.3
    │   │   │   │   ├── regex-syntax v0.6.18
    │   │   │   │   └── thread_local v1.0.1
    │   │   │   │       └── lazy_static v1.4.0
    │   │   │   └── termcolor v1.1.0
    │   │   ├── lazy_static v1.4.0
    │   │   ├── lazycell v1.2.1
    │   │   ├── log v0.4.11 (*)
    │   │   ├── peeking_take_while v0.1.2
    │   │   ├── proc-macro2 v1.0.19
    │   │   │   └── unicode-xid v0.2.1
    │   │   ├── quote v1.0.7
    │   │   │   └── proc-macro2 v1.0.19 (*)
    │   │   ├── regex v1.3.9 (*)
    │   │   ├── rustc-hash v1.1.0
    │   │   ├── shlex v0.1.1
    │   │   └── which v3.1.1
    │   │       └── libc v0.2.73
    │   ├── cmake v0.1.44
    │   │   └── cc v1.0.58
    │   ├── flate2 v1.0.16
    │   │   ├── cfg-if v0.1.10
    │   │   ├── crc32fast v1.2.0
    │   │   │   └── cfg-if v0.1.10
    │   │   ├── libc v0.2.73
    │   │   └── miniz_oxide v0.4.0
    │   │       └── adler v0.2.3
    │   ├── pkg-config v0.3.18
    │   └── tar v0.4.29
    │       ├── filetime v0.2.10
    │       │   ├── cfg-if v0.1.10
    │       │   └── libc v0.2.73
    │       ├── libc v0.2.73
    │       └── xattr v0.2.2
    │           └── libc v0.2.73
    ├── reqwest v0.10.6
    │   ├── base64 v0.12.3
    │   ├── bytes v0.5.6
    │   ├── encoding_rs v0.8.23
    │   │   └── cfg-if v0.1.10
    │   ├── futures-core v0.3.5
    │   ├── futures-util v0.3.5
    │   │   ├── futures-core v0.3.5
    │   │   ├── futures-io v0.3.5
    │   │   ├── futures-macro v0.3.5
    │   │   │   ├── proc-macro-hack v0.5.18
    │   │   │   ├── proc-macro2 v1.0.19 (*)
    │   │   │   ├── quote v1.0.7 (*)
    │   │   │   └── syn v1.0.35
    │   │   │       ├── proc-macro2 v1.0.19 (*)
    │   │   │       ├── quote v1.0.7 (*)
    │   │   │       └── unicode-xid v0.2.1
    │   │   ├── futures-task v0.3.5
    │   │   │   └── once_cell v1.4.0
    │   │   ├── memchr v2.3.3
    │   │   ├── pin-project v0.4.22
    │   │   │   └── pin-project-internal v0.4.22
    │   │   │       ├── proc-macro2 v1.0.19 (*)
    │   │   │       ├── quote v1.0.7 (*)
    │   │   │       └── syn v1.0.35 (*)
    │   │   ├── pin-utils v0.1.0
    │   │   ├── proc-macro-hack v0.5.18
    │   │   ├── proc-macro-nested v0.1.6
    │   │   └── slab v0.4.2
    │   ├── http v0.2.1
    │   │   ├── bytes v0.5.6
    │   │   ├── fnv v1.0.7
    │   │   └── itoa v0.4.6
    │   ├── http-body v0.3.1
    │   │   ├── bytes v0.5.6
    │   │   └── http v0.2.1 (*)
    │   ├── hyper v0.13.7
    │   │   ├── bytes v0.5.6
    │   │   ├── futures-channel v0.3.5
    │   │   │   └── futures-core v0.3.5
    │   │   ├── futures-core v0.3.5
    │   │   ├── futures-util v0.3.5 (*)
    │   │   ├── h2 v0.2.6
    │   │   │   ├── bytes v0.5.6
    │   │   │   ├── fnv v1.0.7
    │   │   │   ├── futures-core v0.3.5
    │   │   │   ├── futures-sink v0.3.5
    │   │   │   ├── futures-util v0.3.5 (*)
    │   │   │   ├── http v0.2.1 (*)
    │   │   │   ├── indexmap v1.5.0
    │   │   │   │   └── hashbrown v0.8.1
    │   │   │   │       [build-dependencies]
    │   │   │   │       └── autocfg v1.0.0
    │   │   │   │   [build-dependencies]
    │   │   │   │   └── autocfg v1.0.0
    │   │   │   ├── slab v0.4.2
    │   │   │   ├── tokio v0.2.21
    │   │   │   │   ├── bytes v0.5.6
    │   │   │   │   ├── fnv v1.0.7
    │   │   │   │   ├── futures-core v0.3.5
    │   │   │   │   ├── iovec v0.1.4
    │   │   │   │   │   └── libc v0.2.73
    │   │   │   │   ├── lazy_static v1.4.0
    │   │   │   │   ├── memchr v2.3.3
    │   │   │   │   ├── mio v0.6.22
    │   │   │   │   │   ├── cfg-if v0.1.10
    │   │   │   │   │   ├── iovec v0.1.4 (*)
    │   │   │   │   │   ├── libc v0.2.73
    │   │   │   │   │   ├── log v0.4.11 (*)
    │   │   │   │   │   ├── net2 v0.2.34
    │   │   │   │   │   │   ├── cfg-if v0.1.10
    │   │   │   │   │   │   └── libc v0.2.73
    │   │   │   │   │   └── slab v0.4.2
    │   │   │   │   ├── num_cpus v1.13.0
    │   │   │   │   │   └── libc v0.2.73
    │   │   │   │   ├── pin-project-lite v0.1.7
    │   │   │   │   └── slab v0.4.2
    │   │   │   ├── tokio-util v0.3.1
    │   │   │   │   ├── bytes v0.5.6
    │   │   │   │   ├── futures-core v0.3.5
    │   │   │   │   ├── futures-sink v0.3.5
    │   │   │   │   ├── log v0.4.11 (*)
    │   │   │   │   ├── pin-project-lite v0.1.7
    │   │   │   │   └── tokio v0.2.21 (*)
    │   │   │   └── tracing v0.1.16
    │   │   │       ├── cfg-if v0.1.10
    │   │   │       ├── log v0.4.11 (*)
    │   │   │       └── tracing-core v0.1.11
    │   │   │           └── lazy_static v1.4.0
    │   │   ├── http v0.2.1 (*)
    │   │   ├── http-body v0.3.1 (*)
    │   │   ├── httparse v1.3.4
    │   │   ├── itoa v0.4.6
    │   │   ├── pin-project v0.4.22 (*)
    │   │   ├── socket2 v0.3.12
    │   │   │   ├── cfg-if v0.1.10
    │   │   │   └── libc v0.2.73
    │   │   ├── time v0.1.43
    │   │   │   └── libc v0.2.73
    │   │   ├── tokio v0.2.21 (*)
    │   │   ├── tower-service v0.3.0
    │   │   ├── tracing v0.1.16 (*)
    │   │   └── want v0.3.0
    │   │       ├── log v0.4.11 (*)
    │   │       └── try-lock v0.2.3
    │   ├── hyper-rustls v0.20.0
    │   │   ├── bytes v0.5.6
    │   │   ├── futures-util v0.3.5 (*)
    │   │   ├── hyper v0.13.7 (*)
    │   │   ├── log v0.4.11 (*)
    │   │   ├── rustls v0.17.0
    │   │   │   ├── base64 v0.11.0
    │   │   │   ├── log v0.4.11 (*)
    │   │   │   ├── ring v0.16.15
    │   │   │   │   ├── spin v0.5.2
    │   │   │   │   └── untrusted v0.7.1
    │   │   │   │   [build-dependencies]
    │   │   │   │   └── cc v1.0.58
    │   │   │   ├── sct v0.6.0
    │   │   │   │   ├── ring v0.16.15 (*)
    │   │   │   │   └── untrusted v0.7.1
    │   │   │   └── webpki v0.21.3
    │   │   │       ├── ring v0.16.15 (*)
    │   │   │       └── untrusted v0.7.1
    │   │   ├── tokio v0.2.21 (*)
    │   │   ├── tokio-rustls v0.13.1
    │   │   │   ├── futures-core v0.3.5
    │   │   │   ├── rustls v0.17.0 (*)
    │   │   │   ├── tokio v0.2.21 (*)
    │   │   │   └── webpki v0.21.3 (*)
    │   │   └── webpki v0.21.3 (*)
    │   ├── lazy_static v1.4.0
    │   ├── log v0.4.11 (*)
    │   ├── mime v0.3.16
    │   ├── mime_guess v2.0.3
    │   │   ├── mime v0.3.16
    │   │   └── unicase v2.6.0
    │   │       [build-dependencies]
    │   │       └── version_check v0.9.2
    │   │   [build-dependencies]
    │   │   └── unicase v2.6.0 (*)
    │   ├── percent-encoding v2.1.0
    │   ├── pin-project-lite v0.1.7
    │   ├── rustls v0.17.0 (*)
    │   ├── serde v1.0.114
    │   ├── serde_urlencoded v0.6.1
    │   │   ├── dtoa v0.4.6
    │   │   ├── itoa v0.4.6
    │   │   ├── serde v1.0.114
    │   │   └── url v2.1.1
    │   │       ├── idna v0.2.0
    │   │       │   ├── matches v0.1.8
    │   │       │   ├── unicode-bidi v0.3.4
    │   │       │   │   └── matches v0.1.8
    │   │       │   └── unicode-normalization v0.1.13
    │   │       │       └── tinyvec v0.3.3
    │   │       ├── matches v0.1.8
    │   │       └── percent-encoding v2.1.0
    │   ├── tokio v0.2.21 (*)
    │   ├── tokio-rustls v0.13.1 (*)
    │   ├── url v2.1.1 (*)
    │   └── webpki-roots v0.19.0
    │       └── webpki v0.21.3 (*)
    └── thiserror v1.0.20
        └── thiserror-impl v1.0.20
            ├── proc-macro2 v1.0.19 (*)
            ├── quote v1.0.7 (*)
            └── syn v1.0.35 (*)
    [dev-dependencies]
    └── assert_approx_eq v1.1.0
    
    opened by michaelkirk 12
  • Fix array conversion

    Fix array conversion

    My suspicion is that creating the raw pointer in the function call was causing it to be dropped prematurely, resulting in garbage data. See here for an analogous issue when getting a CString pointer. We avoid this by explicitly creating the pointer before the call. In addition, the doctest has been updated with a less complex example that doesn't use a proj string.

    opened by urschrei 10
  • Cargo features must be additive

    Cargo features must be additive

    The README talks about two feature flags that are mutually exclusive. However, as I understand, cargo features are additive. For instance, if two dependencies of a crate depend on this crate and enable the exlusive features, cargo would enable both while compiling this crate.

    @michaelkirk linked a few good examples of how other crates handle these cases here. This thread in urlo also suggests going for a environment variable based approach.

    I think the env. variable approach makes sense for our use-case, because the end user who is linking the final binary should really have the say, and not the intermediate dependencies that depend on proj.

    opened by rmanoka 10
  • Fix source build on aarch64/homebrew

    Fix source build on aarch64/homebrew

    Slightly improves the situation at #57

    On apple platforms, libtiff is not installed by the operating system. If the user has it installed, likely it was installed by homebrew.

    Previously, on x86, homebrew installed libs into /usr/lib which is in the default search path, but since aarch64, homebrew has moved libs to /opt/homebrew/lib.

    So now we use pkg-config to find the library.

    Potential problems:

    • Not everyone has pkg-config (e.g windows users, a few mac users)
    • Not everyone actually needs libtiff, only the network geotiff users, but we assume everyone needs it since most system installations include it.

    Note that proj enables tiff support by defeault, provided libtiff is found (using pkg-config? or something else?)

    This is a draft because some tests are currently failing for me on aarch64. I'm looking into it now...

    failing test output
    geos: Invalid latitude
    geos: Invalid latitude
    "proj=pipeline step proj=unitconvert xy_in=us-ft xy_out=m step inv proj=lcc lat_0=32.1666666666667 lon_0=-116.25 lat_1=33.8833333333333 lat_2=32.7833333333333 x_0=2000000.0001016 y_0=500000.0001016 ellps=GRS80 step proj=lcc lat_0=32.1666666666667 lon_0=-116.25 lat_1=33.8833333333333 lat_2=32.7833333333333 x_0=2000000 y_0=500000 ellps=GRS80"
    proj_create: unrecognized format / unknown name
    

    assert_relative_eq!(t.x(), 0.43633200013698786)

    left  = NaN
    right = 0.43633200013698786
    

    thread 'proj::test::test_inverse_projection' panicked at 'assert_relative_eq!(t.x(), 0.43633200013698786)

    left  = NaN
    right = 0.43633200013698786
    

    ', src/proj.rs:1069:9 stack backtrace: 0: rust_begin_unwind at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5 1: std::panicking::begin_panic_fmt at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:460:5 2: proj::proj::test::test_inverse_projection at ./src/proj.rs:1069:9 3: proj::proj::test::test_inverse_projection::{{closure}} at ./src/proj.rs:1059:5 4: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 5: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

    assert_relative_eq!(t.x(), 0.0023755864830313977)

    left  = NaN
    right = 0.0023755864830313977
    

    thread 'proj::test::test_london_inverse' panicked at 'assert_relative_eq!(t.x(), 0.0023755864830313977)

    left  = NaN
    right = 0.0023755864830313977
    

    ', src/proj.rs:1086:9 stack backtrace: 0: rust_begin_unwind at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5 1: std::panicking::begin_panic_fmt at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:460:5 2: proj::proj::test::test_london_inverse at ./src/proj.rs:1086:9 3: proj::proj::test::test_london_inverse::{{closure}} at ./src/proj.rs:1074:5 4: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 5: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

    assert_relative_eq!(t.x(), 500119.7035366755, epsilon = 1e-5)

    left  = NaN
    right = 500119.7035366755
    

    thread 'proj::test::test_projection' panicked at 'assert_relative_eq!(t.x(), 500119.7035366755, epsilon = 1e-5)

    left  = NaN
    right = 500119.7035366755
    

    ', src/proj.rs:1054:9 stack backtrace: 0: rust_begin_unwind at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5 1: std::panicking::begin_panic_fmt at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:460:5 2: proj::proj::test::test_projection at ./src/proj.rs:1054:9 3: proj::proj::test::test_projection::{{closure}} at ./src/proj.rs:1044:5 4: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 5: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

    thread 'proj::test::test_searchpath' panicked at 'assertion failed: (left == right) left: "/Users/mkirk/src/georust/proj/target/debug/build/proj-sys-1e3a03028e94a7d6/out/share/proj", right: "/foo"', src/proj.rs:1016:9 stack backtrace: 0: rust_begin_unwind at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5 1: core::panicking::panic_fmt at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:101:14 2: core::panicking::assert_failed_inner 3: core::panicking::assert_failed at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:140:5 4: proj::proj::test::test_searchpath at ./src/proj.rs:1016:9 5: proj::proj::test::test_searchpath::{{closure}} at ./src/proj.rs:1010:5 6: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 7: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

    opened by michaelkirk 8
  • `Send` and `Sync`

    `Send` and `Sync`

    What is the status about Send and Sync? There is no explicit unimpl note, but due to the raw-pointers, it is also not auto-impled on Proj. Is it safe to move the Proj instance between threads and have shared calls to .project?

    If so, what about providing the impl:

    unsafe impl Sync for Proj {}
    unsafe impl Send for Proj {}
    

    If not, what about clarifying it in the docs / README.

    Background: I would like to load and parse the proj-definition once and call the projection from different places in the application.

    opened by kellerkindt 4
  • include offline proj-data

    include offline proj-data

    In https://github.com/georust/proj/pull/124, we discovered that macos was giving slightly different results when using libproj from homebrew.

    My deduction is that this is because, as of https://github.com/Homebrew/homebrew-core/commit/b3e7a635b35e77ece5e194a9520f061fd4afcaea, libproj from homebrew includes proj-data.

    I'm not 100%, but I believe these are the "grids" used for more accurate projections - identical to what you'd get when enabling the network feature. (Is that right?).

    Is it worth including a way (a feature?) for users to install the whole file up front?

    Or alternatively, maybe just some documentation explaining that, if they want to use the more accurate grids without the network feature, that they should use an external proj with those grids preinstalled — e.g. on mac: brew install proj, and presumably theres an apt package or option on linux.

    opened by michaelkirk 3
  • Can't build crate as wasm target

    Can't build crate as wasm target

    cargo build --target wasm32-unknown-unknown
    
    error: failed to run custom build command for `proj-sys v0.22.0 (/Users/coreyf/dev/georust/proj/proj-sys)`
    
    Caused by:
      process didn't exit successfully: `/Users/coreyf/dev/georust/proj/target/debug/build/proj-sys-141d6ea7039d6b8c/build-script-build` (exit status: 101)
      --- stdout
      cargo:rerun-if-env-changed=PROJ_NO_PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_wasm32-unknown-unknown
      cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_wasm32_unknown_unknown
      cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
      cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
      cargo:rerun-if-env-changed=PKG_CONFIG_wasm32-unknown-unknown
      cargo:rerun-if-env-changed=PKG_CONFIG_wasm32_unknown_unknown
      cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_wasm32-unknown-unknown
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_wasm32_unknown_unknown
      cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
      CMAKE_TOOLCHAIN_FILE_wasm32-unknown-unknown = None
      CMAKE_TOOLCHAIN_FILE_wasm32_unknown_unknown = None
      TARGET_CMAKE_TOOLCHAIN_FILE = None
      CMAKE_TOOLCHAIN_FILE = None
      CMAKE_GENERATOR_wasm32-unknown-unknown = None
      CMAKE_GENERATOR_wasm32_unknown_unknown = None
      TARGET_CMAKE_GENERATOR = None
      CMAKE_GENERATOR = None
      CMAKE_PREFIX_PATH_wasm32-unknown-unknown = None
      CMAKE_PREFIX_PATH_wasm32_unknown_unknown = None
      TARGET_CMAKE_PREFIX_PATH = None
      CMAKE_PREFIX_PATH = None
      CMAKE_wasm32-unknown-unknown = None
      CMAKE_wasm32_unknown_unknown = None
      TARGET_CMAKE = None
      CMAKE = None
      running: "cmake" "/Users/coreyf/dev/georust/proj/proj-sys/PROJSRC/proj/proj-8.1.0" "-DBUILD_SHARED_LIBS=OFF" "-DBUILD_TESTING=OFF" "-DBUILD_CCT=OFF" "-DBUILD_CS2CS=OFF" "-DBUILD_GEOD=OFF" "-DBUILD_GIE=OFF" "-DBUILD_PROJ=OFF" "-DBUILD_PROJINFO=OFF" "-DBUILD_PROJSYNC=OFF" "-DENABLE_CURL=OFF" "-DENABLE_TIFF=OFF" "-DCMAKE_INSTALL_PREFIX=/Users/coreyf/dev/georust/proj/target/wasm32-unknown-unknown/debug/build/proj-sys-53bbbe1c8a420d33/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown" "-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown" "-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown" "-DCMAKE_ASM_COMPILER=/opt/homebrew/opt/llvm/bin/clang" "-DCMAKE_BUILD_TYPE=Debug"
      -- The C compiler identification is Clang 13.0.0
      -- The CXX compiler identification is Clang 13.0.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - failed
      -- Check for working C compiler: /opt/homebrew/opt/llvm/bin/clang
      -- Check for working C compiler: /opt/homebrew/opt/llvm/bin/clang - broken
      -- Configuring incomplete, errors occurred!
      See also "/Users/coreyf/dev/georust/proj/target/wasm32-unknown-unknown/debug/build/proj-sys-53bbbe1c8a420d33/out/build/CMakeFiles/CMakeOutput.log".
      See also "/Users/coreyf/dev/georust/proj/target/wasm32-unknown-unknown/debug/build/proj-sys-53bbbe1c8a420d33/out/build/CMakeFiles/CMakeError.log".
    
      --- stderr
      pkg-config unable to find existing libproj installation: pkg-config has not been configured to support cross-compilation.
    
      Install a sysroot for the target platform and configure it via
      PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a
      cross-compiling wrapper for pkg-config and set it via
      PKG_CONFIG environment variable.
      building libproj from source
      disabling tiff support
      CMake Error at /opt/homebrew/Cellar/cmake/3.22.2/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
        The C compiler
    
          "/opt/homebrew/opt/llvm/bin/clang"
    
        is not able to compile a simple test program.
    
        It fails with the following output:
    
          Change Dir: /Users/coreyf/dev/georust/proj/target/wasm32-unknown-unknown/debug/build/proj-sys-53bbbe1c8a420d33/out/build/CMakeFiles/CMakeTmp
          
          Run Build Command(s):/usr/bin/make -f Makefile cmTC_87c4b/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_87c4b.dir/build.make CMakeFiles/cmTC_87c4b.dir/build
          Building C object CMakeFiles/cmTC_87c4b.dir/testCCompiler.c.o
          /opt/homebrew/opt/llvm/bin/clang   -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -MD -MT CMakeFiles/cmTC_87c4b.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_87c4b.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_87c4b.dir/testCCompiler.c.o -c /Users/coreyf/dev/georust/proj/target/wasm32-unknown-unknown/debug/build/proj-sys-53bbbe1c8a420d33/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
          clang-13: warning: argument unused during compilation: '-arch arm64' [-Wunused-command-line-argument]
          Linking C executable cmTC_87c4b
          /opt/homebrew/Cellar/cmake/3.22.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_87c4b.dir/link.txt --verbose=1
          /opt/homebrew/opt/llvm/bin/clang  -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm/lib  CMakeFiles/cmTC_87c4b.dir/testCCompiler.c.o -o cmTC_87c4b 
          clang-13: warning: argument unused during compilation: '-arch arm64' [-Wunused-command-line-argument]
          wasm-ld: error: unknown argument: -search_paths_first
          wasm-ld: error: unknown argument: -headerpad_max_install_names
          wasm-ld: error: cannot open crt1.o: No such file or directory
          wasm-ld: error: unable to find library -lc
          wasm-ld: error: cannot open /opt/homebrew/Cellar/llvm/13.0.0_2/lib/clang/13.0.0/lib/libclang_rt.builtins-wasm32.a: No such file or directory
          clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
          make[1]: *** [cmTC_87c4b] Error 1
          make: *** [cmTC_87c4b/fast] Error 2
          
          
    
        
    
        CMake will not be able to correctly generate this project.
      Call Stack (most recent call first):
        CMakeLists.txt:14 (project)
    
    
      thread 'main' panicked at '
      command did not execute successfully, got: exit status: 1
    
      build script failed, must exit now', /Users/coreyf/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    opened by frewsxcv 12
  • Add `Default` trait constraint to CoordinateType

    Add `Default` trait constraint to CoordinateType

    This is an alternative, simpler take on https://github.com/georust/proj/pull/110

    Adding default constraint allows https://github.com/georust/geo/pull/751

    breaking-change 
    opened by nyurik 1
Owner
GeoRust
A collection of geospatial tools and libraries written in Rust
GeoRust
Just a repo for BJTU OS Proj.

This is public repo for OS course projects on BJTU, written by ipLee. I decide to public it and am not afraid of been copied is just because it is wri

null 4 Dec 5, 2022
Trait aliases on stable Rust

trait-set: trait aliases on stable Rust Status: Project info: Support for trait aliases on stable Rust. Description This crate provide support for tra

Igor Aleksanov 39 Oct 12, 2022
Rust bindings for GDAL

gdal [] GDAL bindings for Rust. So far, you can: open a raster dataset for reading/writing get size and number of bands get/set projection and geo-tra

GeoRust 211 Jan 4, 2023
Rust bindings for GEOS

geos Rust bindings for GEOS C API. The supported geos version is >= 3.5 Disclaimer GEOS can be a tad strict on the validity on the input geometry and

GeoRust 75 Dec 11, 2022
Rust bindings for GDAL

gdal [] GDAL bindings for Rust. So far, you can: open a raster dataset for reading/writing get size and number of bands get/set projection and geo-tra

GeoRust 208 Dec 27, 2022
High-level netCDF bindings for Rust

netcdf Medium-level netCDF bindings for Rust, allowing easy reading and writing of array-like structures to a file. netCDF can read and write hdf5 fil

GeoRust 54 Dec 18, 2022
Rust crate for performing coordinate transforms

Synopsis A Rust crate use for performing coordinate transformations. The crate relies on nalgebra vectors to perform the coordinate transformations. C

Dave 25 Aug 20, 2022
An fast, offline reverse geocoder (>1,000 HTTP requests per second) in Rust.

Rust Reverse Geocoder A fast reverse geocoder in Rust. Inspired by Python reverse-geocoder. Links Crate 2.0.0 Docs 1.0.1 Docs Description rrgeo takes

Grant Miner 91 Dec 29, 2022
Geospatial primitives and algorithms for Rust

geo Geospatial Primitives, Algorithms, and Utilities The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and pro

GeoRust 989 Dec 29, 2022
Geohash for Rust

Rust-Geohash Rust-Geohash is a Rust library for Geohash algorithm. Ported from node-geohash module. Documentation Docs Check the API doc at docs.rs Li

GeoRust 74 Sep 8, 2022
Rust read/write support for well-known text (WKT)

wkt Rust read/write support for well-known text (WKT). License Licensed under either of Apache License, Version 2.0 (LICENSE-APACHE or http://www.apac

GeoRust 40 Dec 11, 2022
Google Encoded Polyline encoding & decoding in Rust.

polyline Google Encoded Polyline encoding & decoding in Rust. A Note on Coordinate Order This crate uses Coordinate and LineString types from the geo-

GeoRust 14 Dec 11, 2022
Geocoding library for Rust.

geocoding Rust utilities to enrich addresses, cities, countries, and landmarks with geographic coordinates through third-party geocoding web services.

GeoRust 55 Dec 12, 2022
Rust read/write support for GPS Exchange Format (GPX)

gpx gpx is a library for reading and writing GPX (GPS Exchange Format) files. It uses the primitives provided by geo-types to allow for storage of GPS

GeoRust 63 Dec 5, 2022
Geospatial primitives and algorithms for Rust

geo Geospatial Primitives, Algorithms, and Utilities The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and pro

GeoRust 990 Jan 1, 2023
Spatial Data Structures for Rust

spade Documentation Using spade Examples Project state Performance License Spade (SPAtial DatastructurEs, obviously!) implements a few nifty data stru

Stefan Altmayer 195 Dec 21, 2022
Rust implementation of the Martinez-Rueda Polygon Clipping Algorithm

Boolean operations on geo shapes This is an implementation of the Martinez-Rueda Polygon Clipping Algorithm in rust to integrate smoothly into the alr

21re 70 Nov 28, 2022
Fast 2D Delaunay triangulation in Rust. A port of Delaunator.

delaunator-rs A very fast static 2D Delaunay triangulation library for Rust. A port of Delaunator. Documentation Example use delaunator::{Point, trian

Vladimir Agafonkin 123 Dec 20, 2022
port of MapBox's earcut triangulation code to Rust language

Earcutr This is a port of the MapBox company's Earcut computer code, which triangulates polygons. Please see https://github.com/mapbox/earcut for more

don bright 41 Dec 26, 2022