GithubHelp home page GithubHelp logo

rjmac / reproject Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rozap/reproject

0.0 2.0 0.0 24 KB

elixir nif for proj4, inspiration from greenelephantlabs/proj4erl

License: Apache License 2.0

Makefile 5.76% Elixir 47.20% C 47.04%

reproject's Introduction

reproject

Reproject a point. This is just a nif that calls into proj4 and gdal

Setup

You need proj4 and gdal installed on your system. Install it with

sudo apt-get install libproj-dev libgdal1-dev

then

make

Then mix test should pass.

Usage

Initialize a projection from a proj4 string

iex> {:ok, prj} = Reproject.create("+init=epsg:4326")

Initialize a projection from a WKT string

{:ok, prj} = Reproject.create_from_wkt("""
  GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433],AUTHORITY["EPSG",4326]]
""")

Transform a point from source projection to dest projection

iex> {:ok, wgs84} = Reproject.create('+init=epsg:4326')
iex> {:ok, crs2180} = Reproject.create('+init=epsg:2180')
iex> Reproject.transform(wgs84, crs2180, {21.049804687501, 52.22900390625})
{:ok, {639951.5695094677, 486751.7840663176}}

Get the expanded projection definition

iex> Reproject.get_def(prj)
" +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"

reproject's People

Contributors

rozap avatar

Watchers

 avatar James Cloos avatar

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.