Module

Turf.Helpers

Package
purescript-turf
Repository
jisantuc/purescript-turf

#Coord Source

type Coord = Tuple Number Number

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

#Feature Source

data Feature a

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

Constructors

Instances

#FeatureProperties Source

type FeatureProperties = Object Json

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

#featureGeometry Source

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 Source

newtype LineStringGeom

A LineStringGeom is at least two points forming a linestring.

Constructors

Instances

#LineStringFeature Source

type LineStringFeature = Feature LineStringGeom

A LineStringFeature is a Feature with geometry of type LineStringGeom

#lineString Source

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

Construct a LineStringFeature using the @turf/helpers lineString method

#MultiLineStringFeature Source

type MultiLineStringFeature = Feature MultiLineStringGeom

A MultiLineStringFeature is a Feature with geometry of type MultiLineStringGeom

#multiLineString Source

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

Construct a MultiLineStringFeature using the @turf/helpers multiLineString method

#PointGeom Source

newtype PointGeom

A PointGeom is nothing more than a newtype over Coords

Constructors

Instances

#PointFeature Source

type PointFeature = Feature PointGeom

A PointFeature is a Feature with geometry of type PointGeom

#point Source

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

Construct a PointFeature using the @turf/helpers point method

#MultiPointGeom Source

newtype MultiPointGeom

A MultiPointGeom represents a collection of un-connected PointGeoms

Constructors

Instances

#MultiPointFeature Source

type MultiPointFeature = Feature MultiPointGeom

A MultiPointFeature is a Feature with geometry of type MultiPointGeom

#multiPoint Source

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

Construct a MultiPointFeature using the @turf/helpers multiPoint method

#LinearRing Source

newtype LinearRing

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

Instances

#mkLinearRing Source

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 Source

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 Source

type PolygonFeature = Feature PolygonGeom

A PolygonFeature is a Feature with geometry of type PolygonGeom

#polygon Source

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

Construct a PolygonFeature using the @turf/helpers polygon method

#MultiPolygonGeom Source

#MultiPolygonFeature Source

type MultiPolygonFeature = Feature MultiPolygonGeom

A MultiPolygonFeature is a Feature with geometry of type MultiPolygonGeom

#multiPolygon Source

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

Construct a MultiPolygonFeature using the @turf/helpers multiPolygon method

Modules
Turf.Helpers