reproject v0.1.7 Reproject

Summary

Functions

Create a projection. This returns {:ok, projection} where projection is an opaque pointer referring to a C struct

Create a projection from a WKT, like the one in the .prj component of a shapefile. This returns the same thing as the create/1 function

Create a projection from a WKT. This returns the same thing as the create/1 function

Get the expanded projection definition

Transform a point from source projection to dest projection

Functions

create(b)

Create a projection. This returns {:ok, projection} where projection is an opaque pointer referring to a C struct

iex> Reproject.create(“+init=epsg:4326”)

create_from_prj(wkt)

Create a projection from a WKT, like the one in the .prj component of a shapefile. This returns the same thing as the create/1 function.

iex> 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]]”)

create_from_wkt(wkt)

Create a projection from a WKT. This returns the same thing as the create/1 function.

iex> 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]]”)

do_create()
do_create_from_wkt(, , )
expand()

Get the expanded projection definition

iex> {:ok, prj} = Reproject.create(“+init=epsg:4326”) iex> Reproject.expand(prj) “ +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0”

init()
transform(src, dst, p)
transform_2d(, , )

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> {:ok, {x, y}} = Reproject.transform(wgs84, crs2180, {21.049804687501, 52.22900390625}) iex> {is_number(x), is_number(y)} {true, true}

transform_3d(, , )