Liking cljdoc? Tell your friends :D

geo.spatial

Provides common interfaces for working with spatial objects and geodesics. All units are in meters/radians/steradians unless otherwise specified. Provides static spatial contexts for the earth, and some constants like the earth's radii and circumferences, along with points like the poles.

Defines protocols for unified access to Points and Shapes, to allow different geometry libraries to interoperate.

Basic utility functions for unit conversion; e.g. degrees<->radians.

Functions for computing earth radii, surface distances, and surface areas.

Constructors for shapes like bounding-boxes and circles, and utility functions over shapes for their heights, centers, areas, etc. Can also compute relationships between shapes: their intersections, contains, disjoint statuses, etc.

Provides common interfaces for working with spatial objects and geodesics.
All units are in meters/radians/steradians unless otherwise specified.
Provides static spatial contexts for the earth, and some constants like the
earth's radii and circumferences, along with points like the poles.

Defines protocols for unified access to Points and Shapes, to allow different
geometry libraries to interoperate.

Basic utility functions for unit conversion; e.g. degrees<->radians.

Functions for computing earth radii, surface distances, and surface areas.

Constructors for shapes like bounding-boxes and circles, and utility
functions over shapes for their heights, centers, areas, etc. Can also
compute relationships between shapes: their intersections, contains, disjoint
statuses, etc.
raw docstring

areaclj

(area rect)

The area of a rectangle in square meters. Note that spatial4j's term 'area' actually refers to solid angle, not area; we convert by multiplying by the earth's radius at the midpoint of the rectangle.

The area of a rectangle in square meters. Note that spatial4j's term 'area'
actually refers to solid angle, not area; we convert by multiplying by the
earth's radius at the midpoint of the rectangle.
sourceraw docstring

area-in-square-degreesclj

(area-in-square-degrees rect)

The area of a rectangle in square degrees.

The area of a rectangle in square degrees.
sourceraw docstring

bounding-boxclj

(bounding-box shape)

Returns the bounding box of any shape.

Returns the bounding box of any shape.
sourceraw docstring

centerclj

(center shape)

Returns the centroid of a spatial4j shape. Note that .getCenter does bad things for JTS shapes that cross the international dateline, so we use use (center (bounding-box x)) for JTS stuff.

Returns the centroid of a spatial4j shape. Note that .getCenter does bad
things for JTS shapes that cross the international dateline, so we use use
(center (bounding-box x)) for JTS stuff.
sourceraw docstring

circleclj

(circle point meters)

A spatial4j circle around the given point or lat,long, with radius in meters.

A spatial4j circle around the given point or lat,long, with radius in
meters.
sourceraw docstring

crosses-dateline?clj

(crosses-dateline? jts-geom)
source

degrees->radiansclj

(degrees->radians degrees)
source

dist-at-idxclj

(dist-at-idx linestring idx)

Distance between the linestring's point at the given index and the subsequent point.

Distance between the linestring's point at the given index and the subsequent point.
sourceraw docstring

distanceclj

(distance a b)

Distance between two points, in meters

Distance between two points, in meters
sourceraw docstring

distance->radiansclj

(distance->radians meters)
(distance->radians meters radius)

Converts distance, in meters on the surface of the earth, to radians. Assumes earth mean radius.

Converts distance, in meters on the surface of the earth, to radians.
Assumes earth mean radius.
sourceraw docstring

distance-at-point->radiansclj

(distance-at-point->radians meters point)

Converts a distance near a point on the earth into radians; using a more accurate model of the radius of the earth near that point.

Converts a distance near a point on the earth into radians; using a more
accurate model of the radius of the earth near that point.
sourceraw docstring

distance-in-degreesclj

(distance-in-degrees a b)

Distance between two points, in degrees.

Distance between two points, in degrees.
sourceraw docstring

earthclj

The SpatialContext of the earth, as according to spatial4j.

The SpatialContext of the earth, as according to spatial4j.
sourceraw docstring

earth-equatorial-circumferenceclj

Earth's equatorial circumference, in meters

Earth's equatorial circumference, in meters
sourceraw docstring

earth-equatorial-radiusclj

Earth's radius at the equator, in meters.

Earth's radius at the equator, in meters.
sourceraw docstring

earth-equatorial-radius-squaredclj

source

earth-mean-circumferenceclj

Earth's mean circumference, in meters.

Earth's mean circumference, in meters.
sourceraw docstring

earth-mean-radiusclj

Earth's mean radius, in meters.

Earth's mean radius, in meters.
sourceraw docstring

earth-meridional-circumferenceclj

Earth's circumference around a meridian, in meters.

Earth's circumference around a meridian, in meters.
sourceraw docstring

earth-polar-radiusclj

Earth's radius at the poles, in meters.

Earth's radius at the poles, in meters.
sourceraw docstring

earth-polar-radius-squaredclj

source

earth-radiusclj

(earth-radius point)

Returns an approximate radius for the earth, at some point. Based on the geodetic model for an oblate spheroid.

Returns an approximate radius for the earth, at some point. Based on the
geodetic model for an oblate spheroid.
sourceraw docstring

geohash-pointclj

(geohash-point point)
(geohash-point lat long)

Returns a WGS84Point used by the geohash library.

Returns a WGS84Point used by the geohash library.
sourceraw docstring

h3-pointclj

(h3-point point)
(h3-point lat long)

Returns a GeoCoord used by the H3 library.

Returns a GeoCoord used by the H3 library.
sourceraw docstring

heightclj

(height shape)

Returns the height of a shape, in degrees.

Returns the height of a shape, in degrees.
sourceraw docstring

intersects?clj

(intersects? a b)

Do two shapes intersect in any way? Note that spatial4j's relate() considers intersection different from containment, e.g. if A completely surrounds B, their relation is not INTERSECTS. Spatial4j has a intersects() function on relations (the one used here) which considers two shapes intersecting if their intersection is non-empty; i.e. they are not disjoint.

Do two shapes intersect in any way? Note that spatial4j's relate() considers
intersection *different* from containment, e.g. if A completely surrounds B,
their relation is not INTERSECTS. Spatial4j has a intersects() function on
relations (the one used here) which considers two shapes intersecting if
their intersection is non-empty; i.e. they are not disjoint.
sourceraw docstring

jts-pointclj

(jts-point point)
(jts-point lat long)

Returns a Point used by JTS.

Returns a Point used by JTS.
sourceraw docstring

lengthclj

(length linestring)

Get geodesic length of a (jts) linestring by summing lengths of successive points

Get geodesic length of a (jts) linestring by summing lengths of successive points
sourceraw docstring

north-poleclj

source

Pointcljprotocol

latitudeclj

(latitude this)

longitudeclj

(longitude this)

to-geohash-pointclj

(to-geohash-point this)

to-h3-pointclj

(to-h3-point this)

to-spatial4j-pointclj

(to-spatial4j-point this)
source

pointclj

source

point-betweenclj

(point-between c1 c2 dist)
source

radians->degreesclj

(radians->degrees radians)
source

radians->distanceclj

(radians->distance radians)
(radians->distance radians radius)

Converts radians to meter distance on the surface of the earth. Assumes earth mean radius.

Converts radians to meter distance on the surface of the earth. Assumes
earth mean radius.
sourceraw docstring

rand-point-in-radiusclj

(rand-point-in-radius center-lat center-lon radius-meters)
(rand-point-in-radius center-lat center-lon radius-meters distribution)

Get a random point around the given latitude and longitude within the given radius.

(rand-point-in-radius 34.05656 -118.41881 100) (rand-point-in-radius 34.05656 -118.41881 100 :clustered) (rand-point-in-radius 34.05656 -118.41881 100 (fn [] 1))

Returns org.locationtech.spatial4j.shape.jts.JtsPoint; Use geo.spatial/latitude and geo.spatial/longitude to retrieve raw coords.

Accepts an optional 4th argument for customizing the distribution. Can be either :uniform or :clustered for built-in distributions, or a custom fn.

Distribution fn should return a float between 0.0 and 1.0 when invoked.

The built-in :clustered distribution uses a linear distribution of radius, which results in points clustered more heavily toward the center of the radius.

:uniform uses an exponential distribution of radius which results in points being spread evenly across the circle.

Default distribution is :uniform.

Get a random point around the given latitude and longitude within the given radius.

(rand-point-in-radius 34.05656 -118.41881 100)
(rand-point-in-radius 34.05656 -118.41881 100 :clustered)
(rand-point-in-radius 34.05656 -118.41881 100 (fn [] 1))

Returns org.locationtech.spatial4j.shape.jts.JtsPoint; Use geo.spatial/latitude and geo.spatial/longitude
to retrieve raw coords.

Accepts an optional 4th argument for customizing the distribution. Can be either :uniform or :clustered
for built-in distributions, or a custom fn.

Distribution fn should return a float between 0.0 and 1.0 when invoked.

The built-in :clustered distribution uses a linear distribution of radius, which results in points
clustered more heavily toward the center of the radius.

:uniform uses an exponential distribution of radius which results in points being spread evenly across
the circle.

Default distribution is :uniform.
sourceraw docstring

relateclj

(relate a b)

The relationship between two shapes. Returns a keyword:

:contains a contains b :within a falls within b :intersects a and b have at least one point in common :disjoint a and b have no points in common

The relationship between two shapes. Returns a keyword:

:contains    a contains b
:within      a falls within b
:intersects  a and b have at least one point in common
:disjoint    a and b have no points in common
sourceraw docstring

resegmentclj

(resegment linestring segment-length)

Repartitions a JTS LineString into multiple contiguous linestrings, each up to the provided length (in meters). Final segment may be less than the requested length. Length of individual segments may vary a bit but total length should remain the same.

Repartitions a JTS LineString into multiple contiguous linestrings, each up to the
provided length (in meters). Final segment may be less than the requested length.
Length of individual segments may vary a bit but total length should remain the same.
sourceraw docstring

Shapelikecljprotocol

to-jtsclj

(to-jts this)
(to-jts this srid)

Convert anything to a projected JTS Geometry.

Convert anything to a projected JTS Geometry.

to-shapeclj

(to-shape this)

Convert anything to a Shape.

Convert anything to a Shape.
source

south-poleclj

source

spatial4j-pointclj

(spatial4j-point point)
(spatial4j-point lat long)

A spatial4j point on the earth.

A spatial4j point on the earth.
sourceraw docstring

squareclj

(square x)
source

square-degree-in-steradiansclj

source

square-degrees->steradiansclj

(square-degrees->steradians steradians)
source

steradians->areaclj

(steradians->area steradians)
(steradians->area steradians radius)

Converts steradians to square meters on the surface of the earth. Assumes earth mean radius.

Converts steradians to square meters on the surface of the earth. Assumes
earth mean radius.
sourceraw docstring

vincenty-distance-calculatorclj

source

widthclj

(width shape)

Returns the width of a shape, in degrees.

Returns the width of a shape, in degrees.
sourceraw docstring

within-dist?clj

(within-dist? p1 p2 dist)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close