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.
(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.
(area-in-square-degrees rect)
The area of a rectangle in square degrees.
The area of a rectangle in square degrees.
(bounding-box shape)
Returns the bounding box of any shape.
Returns the bounding box of any shape.
(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.
(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.
(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.
(distance a b)
Distance between two points, in meters
Distance between two points, in meters
(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.
(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.
(distance-in-degrees a b)
Distance between two points, in degrees.
Distance between two points, in degrees.
The SpatialContext of the earth, as according to spatial4j.
The SpatialContext of the earth, as according to spatial4j.
Earth's equatorial circumference, in meters
Earth's equatorial circumference, in meters
Earth's radius at the equator, in meters.
Earth's radius at the equator, in meters.
Earth's mean circumference, in meters.
Earth's mean circumference, in meters.
Earth's mean radius, in meters.
Earth's mean radius, in meters.
Earth's circumference around a meridian, in meters.
Earth's circumference around a meridian, in meters.
Earth's radius at the poles, in meters.
Earth's radius at the poles, in meters.
(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.
(geohash-point point)
(geohash-point lat long)
Returns a WGS84Point used by the geohash library.
Returns a WGS84Point used by the geohash library.
(h3-point point)
(h3-point lat long)
Returns a GeoCoord used by the H3 library.
Returns a GeoCoord used by the H3 library.
(height shape)
Returns the height of a shape, in degrees.
Returns the height of a shape, in degrees.
(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.
ShapeFactory for producing spatial4j Shapes from JTSGeometries based
ShapeFactory for producing spatial4j Shapes from JTSGeometries based
(jts-point point)
(jts-point lat long)
Returns a Point used by JTS.
Returns a Point used by JTS.
(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
(latitude this)
(longitude this)
(to-geohash-point this)
(to-h3-point this)
(to-spatial4j-point this)
(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.
(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.
(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
(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.
(to-jts this)
(to-jts this srid)
Convert anything to a projected JTS Geometry.
Convert anything to a projected JTS Geometry.
(to-shape this)
Convert anything to a Shape.
Convert anything to a Shape.
(spatial4j-point point)
(spatial4j-point lat long)
A spatial4j point on the earth.
A spatial4j point on the earth.
(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.
(width shape)
Returns the width of a shape, in degrees.
Returns the width of a shape, in degrees.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close