You are looking at historical revision 34458 of this page. It may differ significantly from its current revision.
geo-utils
Geographic Utilities
- geo-utils
- Documentation
- 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>=
- Usage
- Argument Conventions
- make-geobox
- geobox?
- check-geobox
- error-geobox
- geobox-minimum
- geobox-maximum
- geobox=
- geobox<
- geobox>
- geobox<=
- geobox>=
- geopoint-within-box
- Usage
- Argument Conventions
- make-geopolygon
- geopolygon?
- check-geopolygon
- error-geopolygon
- geopolygon
- geopolygon-closed?
- geopolygon-open?
- geopolygon-bounding-box
- Usage
- geopoint-in-closed-polygon?
- intersects?-pnp
- intersects?-pip
- Usage
- earth-flattening
- earth-radius-miles
- earth-radius-kilometers
- pythagorean-distance
- pythagorean-distance*
- spherical-surface-distance
- great-circle-distance
- great-circle-distance-radians
- approximate-ellipsoid-distance
- great-circle-azimuth
- great-circle-position
- Usage
- Argument Conventions
- degree-minute-second-text
- dms->degree
- degree->dms
- dms->string
- dms->string*
- string-dms->degree
- Bugs & Limitations
- Notes
- Author
- Version history
- License
Documentation
API for constructing and manipulating geographic data.
Usage
(require-extension geopoint)
Argument Conventions
- GP
- geopoint.
- LAT
- latitude real.
- LON
- longitude real.
make-geopoint
[procedure] (make-geopoint LAT LON) => geopointgeopoint?
[procedure] (geopoint? OBJ) => booleancheck-geopoint
[procedure] (check-geopoint LOC OBJ [VARNAM]) => geopointerror-geopoint
[procedure] (error-geopoint LOC OBJ [VARNAM])geopoint-latitude
[procedure] (geopoint-latitude GP) => realgeopoint-longitude
[procedure] (geopoint-longitude GP) => realgeopoint-strictly-above
[procedure] (geopoint-strictly-above GP1 GP2) => booleangeopoint-above
[procedure] (geopoint-above GP1 GP2) => booleangeopoint-strictly-below
[procedure] (geopoint-strictly-below GP1 GP2) => booleangeopoint-below
[procedure] (geopoint-below GP1 GP2) => booleangeopoint-strictly-left
[procedure] (geopoint-strictly-left GP1 GP2) => booleangeopoint-left
[procedure] (geopoint-left GP1 GP2) => booleangeopoint-strictly-right
[procedure] (geopoint-strictly-right GP1 GP2) => booleangeopoint-right
[procedure] (geopoint-right GP1 GP2) => booleangeopoint=
[procedure] (geopoint= GP1 GP2) => booleangeopoint<
[procedure] (geopoint< GP1 GP2) => booleangeopoint>
[procedure] (geopoint> GP1 GP2) => booleangeopoint<=
[procedure] (geopoint<= GP1 GP2) => booleangeopoint>=
[procedure] (geopoint>= GP1 GP2) => booleanUsage
(require-extension geobox)
Argument Conventions
- GB
- geobox.
make-geobox
[procedure] (make-geobox GP-MIN GP-MAX) => geoboxgeobox?
[procedure] (geobox? OBJ) => booleancheck-geobox
[procedure] (check-geobox LOC OBJ [VARNAM]) => geoboxerror-geobox
[procedure] (error-geobox LOC OBJ [VARNAM])geobox-minimum
[procedure] (geobox-minimum GB) => geopointgeobox-maximum
[procedure] (geobox-maximum GB) => geopointgeobox=
[procedure] (geobox= GB1 GB2) => booleangeobox<
[procedure] (geobox< GB1 GB2) => booleangeobox>
[procedure] (geobox> GB1 GB2) => booleangeobox<=
[procedure] (geobox<= GB1 GB2) => booleangeobox>=
[procedure] (geobox>= GB1 GB2) => booleangeopoint-within-box
[procedure] (geopoint-within-box GP GB) => booleanUsage
(require-extension geopolygon)
Argument Conventions
- GPOLY
- geopolygon.
make-geopolygon
[procedure] (make-geopolygon GP ...) => geopolygonGP is a geopoint.
[procedure] (make-geopolygon GPS) => geopolygonGPS is (or (list-of geopoint) (vector-of geopoint)).
geopolygon?
[procedure] (geopolygon? OBJ) => booleancheck-geopolygon
[procedure] (check-geopolygon LOC OBJ [VARNAM]) => geopolygonerror-geopolygon
[procedure] (error-geopolygon LOC OBJ [VARNAM])geopolygon
[procedure] (geopolygon GP...) => geopolygongeopolygon-closed?
[procedure] (geopolygon-closed? GPOLY) => booleanPolygon has the same initial and final geopoint.
geopolygon-open?
[procedure] (geopolygon-open? GPOLY) => booleanPolygon does not have the same initial and final geopoint.
geopolygon-bounding-box
[procedure] (geopolygon-bounding-box GPOLY) => geoboxUsage
(require-extension geopoint-utils)
geopoint-in-closed-polygon?
[procedure] (geopoint-in-closed-polygon? GP GPOLY [INTERSECTS? intersects?-pnp]) => booleanIs 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
[procedure] (intersects?-pnp PI PJ LAT LON) => booleanintersects?-pip
[procedure] (intersects?-pip PI PJ LAT LON) => booleanUsage
(require-extension geo-utils)
earth-flattening
<variable>earth-flattening</variable>
earth-radius-miles
<variable>earth-radius-miles</variable>
earth-radius-kilometers
<variable>earth-radius-kilometers</variable>
pythagorean-distance
[procedure] (pythagorean-distance LAT1 LON1 LAT2 LON2) => realpythagorean-distance*
[procedure] (pythagorean-distance* LAT1 LON1 LAT2 LON2) => realspherical-surface-distance
[procedure] (spherical-surface-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-MILES)) => realgreat-circle-distance
[procedure] (great-circle-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-MILES)) => realgreat-circle-distance-radians
[procedure] (great-circle-distance-radians LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-MILES)) => realapproximate-ellipsoid-distance
[procedure] (approximate-ellipsoid-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-MILES)) => realgreat-circle-azimuth
[procedure] (great-circle-azimuth LAT1 LON1 LAT2 LON2 [PREC 5]) => realgreat-circle-position
[procedure] (great-circle-position LAT LON DIS AZI (R EARTH-RADIUS-MILES)) => (values latitude longitude)Usage
(require-extension geo-dms)
Argument Conventions
- D
- degrees real.
- M
- minutes real.
- S
- seconds real.
- LAT?
- latitude? boolean.
- PAD
- padding between elements string.
degree-minute-second-text
[procedure] (degree-minute-second-text [DMS-TEXT]) => (list-of string)DMS-TEXT is a 3 element list of string of the form (<degrees suffix> <minutes suffix> <seconds suffix>).
dms->degree
[procedure] (dms->degree D M S) => realdegree->dms
[procedure] (degree->dms DEG) => (values D M S)Returns the degree+minutes+seconds for the degrees DEG real.
dms->string
[procedure] (dms->string D M S [LAT? [LEADING-DIR? [PAD ""]]]) => string- LEADING-DIR?
- compass direction is prefix?
Example: 122°45'10"W
dms->string*
[procedure] (dms->string* D M S [PAD ""]) => stringExample: 122°45'10"
string-dms->degree
[procedure] (string-dms->degree STR [LAT?]) => realReturns the degrees for string form of dms STR.
Bugs & Limitations
- Probably some.
Notes
- The relational predicates are rather useless.
- Incomplete.
Author
Version history
- 0.2.0
- 0.1.1
- 0.1.0
- Hello
License
Copyright (C) 2017 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.