Reproject (reproject v0.1.9)

Link to this section 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

Link to this section Functions

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

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

Link to this function

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> {:ok, _} = 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]]")

Link to this function

create_from_wkt(wkt)

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

iex> {:ok, _} = 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]]")

Link to this function

do_create_from_wkt(_, _, _)

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"

Link to this function

transform(src, dst, p)

Link to this function

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}

Link to this function

transform_3d(_, _, _)