Module

Turf.Helpers

#Coord

type Coord = Tuple Number Number

Coords are an alias for pairs of numbers, more or less matching the Position type alias in turf.

#Feature

data Feature a

A Feature a represents a GeoJSON feature with geometry of type a.

Constructors

Instances

#FeatureProperties

type FeatureProperties = Object Json

FeatureProperties represent the JSON object that GeoJSON features have in their properties field.

#featureGeometry

featureGeometry :: forall a. Feature a -> a

Since turf returns features from all of its helper methods, it's convenient to have a short-hand for getting the geometry back out.

#LineStringGeom

newtype LineStringGeom

A LineStringGeom is at least two points forming a linestring.

Constructors

Instances

#LineStringFeature

type LineStringFeature = Feature LineStringGeom

A LineStringFeature is a Feature with geometry of type LineStringGeom

#lineString

lineString :: LineStringGeom -> FeatureProperties -> Either JsonDecodeError LineStringFeature

Construct a LineStringFeature using the @turf/helpers lineString method

#MultiLineStringFeature

type MultiLineStringFeature = Feature MultiLineStringGeom

A MultiLineStringFeature is a Feature with geometry of type MultiLineStringGeom

#multiLineString

multiLineString :: MultiLineStringGeom -> FeatureProperties -> Either JsonDecodeError MultiLineStringFeature

Construct a MultiLineStringFeature using the @turf/helpers multiLineString method

#PointGeom

newtype PointGeom

A PointGeom is nothing more than a newtype over Coords

Constructors

Instances

#PointFeature

type PointFeature = Feature PointGeom

A PointFeature is a Feature with geometry of type PointGeom

#point

point :: PointGeom -> FeatureProperties -> Either JsonDecodeError PointFeature

Construct a PointFeature using the @turf/helpers point method

#MultiPointGeom

newtype MultiPointGeom

A MultiPointGeom represents a collection of un-connected PointGeoms

Constructors

Instances

#MultiPointFeature

type MultiPointFeature = Feature MultiPointGeom

A MultiPointFeature is a Feature with geometry of type MultiPointGeom

#multiPoint

multiPoint :: MultiPointGeom -> FeatureProperties -> Either JsonDecodeError MultiPointFeature

Construct a MultiPointFeature using the @turf/helpers multiPoint method

#LinearRing

newtype LinearRing

A LinearRing is a collection of at least four points where the first and last points are the same.

Instances

#mkLinearRing

mkLinearRing :: PointGeom -> PointGeom -> PointGeom -> Array PointGeom -> LinearRing

Construct a linear ring from the first three points and the remaining points. This method ensures that if you've failed to match the first and last points, a correct last point will be appended for you.

#PolygonGeom

newtype PolygonGeom

A PolygonGeom represents an exterior with possibly zero holes. Note that nothing forbids you from making holes outside the polygon. @turf/helpers polygon method also doesn't get mad about this, so while it doesn't really make sense, it's technically allowed.

Constructors

Instances

#PolygonFeature

type PolygonFeature = Feature PolygonGeom

A PolygonFeature is a Feature with geometry of type PolygonGeom

#polygon

polygon :: PolygonGeom -> FeatureProperties -> Either JsonDecodeError PolygonFeature

Construct a PolygonFeature using the @turf/helpers polygon method

#MultiPolygonGeom

#MultiPolygonFeature

type MultiPolygonFeature = Feature MultiPolygonGeom

A MultiPolygonFeature is a Feature with geometry of type MultiPolygonGeom

#multiPolygon

multiPolygon :: MultiPolygonGeom -> FeatureProperties -> Either JsonDecodeError MultiPolygonFeature

Construct a MultiPolygonFeature using the @turf/helpers multiPolygon method

Modules