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