geo-utils
Geographic Utilities
TOC »
- 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
- Repository
- Version history
- License
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
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
(import 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
(import geopolygon)
Argument Conventions
- GPOLY
- geopolygon.
make-geopolygon
- make-geopolygon GPSprocedure
- GPS
- (or (list-of geopoint) (vector-of geopoint))
geopolygon?
- geopolygon? OBJprocedure
check-geopolygon
error-geopolygon
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
great-circle-distance
great-circle-distance-radians
approximate-ellipsoid-distance
- (approximate-ellipsoid-distance GP1 GP2 (R EARTH-RADIUS-KILOMETERS) (F EARTH-FLATTENING)) -> realprocedure
great-circle-azimuth
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*
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
intersects?-pnp
intersects?-pip
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
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
(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
- Probably some.
Notes
- The relational predicates are rather useless.
- Incomplete.
- Should have functor versions of algorithms so can specialize.
Requirements
mathh srfi-1 vector-lib check-errors
Author
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.