chickadee » geo-utils

geo-utils

Geographic Utilities

TOC »

Documentation

API for constructing and manipulating geographic data.

Module geopoint

Usage

(import geopoint)

Argument Conventions

GP
geopoint.
LAT
latitude real.
LON
longitude real.

make-geopoint

make-geopoint LAT LONprocedure

geopoint?

geopoint? OBJprocedure

check-geopoint

check-geopoint LOC OBJ #!optional VARNAMprocedure

error-geopoint

error-geopoint LOC OBJ #!optional VARNAMprocedure

geopoint-latitude

geopoint-latitude GPprocedure

geopoint-longitude

geopoint-longitude GPprocedure

geopoint-strictly-above?

geopoint-strictly-above? GP1 GP2procedure

geopoint-above?

geopoint-above? GP1 GP2procedure

geopoint-strictly-below?

geopoint-strictly-below? GP1 GP2procedure

geopoint-below?

geopoint-below? GP1 GP2procedure

geopoint-strictly-left?

geopoint-strictly-left? GP1 GP2procedure

geopoint-left?

geopoint-left? GP1 GP2procedure

geopoint-strictly-right?

geopoint-strictly-right? GP1 GP2procedure

geopoint-right?

geopoint-right? GP1 GP2procedure

geopoint=

geopoint= GP1 GP2procedure

geopoint<

geopoint< GP1 GP2procedure

geopoint>

geopoint> GP1 GP2procedure

geopoint<=

geopoint<= GP1 GP2procedure

geopoint>=

geopoint>= GP1 GP2procedure

Module geobox

Usage

(import geobox)

Argument Conventions

GB
geobox.

make-geobox

make-geobox GP-MIN GP-MAXprocedure

geobox?

geobox? OBJprocedure

check-geobox

check-geobox LOC OBJ #!optional VARNAMprocedure

error-geobox

error-geobox LOC OBJ #!optional VARNAMprocedure

geobox-minimum

geobox-minimum GBprocedure

geobox-maximum

geobox-maximum GBprocedure

geobox=

geobox= GB1 GB2procedure

geobox<

geobox< GB1 GB2procedure

geobox>

geobox> GB1 GB2procedure

geobox<=

geobox<= GB1 GB2procedure

geobox>=

geobox>= GB1 GB2procedure

geopoint-within-box?

geopoint-within-box? GP GBprocedure

Module geopolygon

Usage

(import geopolygon)

Argument Conventions

GPOLY
geopolygon.

make-geopolygon

make-geopolygon GPSprocedure
GPS
(or (list-of geopoint) (vector-of geopoint))

geopolygon?

geopolygon? OBJprocedure

check-geopolygon

check-geopolygon LOC OBJ #!optional VARNAMprocedure

error-geopolygon

error-geopolygon LOC OBJ #!optional VARNAMprocedure

geopolygon->list

geopolygon->list GPOLYprocedure

list->geopolygon

list->geopolygon GPSprocedure
GPS
(list-of geopoint)

geopolygon

geopolygon GP...procedure

geopolygon-closed?

geopolygon-closed? GPOLYprocedure

Polygon has the same initial and final geopoint.

geopolygon-open?

geopolygon-open? GPOLYprocedure

Polygon does not have the same initial and final geopoint.

geopolygon-bounding-box

geopolygon-bounding-box GPOLYprocedure

Module geopoint-utils

Usage

(import geopoint-utils)

in-closed-polygon?

(in-closed-polygon? GP GPOLY [INTERSECTS? intersects?-pnp]) --> booleanprocedure

Is the (: GP geopoint) in the (: GPOLY (or (vector-of geopoint) (list-of geopoint)))?

INTERSECTS? is a (procedure ((: PI geopoint) (: PJ geopoint) (: LAT real) (: LON real)) --> boolean) testing for ray intersection.

Treats an open geopolygon as closed.

intersects?

intersects? PT PI PJprocedure

Does the point PT intersect the line PI - PJ?

PT
geopoint ; point to test
PI
geopoint ; line end i
PJ
geopoint ; line end j

pythagorean-distance

pythagorean-distance GP1 GP2procedure

pythagorean-distance*

pythagorean-distance* GP1 GP2procedure

spherical-surface-distance

(spherical-surface-distance GP1 GP2 (R EARTH-RADIUS-KILOMETERS)) -> realprocedure

great-circle-distance

(great-circle-distance GP1 GP2 (R EARTH-RADIUS-KILOMETERS)) -> realprocedure

great-circle-distance-radians

(great-circle-distance-radians GP1 GP2 (R EARTH-RADIUS-KILOMETERS)) -> realprocedure

approximate-ellipsoid-distance

(approximate-ellipsoid-distance GP1 GP2 (R EARTH-RADIUS-KILOMETERS) (F EARTH-FLATTENING)) -> realprocedure

great-circle-azimuth

(great-circle-azimuth GP1 GP2 [PREC 5]) -> realprocedure

great-circle-position

(great-circle-position GP DIS AZI (R EARTH-RADIUS-KILOMETERS)) -> (values latitude longitude)procedure

Module geo-utils

Usage

(import geo-utils)

pythagorean-distance

pythagorean-distance LAT1 LON1 LAT2 LON2procedure

pythagorean-distance*

pythagorean-distance* LAT1 LON1 LAT2 LON2procedure

spherical-surface-distance

(spherical-surface-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-KILOMETERS)) -> realprocedure

great-circle-distance

(great-circle-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-KILOMETERS)) -> realprocedure

great-circle-distance-radians

(great-circle-distance-radians LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-KILOMETERS)) -> realprocedure

approximate-ellipsoid-distance

(approximate-ellipsoid-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-KILOMETERS) (F EARTH-FLATTENING)) -> realprocedure

great-circle-azimuth

(great-circle-azimuth LAT1 LON1 LAT2 LON2 [PREC 5]) -> realprocedure

great-circle-position

(great-circle-position LAT LON DIS AZI (R EARTH-RADIUS-KILOMETERS)) -> (values latitude longitude)procedure

intersects?-pnp

intersects?-pnp LATI LONI LATJ LONJ LAT LONprocedure

intersects?-pip

intersects?-pip LATI LONI LATJ LONJ LAT LONprocedure

Module geo-dms

Usage

(import geo-dms)

Argument Conventions

D
degrees real.
M
minutes real, optional in string form.
S
seconds real, optional in string form.
DEG
degreesreal.
LAT?
latitude? boolean.
PAD
padding between elements string.
LEADING-DIR?
compass direction is prefix?

degree-minute-second-text

degree-minute-second-text #!optional DMS-TEXTprocedure

DMS-TEXT is a 3 element list of string of the form (<degrees suffix> <minutes suffix> <seconds suffix>).

dms->degree

dms->degree D M Sprocedure

degree->dms

degree->dms DEGprocedure

Returns the degree+minutes+seconds for the degrees DEG.

dms->string

(dms->string D M S [LAT? [LEADING-DIR? [PAD ""]]]) -> stringprocedure

Example: 122°45'10"W

dms->string*

(dms->string* D M S [PAD ""]) -> stringprocedure

Example: 122°45'10"

string-dms->degree

string->degree

string-dms->degree STR #!optional LAT?procedure
string->degree STR #!optional LAT?procedure

Returns the degrees for string form of dms STR.

degree->string

(degree->string DEG [LAT? [LEADING-DIR? [PAD ""]]]) -> stringprocedure

Returns the dms-string for the degrees DEG.

Module globe

Usage

(import geo-globe)

make-globe

make-globe RADIUS FLATTENINGprocedure

globe?

globe? OBJprocedure

check-globe

check-globe LOC OBJ #!optional VARNAMprocedure

error-globe

error-globe LOC OBJ #!optional VARNAMprocedure

globe-radius-kilometers

globe-radius-kilometers GLOBEprocedure

globe-flattening-factor

globe-flattening-factor GLOBEprocedure

spherical-surface-distance

spherical-surface-distance GLOBE GP1 GP2procedure

great-circle-distance

great-circle-distance GLOBE GP1 GP2procedure

great-circle-distance-radians

great-circle-distance-radians GLOBE GP1 GP2procedure

approximate-ellipsoid-distance

approximate-ellipsoid-distance GLOBE GP1 GP2procedure

great-circle-azimuth

(great-circle-azimuth GP1 GP2 [PRECISION 5]) -> numberprocedure

great-circle-position

great-circle-position GLOBE GP DISTANCE AZIMUTHprocedure

Module earth

Usage

(import geo-earth)

*earth-flattening*

<variable>*earth-flattening* -> real</variable>

*earth-radius-miles*

<variable>*earth-radius-miles* -> real</variable>

*earth-radius-kilometers*

<variable>*earth-radius-kilometers* -> real</variable>

make-earth

make-earthprocedure

Bugs & Limitations

Notes

Requirements

mathh srfi-1 vector-lib check-errors

Author

Kon Lovett

Repository

This egg is hosted on the CHICKEN Subversion repository:

https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/geo-utils

If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.

Version history

1.1.0
.
1.0.7
Degree seconds are float.
1.0.6
.
1.0.5
.
1.0.4
Allow (or integer ratnum float) as real; was float only.
1.0.3
.
1.0.2
.
1.0.1
.
1.0.0
CHICKEN 5 release.
0.5.0
Add earth.
0.4.0
SI default. Add globe.
0.3.2
Uses numbers.
0.3.1
Uses test.
0.3.0
.
0.2.0
.
0.1.1
.
0.1.0
Hello

License

Copyright (C) 2017-2022 Kon Lovett. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contents »