source: project/release/5/geo-utils/geo-utils @ 35995

Last change on this file since 35995 was 35995, checked in by Kon Lovett, 2 years ago

C5 initial

File size: 7.6 KB
Line 
1[[tags: egg]]
2
3== geo-utils
4
5Geographic Utilities
6
7[[toc:]]
8
9
10== Documentation
11
12API for constructing and manipulating geographic data.
13
14=== Argument Conventions
15
16
17=== Usage
18
19<enscript language=scheme>
20(require-extension geopoint)
21</enscript>
22
23=== Argument Conventions
24
25; {{GP}} : {{geopoint}}.
26; {{LAT}} : latitude {{real}}.
27; {{LON}} : longitude {{real}}.
28
29=== make-geopoint
30
31<procedure>(make-geopoint LAT LON) => geopoint</procedure>
32
33=== geopoint?
34
35<procedure>(geopoint? OBJ) => boolean</procedure>
36
37=== check-geopoint
38
39<procedure>(check-geopoint LOC OBJ [VARNAM]) => geopoint</procedure>
40
41=== error-geopoint
42
43<procedure>(error-geopoint LOC OBJ [VARNAM])</procedure>
44
45=== geopoint-latitude
46
47<procedure>(geopoint-latitude GP) => real</procedure>
48
49=== geopoint-longitude
50
51<procedure>(geopoint-longitude GP) => real</procedure>
52
53=== geopoint-strictly-above
54
55<procedure>(geopoint-strictly-above GP1 GP2) => boolean</procedure>
56
57=== geopoint-above
58
59<procedure>(geopoint-above GP1 GP2) => boolean</procedure>
60
61=== geopoint-strictly-below
62
63<procedure>(geopoint-strictly-below GP1 GP2) => boolean</procedure>
64
65=== geopoint-below
66
67<procedure>(geopoint-below GP1 GP2) => boolean</procedure>
68
69=== geopoint-strictly-left
70
71<procedure>(geopoint-strictly-left GP1 GP2) => boolean</procedure>
72
73=== geopoint-left
74
75<procedure>(geopoint-left GP1 GP2) => boolean</procedure>
76
77=== geopoint-strictly-right
78
79<procedure>(geopoint-strictly-right GP1 GP2) => boolean</procedure>
80
81=== geopoint-right
82
83<procedure>(geopoint-right GP1 GP2) => boolean</procedure>
84
85=== geopoint=
86
87<procedure>(geopoint= GP1 GP2) => boolean</procedure>
88
89=== geopoint<
90
91<procedure>(geopoint< GP1 GP2) => boolean</procedure>
92
93=== geopoint>
94
95<procedure>(geopoint> GP1 GP2) => boolean</procedure>
96
97=== geopoint<=
98
99<procedure>(geopoint<= GP1 GP2) => boolean</procedure>
100
101=== geopoint>=
102
103<procedure>(geopoint>= GP1 GP2) => boolean</procedure>
104
105
106=== Usage
107
108<enscript language=scheme>
109(require-extension geobox)
110</enscript>
111
112=== Argument Conventions
113
114; {{GB}} : {{geobox}}.
115
116=== make-geobox
117
118<procedure>(make-geobox GP-MIN GP-MAX) => geobox</procedure>
119
120=== geobox?
121
122<procedure>(geobox? OBJ) => boolean</procedure>
123
124=== check-geobox
125
126<procedure>(check-geobox LOC OBJ [VARNAM]) => geobox</procedure>
127
128=== error-geobox
129
130<procedure>(error-geobox LOC OBJ [VARNAM])</procedure>
131
132=== geobox-minimum
133
134<procedure>(geobox-minimum GB) => geopoint</procedure>
135
136=== geobox-maximum
137
138<procedure>(geobox-maximum GB) => geopoint</procedure>
139
140=== geobox=
141
142<procedure>(geobox= GB1 GB2) => boolean</procedure>
143
144=== geobox<
145
146<procedure>(geobox< GB1 GB2) => boolean</procedure>
147
148=== geobox>
149
150<procedure>(geobox> GB1 GB2) => boolean</procedure>
151
152=== geobox<=
153
154<procedure>(geobox<= GB1 GB2) => boolean</procedure>
155
156=== geobox>=
157
158<procedure>(geobox>= GB1 GB2) => boolean</procedure>
159
160=== geopoint-within-box
161
162<procedure>(geopoint-within-box GP GB) => boolean</procedure>
163
164
165=== Usage
166
167<enscript language=scheme>
168(require-extension geopolygon)
169</enscript>
170
171=== Argument Conventions
172
173; {{GPOLY}} : {{geopolygon}}.
174
175=== make-geopolygon
176
177<procedure>(make-geopolygon GP-COLL) => geopolygon</procedure>
178
179{{GP-COLL}} is {{list}} or {{vector}} of {{geopoint}}.
180
181=== geopolygon?
182
183<procedure>(geopolygon? OBJ) => boolean</procedure>
184
185=== check-geopolygon
186
187<procedure>(check-geopolygon LOC OBJ [VARNAM]) => geopolygon</procedure>
188
189=== error-geopolygon
190
191<procedure>(error-geopolygon LOC OBJ [VARNAM])</procedure>
192
193=== geopolygon
194
195<procedure>(geopolygon GP...) => geopolygon</procedure>
196
197=== geopolygon-closed?
198
199<procedure>(geopolygon-closed? GPOLY) => boolean</procedure>
200
201Polygon has the same initial and final {{geopoint}}.
202
203=== geopolygon-open?
204
205<procedure>(geopolygon-open? GPOLY) => boolean</procedure>
206
207Polygon does not have the same initial and final {{geopoint}}.
208
209=== geopolygon-bounding-box
210
211<procedure>(geopolygon-bounding-box GPOLY) => geobox</procedure>
212
213
214=== Usage
215
216<enscript language=scheme>
217(require-extension geopoint-utils)
218</enscript>
219
220=== geopoint-in-closed-polygon?
221
222<procedure>(geopoint-in-closed-polygon? GP GPOLY) => boolean</procedure>
223
224Treats an open geopolygon as closed.
225
226
227
228=== Usage
229
230<enscript language=scheme>
231(require-extension geo-utils)
232</enscript>
233
234=== earth-flattening
235
236<variable>earth-flattening</variable>
237
238=== earth-radius-miles
239
240<variable>earth-radius-miles</variable>
241
242=== earth-radius-kilometers
243
244<variable>earth-radius-kilometers</variable>
245
246
247=== pythagorean-distance
248
249<procedure>(pythagorean-distance LAT1 LON1 LAT2 LON2) => real</procedure>
250
251=== pythagorean-distance*
252
253<procedure>(pythagorean-distance* LAT1 LON1 LAT2 LON2) => real</procedure>
254
255=== spherical-surface-distance
256
257<procedure>(spherical-surface-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-MILES)) => real</procedure>
258
259=== great-circle-distance
260
261<procedure>(great-circle-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-MILES)) => real</procedure>
262
263=== great-circle-distance-radians
264
265<procedure>(great-circle-distance-radians LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-MILES)) => real</procedure>
266
267=== approximate-ellipsoid-distance
268
269<procedure>(approximate-ellipsoid-distance LAT1 LON1 LAT2 LON2 (R EARTH-RADIUS-MILES)) => real</procedure>
270
271=== great-circle-azimuth
272
273<procedure>(great-circle-azimuth LAT1 LON1 LAT2 LON2 [PREC 5]) => real</procedure>
274
275=== great-circle-position
276
277<procedure>(great-circle-position LAT LON DIS AZI (R EARTH-RADIUS-MILES)) => real</procedure>
278
279
280=== Usage
281
282<enscript language=scheme>
283(require-extension geo-dms)
284</enscript>
285
286=== Argument Conventions
287
288; {{D}} : degrees {{real}}.
289; {{M}} : minutes {{real}}.
290; {{S}} : seconds {{real}}.
291; {{LAT?}} : latitude? {{boolean}}.
292; {{PAD}} : padding between elements {{string}}.
293
294=== degree-minute-second-text
295
296<procedure>(degree-minute-second-text [DMS-TEXT]) => (list-of string)</procedure>
297
298{{DMS-TEXT}} is a 3 element {{list}} of {{string}} of the form {{(<degrees
299suffix> <minutes suffix> <seconds suffix>)}}.
300
301=== dms->degree
302
303<procedure>(dms->degree D M S) => real</procedure>
304
305=== degree->dms
306
307<procedure>(degree->dms DEG) => (values D M S)</procedure>
308
309Returns the degree+minutes+seconds for the degrees {{DEG}} {{real}}.
310
311=== dms->string
312
313<procedure>(dms->string D M S [LAT? [LEADING-DIR? [PAD ""]]]) => string</procedure>
314
315; {{LEADING-DIR?}} : compass direction is prefix?
316
317=== dms->string*
318
319<procedure>(dms->string* D M S [PAD ""]) => string</procedure>
320
321=== string-dms->degree
322
323<procedure>(string-dms->degree STR [LAT?]) => real</procedure>
324
325Returns the degrees for string form of dms {{STR}}.
326
327
328== Bugs & Limitations
329
330* Probably some.
331
332
333== Notes
334
335* Incomplete in testing and functionality. Insufficient in design.
336
337
338== Author
339
340[[/users/kon-lovett|Kon Lovett]]
341
342
343== Version history
344
345; 0.1.0 : Hello
346
347
348== License
349
350Copyright (C) 2017 Kon Lovett.  All rights reserved.
351
352Permission is hereby granted, free of charge, to any person obtaining a
353copy of this software and associated documentation files (the Software),
354to deal in the Software without restriction, including without limitation
355the rights to use, copy, modify, merge, publish, distribute, sublicense,
356and/or sell copies of the Software, and to permit persons to whom the
357Software is furnished to do so, subject to the following conditions:
358
359The above copyright notice and this permission notice shall be included
360in all copies or substantial portions of the Software.
361
362THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
363IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
364FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
365THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
366OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
367ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
368OTHER DEALINGS IN THE SOFTWARE.
Note: See TracBrowser for help on using the repository browser.