Code Monkey home page Code Monkey logo

proj's Introduction

GitHub Workflow Status

PROJ

Coordinate transformation via bindings to the PROJ v9.4 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 v9.4.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 9.2.x to be present on your system. While it may be backwards-compatible with older PROJ 6 versions, this is neither tested nor supported. If a suitable library can't be found, proj will attempt to build libproj from source.

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 MyPointOfInterest {
    lat: f64,
    lon: f64,
}

impl Coord<f64> for MyPointOfInterest {
    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 = MyPointOfInterest { 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);

You can also transform entire geometries from geo-types by using the Transform trait.

use proj::{Proj, Transform};
use geo_types::{Coordinate, line_string};

let line = line_string![
    (x: -116.590457069172_f64, y: 32.55730630167689),
    (x: -116.590411068973, y: 32.55714830169309),
];
let proj = Proj::new_known_crs("EPSG:4326", "EPSG:6366", None).unwrap();

// create a new line with a different projection
let new_line = line.transformed(&proj).unwrap();

assert_eq!(new_line[0], Coordinate { x: 538447.8454476658, y: 3602285.563945497, });
assert_eq!(new_line[1], Coordinate { x: 538452.2313532799, y: 3602268.065714932, });

// or transform the original in-place
let mut line = line;
line.transform(&proj).unwrap();

assert_eq!(line[0], Coordinate { x: 538447.8454476658, y: 3602285.563945497, });
assert_eq!(line[1], Coordinate { x: 538452.2313532799, y: 3602268.065714932, });

License: MIT/Apache-2.0

proj's People

Contributors

1-byte avatar amorken avatar bors[bot] avatar categulario avatar eminence avatar frewsxcv avatar geogcrs25832 avatar kylebarron avatar lnicola avatar michaelkirk avatar mkovaxx avatar nyurik avatar tomfryersmidsummer avatar urschrei avatar weiznich avatar woshilapin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proj's Issues

Should proj_cleanup be run if there are active contexts?

This function frees global resources (grids, cache of +init files). It should be called typically before process termination, and after having freed PJ and PJ_CONTEXT objects.

This crate runs proj_cleanup on every Drop for Proj and ProjBuilder. So if you have two Proj instances in your application and one gets dropped, we'll run proj_cleanup even though the other Proj is still alive. My interpretation of the documentation for proj_cleanup (above) is that we should only run proj_cleanup after all other PROJ objects and contexts have been freed.

If this is the case, we'd need to think through how to accomplish this, as Rust has no way to automatically run code when a process ends. We'd have to do some sort of reference counting and only run proj_cleanup if we know there are now Proj instances alive

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.

Static compilation with musl not succeeded

Question: Is it possible to compile the application statically with MUSL or other tools/methods? The application needs so many dependencies that it is not esay to deploy.

I have attemped:

  1. Compiled exmaple successful;
use proj::Proj;

extern crate geo_types;
use geo_types::Point;

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();
    println!("{}", result.x() as f64);
    println!("{}", result.y() as f64);
    //assert_approx_eq::assert_approx_eq!(result.x() as f64, 1450880.2910605003);
    //assert_approx_eq::assert_approx_eq!(result.y() as f64, 1141263.0111604529);
}
[package]
name = "testproj"
version = "0.1.0"
authors = ["freedeaths"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
proj = { version = "0.20.5", features = ["bundled_proj"] }
assert_approx_eq = "1.1"
geo-types = "0.6"

I could run this application in PC where I compiled in. BUT I can't send this binary to other pc which says "cannot find proj.db and balabala" after run this binary.

  1. Compiled this project as proj.rlib or proj.a successful(wrapped with libproj.a generated);

  2. Fail to compiled the application 1 with musl on Ubuntu Server 18.04 and got ERROR like:

undefined reference to `__dso_handle

undefined reference to `__cpu_indicator_init'

undefined reference to `__cpu_model'

sudo apt install musl-tools
rustup target add x86_64-unknown-linux-musl
CC=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl
  1. Fail to compiled the application 1 with generated proj.a/proj.rlib in step 2, and got ERROR like
Package proj was not found in the pkg-config search path.
  Perhaps you should add the directory containing `proj.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'proj' found
  Package proj was not found in the pkg-config search path.
  Perhaps you should add the directory containing `proj.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'proj' found

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

Proj isnt compiling in docker container, but does locally

I'm not sure if this is a Proj issue specifically, this might be an ffi issue, but I'm hoping you'll have a better hunch than I.

I have a project that compiles locally just fine, and runs fine on an ubuntu based image in CI.
When I try to build a local docker image, I get the following error:

#16 236.3 error[E0308]: mismatched types
#16 236.3   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/proj-0.27.0/src/network.rs:53:48
#16 236.3    |
#16 236.3 53 |             let _ = unsafe { CString::from_raw(header.as_ptr() as *mut i8) };
#16 236.3    |                              ----------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*mut u8`, found `*mut i8`
#16 236.3    |                              |
#16 236.3    |                              arguments to this function are incorrect
#16 236.3    |
#16 236.3    = note: expected raw pointer `*mut u8`
#16 236.3               found raw pointer `*mut i8`
#16 236.3 note: associated function defined here
#16 236.3   --> /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/ffi/c_str.rs:397:19
#16 236.3
#16 236.3 For more information about this error, try `rustc --explain E0308`.
#16 236.3 error: could not compile `proj` (lib) due to previous error

It seems proj can't compile due to a type mismatch with CString in the container.
I'm guessing this an API being called in proj-sys? But don't really know where to start debugging this. 😅

Any advice would be highly appreciated!

Intermittent terrifying CI failures

We've seen these off and on for a while. I wanted to start collecting data on them to see if we can track down what's going on.

this time anyway it was a macos failure. When we do fail in this way, is it always a mac?

Note this is not the same issue as #52, which is very reproducible if you're on an arm64 mac.

running 9 tests
test src/lib.rs - (line 31) ... ok
test src/lib.rs - (line 56) ... ok
test src/lib.rs - (line 162) ... ok
test src/lib.rs - (line 79) ... ok
test src/proj.rs - proj::Proj::convert (line 641) ... ok
test src/proj.rs - proj::Proj::convert_array (line 697) ... ok
test src/proj.rs - proj::Proj::new_known_crs (line 469) ... ok
test src/proj.rs - proj::Proj::project_array (line 730) ... FAILED
test src/proj.rs - proj::ProjBuilder::proj_known_crs (line 391) ... ok

failures:
---- src/proj.rs - proj::Proj::project_array (line 730) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'assert_relative_eq!(v[0].x(), 500119.70, epsilon = 1e-2)

    left  = -2211720633.1788964
    right = 500119.7

Here's a link to the most recent intermittent failure:
https://github.com/georust/proj/runs/1653291398?check_suite_focus=true

This is a terribly confusing example to link to because there are other legitimate failures for that job as I worked through the fallout of integrating approx. This issue is just about the "proj-sys macos" build showing the intermittent failure above, the maybe it sometimes affects other platforms too? unclear...

`.convert` does not need to bind input type with output type

the .convert() function needs an input type with a bound constraint on Coord<T> and produce an output type with a bound constraint on Coord<T>. However, the way it is defined today forces the 2 concrete types to be the same.

pub fn convert<C, F>(&self, point: C) -> Result<C, ProjError>
where
    C: Coord<F>,
    F: CoordinateType;

But it doesn't have to be like this. We could define the function as follows.

pub fn convert<C, D, F>(&self, point: C) -> Result<D, ProjError>
where
    C: Coord<F>,
    D: Coord<F>,
    F: CoordinateType;

Note however that this would be a breaking change for the crate proj as now, the expected type should be made explicit and type inference might not always be able to save you.

Expose PjInfo struct

I'd like to have access to all those values, and seems simple enough just to expose it publicly

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

Problem when using bundled_proj feature

Hello!
While trying to use bundled_proj feature, when doing cargo build I get:

error: failed to run custom build command for `proj-sys v0.23.2`                                                                                                                                                                             
                                                                                                                                                                                                                                             
Caused by:                                                                                                                                                                                                                                   
  process didn't exit successfully: `/sciclone/pscr/jrcalzada/thesis/src/schismrs/target/debug/build/proj-sys-3bc51e82b69c5e10/build-script-build` (exit status: 101)                                                                        
  --- stdout                                                                                                                                                                                                                                 
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None                                                                                                                                                                                       
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None                                                                                                                                                                                       
  HOST_CMAKE_TOOLCHAIN_FILE = None                                                                                                                                                                                                           
  CMAKE_TOOLCHAIN_FILE = None                                                                                                                                                                                                                
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None                                                                                                                                                                                            
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None                                                                                                                                                                                            
  HOST_CMAKE_GENERATOR = None                                                                                                                                                                                                                
  CMAKE_GENERATOR = None                                                                                                                                                                                                                     
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None                                                                                                                                                                                          
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None                                                                                                                                                                                          
  HOST_CMAKE_PREFIX_PATH = None                                                                                                                                                                                                              
  CMAKE_PREFIX_PATH = Some("/usr/local/rome/linux-centos7-x86_64_v3/gcc-4.8.5/cmake-3.21.4-kclb/")
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = Some("/usr/local/rome/linux-centos7-x86_64_v3/gcc-4.8.5/cmake-3.21.4-kclb")
  running: cd "/sciclone/pscr/jrcalzada/thesis/src/schismrs/target/debug/build/proj-sys-406cac86e4013fc5/out/build" && CMAKE_PREFIX_PATH="/usr/local/rome/linux-centos7-x86_64_v3/gcc-4.8.5/cmake-3.21.4-kclb/" "/usr/local/rome/linux-centos7-x86_64_v3/gcc-4.8.5/cmake-3.21.4-kclb" "/sciclone/home/jrcalzada/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proj-sys-0.23.2/PROJSRC/proj/proj-9.2.1" "-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" "-BUILD_PROJSYNC=OFF" "-DENABLE_CURL=OFF" "-DENABLE_TIFF=OFF" "-DCMAKE_INSTALL_PREFIX=/sciclone/pscr/jrcalzada/thesis/src/schismrs/target/debug/build/proj-sys-406cac86e4013fc5/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -I/sciclone/home/jrcalzada/.local/include:-I/sciclone/home/jrcalzada/.gust/include" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -I/sciclone/home/jrcalzada/.local/include:-I/sciclone/home/jrcalzada/.gust/include" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"

  --- stderr
  feature flags specified source build
  building libproj from source
  disabling tiff support
  thread 'main' panicked at /sciclone/home/jrcalzada/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  failed to execute command: Permission denied (os error 13)

From what I see, the strings right after CMAKE_PREFIX_PATH="/usr/local/rome/linux-centos7-x86_64_v3/gcc-4.8.5/cmake-3.21.4-kclb/" are being treated by the shell as execution commands.

Any guidance is well appreciated!

include pre-compiled headers, bindgen only as optional feature

bindgen accounts for the vast majority of the remaining deps for proj. Since they are build_dependencies they don't contribute to the size of the output binary, but it does take time to compile.

It seems like a popular approach is to bake in the prebuilt bindings, but then allow the user a way to manually generate via a feature flag.

e.g. rustsqlite
bundled bindings: https://github.com/rusqlite/rusqlite/tree/master/libsqlite3-sys/bindgen-bindings

zstd

gdal
bundled bindings: https://github.com/georust/gdal/tree/master/gdal-sys/prebuilt-bindings

So achieving this would entail at least:

  1. baking in bindings for the supported versions
  2. including the proper one in build.rs
  3. adding a bindgen feature maintains the current behavior.
  4. ensuring there is tooling/documentation for maintainers to easily add new pre-baked bindings as new proj versions come out.

Would you be interested in merging such a thing?

repo maintenance: tag historical releases, disambiguate proj vs. proj-sys tags

One thing I didn't think through - now that proj and proj-sys share a repo, I think we should adopt a tagging scheme like geo's.

Specifically, instead of tagging '1.2.3' we'll need to be clear which crate the tag applies to. e.g. proj-1.2.3 vs. proj-sys-2.3.4

If this is agreeable, I can go through the chore of adding a new explicit tag for the pre-existing tags.

Even though they're potentially ambiguous, I think it's probably best to leave the old tags as they were, since deleting old tags might surprise people. WDYT?

Clarify "network" feature is required for TIFF support

network: exposes APIs which, when enabled, can fetch grid data from the internet to improve projection accuracy. See enable_network for details.

Should this be edited to clarify that if the "network" feature isn't enabled, TIFF support is disabled?

Or could TIFF support be enabled, even if network isn't?

Discussion: Move Transform trait from geo to proj?

This might be controversial, but #106 got me thinking: If people want to interop proj with geo-types, it's likely that they want something like the Transform trait we just added to geo.

In other words, if they are using proj --features geo-types it seems inevitable that they are going to end up writing some subset of the Transform trait themselves.

What if we instead:

  1. moved the Transform trait to proj
  2. added impl Transform for geo-types::* to proj (behind the geo-types feature)
  3. have geo leverage the impl in proj, so as not to lose that functionality.

One downside is that the current Transform impl, being in geo, leverages the MapCoords feature, so the impls in proj would be more verbose, which isn't ideal, but if we're going to add the ability to transform geo-types to proj (like #106 proposes), it seems like we might as well consolidate around one implementation.

How to build for windows?

Hi, could anyone point me to a minimum working guide for building and running this on windows? I'm not familiar with pkg-config but have built Proj using the instructions on https://proj.org/install.html#build-requirements, note that its installed into c:/OSGeo4W, created pc files (with guessed contents), added that path to PKG_CONFIG_PATH. This got georust/proj to build, but I believe its probably just tricked its way through cmake, as when I try and run a test I get hard exits with code 3221225595 (I believe this is something to do with DLL misconfigured).

I don't know if there is anywhere I can drop the proj.dll into the cargo build directories?

Where (or how) to find built proj.db

Ok, here is the situation I'm facing (similar to #66):

I'm trying to package a project built with proj for deployment. Since my build environment doesn't have a recent version of proj the build process just builds it from source. Everything is fine there when running locally. When I try to run the binary somewhere else I face a proj.db not found. It makes sense, it is not there.

Now, I know that one such database is being built as part of the building process of proj-sys. I even found it in target/debug/build/proj-sys-3de39dabca2db38d/out/share/proj/proj.ini the question now is, how do I find this path? Is it predictable? Is there another way to get the built proj.db?

Thanks folks!

manually specify existing proj installation via env variables

For most people, pkg-config is a great option. But for when it's not, I think conventions exist for manually specifying environment variables.

Something like:

PROJ_SYS_PROJ_INCLUDE_DIR=/path/to/my/proj/include PROJ_SYS_LIBRARY_PATH=/path/to/my/proj/lib cargo build

We don't currently support this, but we should.

New tiff feature flag should be plumbed from proj to proj-sys

The new tiff feature flag added in #143 is only on proj-sys. Based on the docs added it seems like the intent was to add the flag on proj as well, which would then just propagate the flag to proj-sys. Otherwise using it is awkward, as you have to add an explicit dependency on proj-sys.

Tests fail on Apple Silicon

% cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.08s
     Running target/debug/deps/proj-6a37e3d3cad5067a

running 14 tests
test proj::test::test_definition ... ok
test proj::test::test_conversion_error ... FAILED
test proj::test::test_conversion ... FAILED
test proj::test::test_error_recovery ... FAILED
test proj::test::test_inverse_projection ... FAILED
test proj::test::test_london_inverse ... FAILED
test proj::test::test_searchpath ... ok
test proj::test::test_projection ... FAILED
test proj::test::test_area_of_use ... ok
test proj::test::test_array_convert ... ok
test proj::test::test_from_crs ... FAILED
test proj::test::test_input_order ... FAILED
test proj::test::test_set_endpoint ... ok
proj_create: unrecognized format / unknown name
test proj::test::test_init_error ... ok

failures:

---- proj::test::test_conversion_error stdout ----
thread 'proj::test::test_conversion_error' panicked at 'called `Result::unwrap_err()` on an `Ok` value: MyPoint { x: 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021451195286, y: 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000057 }', src/proj.rs:1057:14

---- proj::test::test_conversion stdout ----
thread 'proj::test::test_conversion' panicked at 'assertion failed: f > 0.99999', src/proj.rs:885:9

---- proj::test::test_error_recovery stdout ----
thread 'proj::test::test_error_recovery' panicked at 'assertion failed: nad83_m.convert(MyPoint::new(0.0, 0.0)).is_ok()', src/proj.rs:1077:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- proj::test::test_inverse_projection stdout ----
thread 'proj::test::test_inverse_projection' panicked at 'assertion failed: f > 0.99999', src/proj.rs:885:9

---- proj::test::test_london_inverse stdout ----
thread 'proj::test::test_london_inverse' panicked at 'assertion failed: f > 0.99999', src/proj.rs:885:9

---- proj::test::test_projection stdout ----
thread 'proj::test::test_projection' panicked at 'assertion failed: f > 0.99999', src/proj.rs:885:9

---- proj::test::test_from_crs stdout ----
thread 'proj::test::test_from_crs' panicked at 'assertion failed: f > 0.99999', src/proj.rs:885:9

---- proj::test::test_input_order stdout ----
thread 'proj::test::test_input_order' panicked at 'assertion failed: `(left == right)`
  left: `6693625.67217475`,
 right: `0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005`', src/proj.rs:1110:9


failures:
    proj::test::test_conversion
    proj::test::test_conversion_error
    proj::test::test_error_recovery
    proj::test::test_from_crs
    proj::test::test_input_order
    proj::test::test_inverse_projection
    proj::test::test_london_inverse
    proj::test::test_projection

test result: FAILED. 6 passed; 8 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s

error: test failed, to rerun pass '--lib'

no_mangle warning when compiling with 'network' feature

warning: attribute should be applied to a function or static
  --> src/network.rs:28:1
   |
28 |   #[no_mangle]
   |   ^^^^^^^^^^^^
29 | / struct HandleData {
30 | |     request: reqwest::blocking::RequestBuilder,
31 | |     headers: reqwest::header::HeaderMap,
32 | |     // this raw pointer is returned to libproj but never returned from libproj,
...  |
37 | |     hptr: Option<*const c_char>,
38 | | }
   | |_- not a function or static
   |
   = note: `#[warn(unused_attributes)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

Specify CMAKE release type in proj-sys?

Cmake has four build types:

Choose the type of build, options are: None (default), Debug, Release,
RelWithDebInfo, or MinSizeRel

We should be producing a release build of libproj when building from source, and it's not clear to me whether we currently are. It is able to be set by passing config.define("CMAKE_BUILD_TYPE", "Release"); but I need to figure out whether this actually produces a release artifact.

Bug in conversion from "OGC:CRS84" to "EPSG:3395"

Below there is a test in rust that fails. The proj version used is the latest as of today, proj = "0.27.0"

use proj::Proj;
use approx::relative_eq;

pub fn merc_to_coords(input_point: (f64, f64)) -> (f64, f64) {
    let input_point = (input_point.0 as f64, input_point.1 as f64);
    let from = "EPSG:3395";
    let to = "OGC:CRS84";
    let converter = Proj::new_known_crs(from, to, None).unwrap();
    converter.convert(input_point).unwrap()
}

pub fn coords_to_merc(input_point: (f64, f64)) -> (f64, f64) {
    let from = "OGC:CRS84";
    let to = "EPSG:3395";
    let converter = Proj::new_known_crs(&from, &to, None).unwrap();
    let output_point = converter
        .convert(input_point)
        .expect("convertion from coords to merc failed");
    (output_point.0, output_point.1)
}

#[test]
fn test_geoprojector_bug() {
    let p1_merc = (-26471262.0, 3462994.0);
    let p1_coords = merc_to_coords(p1_merc);
    let p1_merc_reconstructed = coords_to_merc(p1_coords);

    let expected_p1_coords = (122.2046103800736, 29.849799842396617);
    assert!(relative_eq!(p1_coords.0, expected_p1_coords.0, max_relative=1e-6)); // pass
    assert!(relative_eq!(p1_coords.1, expected_p1_coords.1, max_relative=1e-6)); // pass

    // p1_merc_reconstructed is (13603754.685578486, 3462993.9999999995) instead of the initial p1_merc
    assert!(relative_eq!(p1_merc.0, p1_merc_reconstructed.0, max_relative=1e-6)); // fails
    assert!(relative_eq!(p1_merc.1, p1_merc_reconstructed.1, max_relative=1e-6)); // fails
}

Windows builder in CI

I'm not very familiar with windows builds, but we have a steady stream of support requests about it.

I think it could be helpful to have an official build in CI to point people to, and also to have some confidence that it's possible to build this crate on windows at all.

Is anyone out there interested in setting one up?

related: #79, #156, #158

the trait bound `geo_types::point::Point<_>: std::convert::From<geo_types::Point<f64>>` is not satisfied

Hello, I have a problem testing an conversion example.
I begin in rust and I don't fully understand this error.

Here is my main.rs file:

use assert_approx_eq::assert_approx_eq;
extern crate proj;
use proj::Proj;

extern crate geo_types;
use geo_types::Point;

fn main() {
    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(Point::new(4760096.421921f64, 3744293.729449f64))
        .unwrap();
    assert_approx_eq!(result.x(), 1450880.29f64, 1.0e-2);
    assert_approx_eq!(result.y(), 1141263.01f64, 1.0e-2);
}

At cargo build time I have this error:

error[E0277]: the trait bound `geo_types::point::Point<_>: std::convert::From<geo_types::Point<f64>>` is not satisfied
  --> src\main.rs:13:10
   |
13 |         .convert(Point::new(4760096.421921f64, 3744293.729449f64))
   |          ^^^^^^^ the trait `std::convert::From<geo_types::Point<f64>>` is not implemented for `geo_types::point::Point<_>`
   |
   = help: the following implementations were found:
             <geo_types::point::Point<T> as std::convert::From<(T, T)>>
             <geo_types::point::Point<T> as std::convert::From<[T; 2]>>
             <geo_types::point::Point<T> as std::convert::From<geo_types::coordinate::Coordinate<T>>>
   = note: required because of the requirements on the impl of `std::convert::Into<geo_types::point::Point<_>>` for `geo_types::Point<f64>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.

There is a typo in the example page, or I do it bad with type ?

Inconsistent transformations of coords between OSX and ubuntu

I'm transforming geometries received in EPSG::27700 to OGC:1.3:CRS84.

I'm encountering some inconsistencies between my local environment (OSX) and my CI (ubuntu-latest on Github Actions).

Given this geometry:

{ "type": "Point", "coordinates": [492941.3929127551,144592.2391630347] }

Locally on OSX and transform these coords are transformed into:

{ "type": "Point", "coordinates": [-0.6713249654966993, 51.19300053717864] }

But then on CI they are transformed into:

{ "type": "Point", "coordinates": [-0.6713438264761399, 51.193003894930584] }

Any thoughts on why this inconsistency might be happening and how I can avoid it?

I'm happy to compromise on resolution (cm would be ideal, but meter could work if that helps), but mostly I want to understand if this is a rounding or configuration issue.

Cheers

proj-sys errors in build with gcc-13

Hey! It seems 9.1.0 fails to compile with gcc-13, due to errors like these:

  proj/proj-sys/PROJSRC/proj/proj-9.1.0/src/proj_json_streaming_writer.hpp:42:14: error: ‘int64_t’ in namespace ‘std’ does not name a type
     42 | typedef std::int64_t GIntBig;

And more, seems to be fixed by this commit, which made it to 9.1.1. I just tested and it builds fine on 9.2.0 too.

include offline proj-data

In #124, we discovered that macos was giving slightly different results when using libproj from homebrew.

My deduction is that this is because, as of Homebrew/homebrew-core@b3e7a63, 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.

update bundled proj to 9.0.0

Do you mind if I work on updating proj to 8.2?

In particular there are some failing test cases on aarch64 that go away after the update.

Need ability to convert 3D coordinates

Proj::convert assumes 2D coordinates, and passes z: 0.0 into proj_sys (which handles 3D just fine).

This is insufficient for conversions to/from (e.g.) ECEF coordinates, where the z coordinate is critical even for locations on the ground.

Then need to access the private c_proj makes it impossible to define a trait with a minimally-modified convert method which takes a 3D point, passes all three values in/out of proj_sys, and returns a 3D point.

Some provision for 3D coords within this crate would be extremely helpful please :-)

`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.

Puzzled about how to create projection

Hello,

I have make this projection:

echo '19 50' | proj -f '%.8f' +proj=ob_tran +o_proj=longlat +lon_0=19.3 +o_lat_p=37.5 +datum=WGS84 +no_defs

which produces:

-0.00336882     -0.04362623

I can do, in Python:

import pyproj
p = pyproj.Proj("+proj=ob_tran +o_proj=longlat +lon_0=19.3 +o_lat_p=37.5")
p(longitude=19, latitude=50)
>> (-0.003368824387898672, -0.043626234267364894)

However, when I do:

let proj = proj::Proj::new("+proj=ob_tran +o_proj=longlat +lon_0=19.3 +o_lat_p=37.5");
let point = proj.convert((19.0, 50.0));

However, I get:

ob_tran: Invalid latitude

What do I do wrong?

Add the possibility to convert all the types from geo-types

It would be great if we could convert/project all the geo-types directly, internaly usingconvert_array (when the feature is eanbled)

For example something like

impl Proj {
    pub fn convert_line_string<'a, T>(&self, line_string: &'a mut geo_types::LineString<T>) -> Result<&'a mut geo_types::LineString<T>, ProjError>
        where
            T: crate::proj::CoordinateType,
    {
        self.convert_array(&mut line_string.0)?;
        Ok(line_string)
    }

    pub fn convert_polygon<T>(&self, polygon: &geo_types::Polygon<T>) -> Result<geo_types::Polygon<T>, ProjError>
        where
            T: crate::proj::CoordinateType,
    {
        let mut exterior = polygon.exterior().clone();
        let mut interiors = polygon.interiors().clone();
        self.convert_line_string(&mut exterior)?;
        for interior in interiors{
            self.convert_line_string(&mut interior.clone())?;
        }
        Ok(geo_types::Polygon::new(exterior, interiors.to_vec()))
    }
}

Add debug representation for proj::Proj

Using the proj_pj_info function, we can retrieve info about the underlying PJ structure created from proj_create. I used this code to debug #63.

https://proj.org/development/reference/functions.html#c.proj_pj_info

let pj = unsafe { proj_create(ctx, c_definition.as_ptr()) };

unsafe {
    let pj_proj_info = proj_sys::proj_pj_info(pj);
    println!("id: {}", _string(pj_proj_info.id));
    println!("description: {}", _string(pj_proj_info.description));
    println!("definition: {}", _string(pj_proj_info.definition));
    println!("has_inverse: {}", pj_proj_info.has_inverse == 1);
    println!("accuracy: {}", pj_proj_info.accuracy);
}

Linking error when compiling with 'bundled_proj' feature on Apple Silicon

cargo test --features "bundled_proj"
$ cargo test --features "bundled_proj"
   Compiling approx v0.3.2
   Compiling proj v0.20.6 (/Users/coreyf/Desktop/dev/georust/proj)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-arch" "arm64" "-L" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.10ingj40cbe4borj.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.11fn116tw8nkd70w.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.18txdfkpvx0wwx6z.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1bd6updi42gyixo1.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1bkgo0al4a863uug.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1bn3rkwb8iqzabh7.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1d2s1nq0em3eqzly.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1drnthnrqypo39mn.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1fkvtcbqhcqx05r5.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1g50imb6okpovw8f.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1hauolsatc01qin8.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1hxqql8pyer0upe2.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1npteib36zljvnhl.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1ratu9pbg7mn8fnm.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1s53rdwcuibz2ckx.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1tv4jj49i20h52vm.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1u6ubhjcmyn69vq0.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1xc7kekgf1dos00z.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1xv5bfel57dmgcnx.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1y4r9ipsflrb2dso.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.20wzwivz9293caki.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.213gijffzb22ipeg.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.224zh2mag6z4ml45.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2251ie3mswn860jc.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.22e681rj5d8qxgq2.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.24hlksmwbws37sn5.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2adt9mvpvi1gv8ab.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2aq321umn0j05q6d.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2b3wpt9tuagfrls5.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2g30xq86i3s7tul.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2go81aea09n0ueg6.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2hjj1d1lbq2lrp52.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2qjjl69tnydfwf2f.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2r9jxnee6yt4or.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2s3q814iqklata8d.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2yllp33pcn4pehax.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.2zyq6iot82irlftd.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.33ipixuxlsf5yimy.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.38a938m4qf5n55xz.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3c34fmjy4batnb8z.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3cq155oredr77527.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3dnnmibrw96vag3p.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3g8uerxbfzmf7vdk.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3mcrdkz04f873cot.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3r7eebvtuxfnmgsa.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3tc3xzajp2fx899f.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3tg2nl2i6ufhe4mw.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3ucyrq9lx9n0heks.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.3wfsogsf13rrsivo.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.41inetmydes9ty49.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.435pue1l5hwid6c0.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4b5mjlo7s7127tji.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4bht5egcc9kt4uuf.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4co4w6a8kaqb0jdh.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4eusky92tz6e6e4j.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4i3ikg2ex5evt85z.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4jft0iq614upsqyi.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4n356617sy5tj2ze.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4nbw2szeh1fevdo1.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4pdglkzbtxs8ld32.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4v92ot1iqr9hmu7w.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.4yp32bs47b68hr00.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.52ca6015s3d4mrpu.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.546emph797iaevfq.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.54j1x6530irgiv9c.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.56xm94j03y2tkutk.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.57yjhyp3s9ofmjnt.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.58k6awnydbn7gmvs.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.58z2c5zib4xakjh5.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.5ewlbfmpsl1cgq.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.5rt3nbf82bch7ke.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.6ln2b8oe1iuvb42.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.8kegbvbgsc92bge.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.a5dr4rj76gxrrjb.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.b4rfnt3qgnzaquv.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.bvscs4wwtrmjqxk.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.gnnc1d52f3o7c86.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.ht3v3ud5qonx1es.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.omcemq9r8tipv5l.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.q6ekkc4ktogvwp5.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.q7cv36ruevjcgu4.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.rbymtdm8w4sq15t.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.sm4ml1ysgjoqw6n.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.tbwijz1wno1xppb.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.tfse1g2waz0dovq.rcgu.o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.tg5wgyqvnmjoc6.rcgu.o" "-o" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/proj-74201a339a3fe75c.1f57didjga5843ez.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps" "-L" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/build/proj-sys-702b3ff54554385c/out/lib" "-L" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/build/proj-sys-702b3ff54554385c/out/lib64" "-L" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/build/proj-sys-702b3ff54554385c/out/build/lib" "-L" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libtest-c04bf5353f69140c.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libterm-1679b8e962db5e51.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgetopts-53270c793523aa3d.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunicode_width-6e5f163d203931fb.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_std-da8c4278b088de0d.rlib" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/libthiserror-c3211ae51f4578b1.rlib" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/libproj_sys-330c7d9be9e5225c.rlib" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/liblibc-6dc103a5ed6ef582.rlib" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/libapprox-3c1f854685b50684.rlib" "/Users/coreyf/Desktop/dev/georust/proj/target/debug/deps/libnum_traits-e49431397aad97ac.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-66c007ef72d8663e.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-a9451d2661722154.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-762dc53d4ee196bf.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-8574628b478a5c23.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-81d5bba5f99dc60c.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-2ca8284befe9e594.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-b6e7b0a96c79838a.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-a91baa24b7903563.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-be586febb1d2abe5.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-91703e117e420011.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-8293d4970e524cf2.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-59ea5e5ce6eb23cb.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-92186cf5c5d5835d.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-80a2abfc52170c57.rlib" "/Users/coreyf/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-e46c25039c9cecae.rlib" "-lsqlite3" "-ltiff" "-lc++" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: ld: warning: directory not found for option '-L/Users/coreyf/Desktop/dev/georust/proj/target/debug/build/proj-sys-702b3ff54554385c/out/lib64'
          ld: library not found for -ltiff
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error

error: could not compile `proj`

To learn more, run the command again with --verbose.

This seems to be the line it's struggling with:

proj/proj-sys/build.rs

Lines 107 to 110 in 3c33538

println!(
"cargo:rustc-link-search={}",
&out_path.join("lib64").display()
);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.