2
--345678901234567890123456789012345678901234567890123456789012345678901234567890
3
--//////////////////////////////////////////////////////////////////////////////
7
--//////////////////////////////////////////////////////////////////////////////
16
--//////////////////////////////////////////////////////////////////////////////
19
--//////////////////////////////////////////////////////////////////////////////
22
--//////////////////////////////////////////////////////////////////////////////
24
--//////////////////////////////////////////////////////////////////////////////
27
--//////////////////////////////////////////////////////////////////////////////
29
--================================
33
--================================
36
FROM geometry_columns;
39
--================================
42
--================================
44
SELECT f_geometry_column
46
WHERE f_table_name = 'streams';
49
--================================
52
--================================
54
SELECT coord_dimension
56
WHERE f_table_name = 'streams';
59
--================================
62
--================================
66
WHERE f_table_name = 'streams';
69
--================================
72
--================================
80
--//////////////////////////////////////////////////////////////////////////////
83
--//////////////////////////////////////////////////////////////////////////////
85
--================================
88
--================================
90
SELECT Dimension(shore)
92
WHERE name = 'Blue Lake';
95
--================================
98
--================================
100
SELECT GeometryType(centerlines)
102
WHERE name = 'Route 75';
104
--================================
107
--================================
109
SELECT AsText(boundary)
111
WHERE name = 'Goose Island';
113
--================================
116
--================================
118
SELECT AsText(PolygonFromWKB(AsBinary(boundary)))
120
WHERE name = 'Goose Island';
122
--================================
125
--================================
127
SELECT SRID(boundary)
129
WHERE name = 'Goose Island';
131
--================================
134
--================================
136
SELECT IsEmpty(centerline)
138
WHERE name = 'Route 5' AND aliases = 'Main Street';
140
--================================
143
--================================
145
SELECT IsSimple(shore)
147
WHERE name = 'Blue Lake';
149
--================================
151
--================================
153
SELECT AsText(Boundary(boundary))
155
WHERE name = 'Goose Island';
157
--================================
159
--================================
161
SELECT AsText(Envelope(boundary))
163
WHERE name = 'Goose Island';
167
--//////////////////////////////////////////////////////////////////////////////
170
--//////////////////////////////////////////////////////////////////////////////
172
--================================
174
--================================
178
WHERE name = 'Cam Bridge';
180
--================================
182
--================================
186
WHERE name = 'Cam Bridge';
190
--//////////////////////////////////////////////////////////////////////////////
193
--//////////////////////////////////////////////////////////////////////////////
195
--================================
198
--================================
200
SELECT AsText(StartPoint(centerline))
204
--================================
207
--================================
209
SELECT AsText(EndPoint(centerline))
213
--================================
215
--================================
217
SELECT IsClosed(Boundary(boundary))
219
WHERE name = 'Goose Island';
221
--================================
223
--================================
225
SELECT IsRing(Boundary(boundary))
227
WHERE name = 'Goose Island';
229
--================================
232
--================================
234
SELECT Length(centerline)
240
--//////////////////////////////////////////////////////////////////////////////
243
--//////////////////////////////////////////////////////////////////////////////
245
--================================
248
--================================
250
SELECT NumPoints(centerline)
254
--================================
257
--================================
259
SELECT AsText(PointN(centerline, 1))
265
--//////////////////////////////////////////////////////////////////////////////
268
--//////////////////////////////////////////////////////////////////////////////
270
--================================
273
--================================
275
SELECT AsText(Centroid(boundary))
277
WHERE name = 'Goose Island';
279
--================================
282
--================================
284
SELECT Contains(boundary, PointOnSurface(boundary))
286
WHERE name = 'Goose Island';
288
--================================
291
--================================
293
SELECT Area(boundary)
295
WHERE name = 'Goose Island';
299
--//////////////////////////////////////////////////////////////////////////////
302
--//////////////////////////////////////////////////////////////////////////////
304
--================================
307
--================================
309
SELECT AsText(ExteriorRing(shore))
311
WHERE name = 'Blue Lake';
313
--================================
316
--================================
318
SELECT NumInteriorRings(shore)
320
WHERE name = 'Blue Lake';
322
--================================
325
--================================
327
SELECT AsText(InteriorRingN(shore, 1))
329
WHERE name = 'Blue Lake';
333
--//////////////////////////////////////////////////////////////////////////////
336
--//////////////////////////////////////////////////////////////////////////////
338
--================================
341
--================================
343
SELECT NumGeometries(centerlines)
345
WHERE name = 'Route 75';
347
--================================
350
--================================
352
SELECT AsText(GeometryN(centerlines, 2))
354
WHERE name = 'Route 75';
358
--//////////////////////////////////////////////////////////////////////////////
361
--//////////////////////////////////////////////////////////////////////////////
363
--================================
366
--================================
368
SELECT IsClosed(centerlines)
370
WHERE name = 'Route 75';
372
--================================
375
--================================
377
SELECT Length(centerlines)
379
WHERE name = 'Route 75';
383
--//////////////////////////////////////////////////////////////////////////////
386
--//////////////////////////////////////////////////////////////////////////////
388
--================================
391
--================================
393
SELECT AsText(Centroid(shores))
397
--================================
400
--================================
402
SELECT Contains(shores, PointOnSurface(shores))
406
--================================
409
--================================
417
--//////////////////////////////////////////////////////////////////////////////
420
--//////////////////////////////////////////////////////////////////////////////
422
--================================
425
--================================
427
SELECT Equals(boundary, PolygonFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1))
429
WHERE name = 'Goose Island';
431
--================================
434
--================================
436
SELECT Disjoint(centerlines, boundary)
437
FROM divided_routes, named_places
438
WHERE divided_routes.name = 'Route 75' AND named_places.name = 'Ashton';
440
--================================
443
--================================
445
SELECT Touches(centerline, shore)
447
WHERE streams.name = 'Cam Stream' AND lakes.name = 'Blue Lake';
449
--================================
452
--================================
454
SELECT Within(footprint, boundary)
455
FROM named_places, buildings
456
WHERE named_places.name = 'Ashton' AND buildings.address = '215 Main Street';
458
--================================
461
--================================
463
SELECT Overlaps(forests.boundary, named_places.boundary)
464
FROM forests, named_places
465
WHERE forests.name = 'Green Forest' AND named_places.name = 'Ashton';
467
--================================
470
--================================
472
SELECT Crosses(road_segments.centerline, divided_routes.centerlines)
473
FROM road_segments, divided_routes
474
WHERE road_segments.fid = 102 AND divided_routes.name = 'Route 75';
476
--================================
479
--================================
481
SELECT Intersects(road_segments.centerline, divided_routes.centerlines)
482
FROM road_segments, divided_routes
483
WHERE road_segments.fid = 102 AND divided_routes.name = 'Route 75';
485
--================================
488
--================================
490
SELECT Contains(forests.boundary, named_places.boundary)
491
FROM forests, named_places
492
WHERE forests.name = 'Green Forest' AND named_places.name = 'Ashton';
494
--================================
497
--================================
499
SELECT Relate(forests.boundary, named_places.boundary, 'TTTTTTTTT')
500
FROM forests, named_places
501
WHERE forests.name = 'Green Forest' AND named_places.name = 'Ashton';
505
--//////////////////////////////////////////////////////////////////////////////
508
--//////////////////////////////////////////////////////////////////////////////
510
--================================
513
--================================
515
SELECT Distance(position, boundary)
516
FROM bridges, named_places
517
WHERE bridges.name = 'Cam Bridge' AND named_places.name = 'Ashton';
521
--//////////////////////////////////////////////////////////////////////////////
524
--//////////////////////////////////////////////////////////////////////////////
526
--================================
529
--================================
531
SELECT AsText(Intersection(centerline, shore))
533
WHERE streams.name = 'Cam Stream' AND lakes.name = 'Blue Lake';
535
--================================
538
--================================
540
SELECT AsText(Difference(named_places.boundary, forests.boundary))
541
FROM named_places, forests
542
WHERE named_places.name = 'Ashton' AND forests.name = 'Green Forest';
544
--================================
547
--================================
549
SELECT AsText(GeomUnion(shore, boundary))
550
FROM lakes, named_places
551
WHERE lakes.name = 'Blue Lake' AND named_places.name = 'Goose Island';
553
--================================
556
--================================
558
SELECT AsText(SymmetricDifference(shore, boundary))
559
FROM lakes, named_places
560
WHERE lakes.name = 'Blue Lake' AND named_places.name = 'Goose Island';
562
--================================
565
--================================
568
FROM buildings, bridges
569
WHERE Contains(Buffer(bridges.position, 15.0), buildings.footprint);
571
--================================
574
--================================
576
SELECT AsText(ConvexHull(shore))
578
WHERE lakes.name = 'Blue Lake';