Giter VIP home page Giter VIP logo

coord_transforms's Introduction

Synopsis

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

Build Status


Code Example

let ellipsoid = geo_ellipsoid::geo_ellipsoid::new(geo_ellipsoid::WGS84_SEMI_MAJOR_AXIS_METERS, 
                                                    geo_ellipsoid::WGS84_FLATTENING);
let lla_vec: Vector3<f64> = Vector3::new(3.0, 4.0, 5.0);
let ecef_vec = lla2ecef(&lla_vec, &ellipsoid);
assert_approx_eq!(ecef_vec.x, 4127585.379918784);
assert_approx_eq!(ecef_vec.y, 4779006.1975849345);
assert_approx_eq!(ecef_vec.z, 894117.5572814466);

Features

  • Simple, one line function calls to convert from one coordinate system to another
  • Common geodetic models provided for geodetic coordinate transformations
  • Uses nalgebra (widely used linear algebra crate)

Suggestions for use

  • Use Rayon! Rayon allows for easy parallelization - which coordinate transformations are an ideal candidate for. Take a look at examples/benchmarking for an example.

Roadmap / Ideas

  • Asserts/Option return for invalid input data

Examples

There are very early work in progress examples being built. These contain basic examples, benchmarking, and other types of examples to help aid in use of the crate. To run an example from the /examples directory:

cargo run --release --example <FILE_NAME_HERE>

License

Copyright (c) 2017 David Kramer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

coord_transforms's People

Contributors

davekram avatar fintelia avatar hdhoang 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

Watchers

 avatar  avatar  avatar  avatar

coord_transforms's Issues

Generic over f64/f32?

Hi there,

Thanks for making this crate! Would you be open to supporting f32's as well as just f64?

ie: https://docs.rs/coord_transforms/1.3.0/coord_transforms/d2/fn.cartesian2polar.html is hardcoded for f64.

Right now I'm doing a bunch of unnecessary casts because my engine uses f32's atm. I'm still learning rust, but if your knowledgeable about a good method for doing so (maybe something like rust's Into trait?) I would be happy to put together a PR, if your open to merging/discussing it.

Thanks!

UTM to LL subtract overflow

this line in geo.rs let lambda0 = (((z - 1) * 6 - 180 + 3) as f64).to_radians(); fails for all UTM zones < 31

it should be let lambda0 = (((z as i32 - 1) * 6 - 180 + 3) as f64).to_radians(); or zone could be i32

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.