Turf.Helpers
- Package
- purescript-turf
- Repository
- jisantuc/purescript-turf
#Feature Source
data Feature a
A Feature a
represents a GeoJSON feature with geometry of type a
.
Constructors
Feature { geometry :: a, properties :: FeatureProperties }
Instances
(DecodeJson a) => DecodeJson (Feature a)
(EncodeJson a) => EncodeJson (Feature a)
(EncodeJson a) => Show (Feature a)
(Arbitrary a) => Arbitrary (Feature a)
(Eq a) => Eq (Feature a)
#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
LineStringGeom { first :: PointGeom, next :: PointGeom, rest :: Array PointGeom }
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
#MultiLineStringGeom Source
newtype MultiLineStringGeom
A MultiLineStringGeom
is a collection of unrelated LineStringGeoms
Constructors
Instances
#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
#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
PolygonGeom { exteriorRing :: LinearRing, holes :: Array LinearRing }
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
newtype MultiPolygonGeom
A MultiPolygonGeom
represents a collection of PolygonGeoms
.
Constructors
Instances
#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