Outdated egg!
This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.
If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.
geo-utils
Geographic Utilities
TOC »
- Outdated egg!
- geo-utils
- Documentation
- Module geopoint
- Usage
- Argument Conventions
- make-geopoint
- geopoint?
- check-geopoint
- error-geopoint
- geopoint-latitude
- geopoint-longitude
- geopoint-strictly-above?
- geopoint-above?
- geopoint-strictly-below?
- geopoint-below?
- geopoint-strictly-left?
- geopoint-left?
- geopoint-strictly-right?
- geopoint-right?
- geopoint=
- geopoint<
- geopoint>
- geopoint<=
- geopoint>=
- Module geobox
- Module geopolygon
- Module geopoint-utils
- Module geo-utils
- Module geo-dms
- Module globe
- Module earth
- Module geopoint
- Bugs & Limitations
- Notes
- Requirements
- Author
- Version history
- License
Documentation
API for constructing and manipulating geographic data.
Module geopoint
Usage
(require-extension geopoint)
Argument Conventions
- GP
- geopoint.
- LAT
- latitude real.
- LON
- longitude real.
make-geopoint
- make-geopoint LAT LONprocedure
geopoint?
- geopoint? OBJprocedure
check-geopoint
error-geopoint
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
(require-extension geobox)
Argument Conventions
- GB
- geobox.
make-geobox
- make-geobox GP-MIN GP-MAXprocedure
geobox?
- geobox? OBJprocedure
check-geobox
error-geobox
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
(require-extension geopolygon)
Argument Conventions
- GPOLY
- geopolygon.
make-geopolygon
- make-geopolygon GP ...procedure
GP is a geopoint.
- make-geopolygon GPSprocedure
GPS is (or (list-of geopoint) (vector-of geopoint)).
geopolygon?
- geopolygon? OBJprocedure
check-geopolygon
error-geopolygon
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
(require-extension geopoint-utils)
geopoint-in-closed-polygon?
- (geopoint-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?-pnp
- intersects?-pnp PI PJ LAT LONprocedure
intersects?-pip
- intersects?-pip PI PJ LAT LONprocedure
Module geo-utils
Usage
(require-extension geo-utils)
pythagorean-distance
pythagorean-distance*
spherical-surface-distance
great-circle-distance
great-circle-distance-radians
approximate-ellipsoid-distance
great-circle-azimuth
great-circle-position
- (great-circle-position LAT LON DIS AZI (R EARTH-RADIUS-KILOMETERS)) => (values latitude longitude)procedure
Module geo-dms
Usage
(require-extension geo-dms)
Argument Conventions
- D
- degrees real.
- M
- minutes real.
- S
- seconds real.
- 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-dms->degree STR #!optional LAT?procedure
Returns the degrees for string form of dms STR.
string->degree
- string->degree STR #!optional LAT?procedure
Synonym of string-dms->degree.
degree->string
- (degree->string DEG [LAT? [LEADING-DIR? [PAD ""]]]) => stringprocedure
Returns the dms-string for the degrees DEG.
Module globe
Usage
(require-extension geo-globe)
make-globe
- make-globe RADIUS FLATTENINGprocedure
globe?
- globe? OBJprocedure
check-globe
error-globe
globe-radius-kilometers
- globe-radius-kilometers GLOBEprocedure
globe-flattening-factor
- globe-flattening-factor GLOBEprocedure
spherical-surface-distance
great-circle-distance
- great-circle-distance GLOBE GP1 GP2procedure
great-circle-distance-radians
approximate-ellipsoid-distance
great-circle-azimuth
great-circle-position
Module earth
Usage
(require-extension 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
- Probably some.
Notes
- The relational predicates are rather useless.
- Incomplete.
Requirements
miscmacros moremacros numbers mathh vector-lib check-errors
Author
Version history
- 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-2018 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.