-
Notifications
You must be signed in to change notification settings - Fork 0
/
gis.html
1538 lines (1445 loc) · 61.9 KB
/
gis.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>
GIS Extention
</title>
<link rel="stylesheet" href="netlogo.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<h1>
GIS 扩展
</h1>
<p>
这个扩展将GIS(地理信息系统)支持加入NetLogo。它提供了加载矢量GIS数据(点,线和多边形)的能力,并且能栅格GIS数据(网格)进你的模型。
<p>
这个扩展以ESRI形状文件的形式支持矢量数据。形状文件(.shp)格式是最常见的存储和修改矢量GIS数据的形式。这个扩展以ESRI ASCII 网格文件的形式支持栅格文件。ASCII网格文件(.asc 或者.grd)并不如形状文件常见,但是被大多数GIS平台作为交互格式支持。
<h2>
如何使用
</h2>
<p>
总体来说,首先定义一个GIS数据空间和Netlogo空间之间的转换,然后加载数据集,并对其运行多种操作。最简单的在GIS空间和Netlogo空间之间定义转换的方法是取"envelopes"的并集或者约束所有GIS空间和Netlogo世界中边界的地图的范围。看GIS例子。
<p>
你也可以选择性的为GIS空间定义一个映射,这样,数据集会被反映射来匹配装载时的映射,只要你的每个描述映射或者地理协调系统的数据文件都与.prj文件有关联。如果没有找到关联的.prj文件,扩展就会假定数据集已经使用了当前的映射,无论当前映射是什么。
<p>
一旦协调系统被定义后,就可以使用
<a href="#gis:load-dataset">gis:load-dataset</a>来加载数据集。这条源于返回一个矢量数据集或者是一个栅格数据集,取决于你传的文件类型。
<p>
一个矢量数据集包括一个矢量型的集合,每个矢量型都是点、线或者多边形,还有一组属性值。单个的矢量数据集可能只包含三种可能的型中的一种。
<p>
可以对矢量数据集做以下几件事:查询矢量型的属性的名称,查询它的"envelope"(边界矩形),查询数据集中所有的某个属性大于或小于固定值的矢量型的列表,或者列出给定范围,或者使用通配符匹配("*",匹配任何出现字符的数字)了来配对给定的字符串。如果矢量型是多边形,你也可以将数据集的型的特定属性的值赋给一块给定的变量。
<p>
也可以从矢量数据集中对矢量型做以下事情:查询顶点列表的列表,按照名称查询属性值,查询它的重心(重力的中心),和查询和给定的矢量型互动的给定主体集的子集。对于点数据来讲,每一个顶点列表都是一个元素的列表。对线数据来讲,每个顶点列表都会给出组成这个型的顶点。对多边形来说,每个顶点列表会给出一个多边形的环,而且第一个顶点和最后一个顶点是相同的。顶点列表是有顶点类型的值组成的,重心也是顶点类型的值。
<p>
对栅格性数据也有很多操作。大部分都和在数据集中取样或者重新取样有关。可以在给定瓦片变量上应用一个栅格数据,也可以用任意的卷积矩阵卷乘一个栅格数据。
<blockquote>
<p>
<b>Code Example:</b> GIS General Examples has general examples of
how to use the extension
<p>
<b>Code Example:</b> GIS Gradient Example is a more advanced
example of raster dataset analysis.
</blockquote>
<h2>
已知问题
</h2>
<p>
栅格数据集,矢量数据集,矢量型和顶点的值都不能用
<tt>export-world</tt> 和
<tt>import-world</tt>合适的处理。要保存书籍,必须使用
<tt>gis:store-dataset</tt> 原语。
<p>
当前不能区分活动区域
"shell"多边形与消极区域 "hole"多边形,也不能决定哪些holes和shells相关。
<h2>
信用
</h2>
<p>
GIS扩展的最初开发者是Eric Russell.
<p>
GIS 扩展利用了集中开源的软件数据库。版权和许可证信息看
<a href="copyright.html">copyright</a> 。扩展也包括了从<a href=
"http://www.myworldgis.org">My World GIS</a>借用来的元素。
<p>
这份文书和NetLogo模型例子在公共区域。GIS扩展本身时免费、开源的软件。见扩展路径下的
README.md 文件。
<p>
我们期待能够得到您关于如何提高GIS扩展的建议,或者仅仅是您使用它的用途。请将问题或建议贴在
<a href=
"http://groups.yahoo.com/group/netlogo-users/">NetLogo Users
Group</a>,或者直接写信给 Eric Russell和 NetLogo 团队
<a href=
"mailto:ccl-gis@ccl.northwestern.edu">ccl-gis@ccl.northwestern.edu</a>.
<h2>
GIS 原语
</h2>
<h3>
<a name="coordgroup" id="coordgroup">Coordinate System Primitives</a>
</h3>
<p>
<a href="#gis:set-transformation">set-transformation</a> <a href=
"#gis:set-transformation-ds">set-transformation-ds</a> <a href=
"#gis:set-world-envelope">set-world-envelope</a> <a href=
"#gis:set-world-envelope-ds">set-world-envelope-ds</a> <a href=
"#gis:world-envelope">world-envelope</a> <a href=
"#gis:envelope-of">envelope-of</a> <a href=
"#gis:envelope-union-of">envelope-union-of</a> <a href=
"#gis:load-coordinate-system">load-coordinate-system</a> <a href=
"#gis:set-coordinate-system">set-coordinate-system</a>
<h3>
<a name="datagroup" id="datagroup">Dataset Primitives</a>
</h3>
<p>
<a href="#gis:load-dataset">load-dataset</a> <a href=
"#gis:store-dataset">store-dataset</a> <a href=
"#gis:type-of">type-of</a> <a href=
"#gis:patch-dataset">patch-dataset</a> <a href=
"#gis:turtle-dataset">turtle-dataset</a> <a href=
"#gis:link-dataset">link-dataset</a>
<h3>
<a name="vectorgroup" id="vectorgroup">VectorDataset Primitives</a>
</h3>
<p>
<a href="#gis:shape-type-of">shape-type-of</a> <a href=
"#gis:property-names">property-names</a> <a href=
"#gis:feature-list-of">feature-list-of</a> <a href=
"#gis:vertex-lists-of">vertex-lists-of</a> <a href=
"#gis:centroid-of">centroid-of</a> <a href=
"#gis:location-of">location-of</a> <a href=
"#gis:property-value">property-value</a> <a href=
"#gis:find-features">find-features</a> <a href=
"#gis:find-one-feature">find-one-feature</a> <a href=
"#gis:find-less-than">find-less-than</a> <a href=
"#gis:find-greater-than">find-greater-than</a> <a href=
"#gis:find-range">find-range</a> <a href=
"#gis:property-minimum">property-minimum</a> <a href=
"#gis:property-maximum">property-maximum</a> <a href=
"#gis:apply-coverage">apply-coverage</a>
<!-- <a href="#gis:apply-coverages">apply-coverages</a> -->
<a href=
"#gis:coverage-minimum-threshold">coverage-minimum-threshold</a>
<a href=
"#gis:set-coverage-minimum-threshold">set-coverage-minimum-threshold</a>
<a href=
"#gis:coverage-maximum-threshold">coverage-maximum-threshold</a>
<a href=
"#gis:set-coverage-maximum-threshold">set-coverage-maximum-threshold</a>
<a href="#gis:intersects">intersects?</a> <a href=
"#gis:contains">contains?</a> <a href=
"#gis:contained-by">contained-by?</a> <a href=
"#gis:have-relationship">have-relationship?</a> <a href=
"#gis:relationship-of">relationship-of</a>
<h3>
<a name="rastergroup" id="rastergroup">RasterDataset Primitives</a>
</h3>
<p>
<a href="#gis:width-of">width-of</a> <a href=
"#gis:height-of">height-of</a> <a href=
"#gis:raster-value">raster-value</a> <a href=
"#gis:set-raster-value">set-raster-value</a> <a href=
"#gis:minimum-of">minimum-of</a> <a href=
"#gis:maximum-of">maximum-of</a> <a href=
"#gis:sampling-method-of">sampling-method-of</a> <a href=
"#gis:set-sampling-method">set-sampling-method</a> <a href=
"#gis:raster-sample">raster-sample</a> <a href=
"#gis:raster-world-envelope">raster-world-envelope</a> <a href=
"#gis:create-raster">create-raster</a> <a href=
"#gis:resample">resample</a> <a href="#gis:convolve">convolve</a>
<a href="#gis:apply-raster">apply-raster</a>
<h3>
<a name="drawinggroup" id="drawinggroup">Drawing Primitives</a>
</h3>
<p>
<a href="#gis:drawing-color">drawing-color</a> <a href=
"#gis:set-drawing-color">set-drawing-color</a> <a href=
"#gis:draw">draw</a> <a href="#gis:fill">fill</a> <a href=
"#gis:paint">paint</a>
<h2>
<a name="coord" id="coord">Coordinate System Primitives</a>
</h2>
<div class="dict_entry">
<h3>
<a name="gis:set-transformation" id=
"gis:set-transformation">gis:set-transformation</a>
</h3>
<h4>
gis:set-transformation <i>gis-envelope</i> <i>netlogo-envelope</i>
</h4>
<p>
定义了GIS和Netlogo协调之间的映像。
<i>gis-envelope</i>和 <i>netlogo-envelope</i>参数一定要由四部分组成:
<pre>
[minimum-x maximum-x minimum-y maximum-y]
</pre>
<p>
转换的范围必须要和使映像在x的值和y的值范围内的最小必须范围相等。
<p>
例如,以下两个列表会映射所有的地理空间(经度和纬度)到netlogo空间,不管当前netlogo世界的维度:
<pre>
(list -180 180 -90 90)
(list min-pxcor max-pxcor min-pycor max-pycor)
</pre>
<p>
然而,如果你在设定netlogo世界的envelope,你可能要用到下面的
<a href=
"#gis:set-world-envelope">set-world-envelope</a>。
</div>
<div class="dict_entry">
<h3>
<a name="gis:set-transformation-ds" id=
"gis:set-transformation-ds">gis:set-transformation-ds</a>
</h3>
<h4>
gis:set-transformation-ds <i>gis-envelope</i>
<i>netlogo-envelope</i>
</h4>
<p>
除了允许在x值的范围内映像的范围不同于在y值的范围内映像的范围,<a href=
"#gis:set-transformation">set-transformation</a> 和上面的做一样的事情。
最后的"-ds"表示"different scales"。使用不同的范围会导致GIS相撞的扭曲,所以一般不推荐,但是有的模型中它是有用的。
<p>
下面是一个
<a href=
"#gis:set-transformation">set-transformation</a>和<a href=
"#gis:set-transformation-ds">set-transformation-ds</a>不同的例子:
<p>
<a name="transformation-example" id="transformation-example"></a>
<table width="80%" border="1" rules="cols" cellspacing="4"
cellpadding="8" align="center">
<tr>
<td align="center">
<img alt="" src="images/set-transformation.png" width="200">
<td align="center">
<img alt="" src="images/set-transformation-ds.png" width="200">
<tr>
<td align="center">
使用 <a href="#gis:set-transformation">set-transformation</a>,
x和y的范围相同,在Orthographic项目中呈现出的是圆形的地球。
<td align="center">
使用 <a href=
"#gis:set-transformation-ds">set-transformation-ds</a>,x周范围拉伸了,所以在这个方向上地球覆盖了整个netlogo视图,在这个例子中,扭曲了地球的形状。
</table>
</div>
<div class="dict_entry">
<h3>
<a name="gis:set-world-envelope" id=
"gis:set-world-envelope">gis:set-world-envelope</a>
</h3>
<h4>
gis:set-world-envelope <i>gis-envelope</i>
</h4>
<p>
设定映射netlogo世界边界到给定的GIS世界的边界的转换,同时保持x和y轴的范围一样的一种缩写。它和以下的相同:
<pre>
set-transformation <i>gis-envelope</i> (list min-pxcor max-pxcor min-pycor max-pycor)
</pre>
<p>
这条原语设计是因为大多数时间都想设定整个netlogo世界的边界,而不仅仅是一部分。
</div>
<div class="dict_entry">
<h3>
<a name="gis:set-world-envelope-ds" id=
"gis:set-world-envelope-ds">gis:set-world-envelope-ds</a>
</h3>
<h4>
gis:set-world-envelope-ds <i>gis-envelope</i>
</h4>
<p>
设定映射netlogo世界边界到给定的GIS世界的边界的转换,使用x和y轴的范围不一样的一种缩写。它和以下的相同:
<pre>
set-transformation-ds <i>gis-envelope</i> (list min-pxcor max-pxcor min-pycor max-pycor)
</pre>
<p>
看上面的 <a href="#transformation-example">pictures</a>,可以找到使用相同的x,y和不同的x,y范围的差别。
</div>
<div class="dict_entry">
<h3>
<a name="gis:world-envelope" id=
"gis:world-envelope">gis:world-envelope</a>
</h3>
<h4>
gis:world-envelope
</h4>
<p>
返回netlogo世界的envelope(边界矩形),转换为GIS空间。一个envelope包括四个元素:
<pre>
[minimum-x maximum-x minimum-y maximum-y]
</pre>
</div>
<div class="dict_entry">
<h3>
<a name="gis:envelope-of" id="gis:envelope-of">gis:envelope-of</a>
</h3>
<h4>
gis:envelope-of <i>thing</i>
</h4>
<p>
返回GIS坐标中的<i>thing</i>的envelope(边界矩形)。<i>thing</i>可能是一个主题,主体集,栅格数据集或者是矢量数据集。一个envelope包括四个元素:
<pre>
[minimum-x maximum-x minimum-y maximum-y]
</pre>
</div>
<div class="dict_entry">
<h3>
<a name="gis:envelope-union-of" id=
"gis:envelope-union-of">gis:envelope-union-of</a>
</h3>
<h4>
gis:envelope-union-of <i>envelope1</i> <i>envelope2</i>
<br>
(gis:envelope-union-of <i>envelope1</i> ...)
</h4>
<p>
返回包含全部给定envelopes的envelope(边界矩形)。一个envelope包括四个元素:
<pre>
[minimum-x maximum-x minimum-y maximum-y]
</pre>
<p>
对于坐标系统的争议不做假设,尽管他们不再同一个坐标系下,结果可能是不可预知的。
</div>
<div class="dict_entry">
<h3>
<a name="gis:load-coordinate-system" id=
"gis:load-coordinate-system">gis:load-coordinate-system</a>
</h3>
<h4>
gis:load-coordinate-system <i>file</i>
</h4>
<p>
载入一个新的全球映射,来映射或重新映射GIS数据,在其被从文件中导入后。文件必须包含一个可用的
<a href=
"http://geoapi.sourceforge.net/2.0/javadoc/org/opengis/referencing/doc-files/WKT.html">
Well-Known Text (WKT)</a> 投影描述。
<p>
WKT 投影文件经常和GIS数据文件一同出现,而且经常有".prj"的文件扩展名.
<p>
相关的路径必须和当前模型的位置相关,或者如果当前模型还未被保存的话就是用户的主页路径。
<p>
GIS扩展不支持所有的WKT坐标系和项目。只有geographic (<tt>"GEOGCS"</tt>) 和
projected (<tt>"PROJCS"</tt>) 坐标系被支持。对于 projected 坐标系来说,只有
projections 能被支持:
<blockquote>
<table>
<tr>
<td>
Albers_Conic_Equal_Area
<td>
Lambert_Conformal_Conic_2SP
<td>
Polyconic
<tr>
<td>
Lambert_Azimuthal_Equal_Area
<td>
Mercator_1SP
<td>
Robinson
<tr>
<td>
Azimuthal_Equidistant
<td>
Miller
<td>
Stereographic
<tr>
<td>
Cylindrical_Equal_Area
<td>
Oblique_Mercator
<td>
Transverse_Mercator
<tr>
<td>
Equidistant_Conic
<td>
hotine_oblique_mercator
<tr>
<td>
Gnomonic
<td>
Orthographic
</table>
</blockquote>
<p>
见<a href=
"http://remotesensing.org/geotiff/proj_list/">remotesensing.org</a>
。
</div>
<div class="dict_entry">
<h3>
<a name="gis:set-coordinate-system" id=
"gis:set-coordinate-system">gis:set-coordinate-system</a>
</h3>
<h4>
gis:set-coordinate-system <i>system</i>
</h4>
<p>
设定全球映射或者在GIS数据被加载时,重新映射。
<i>system</i> 必须是一个<a href=
"http://geoapi.sourceforge.net/2.0/javadoc/org/opengis/referencing/doc-files/WKT.html">
Well-Known Text (WKT) format</a>里的字符串,或者包含WKT通过将关键字移入相关括号内并在周围加以引用而转换为列表的NetLogo 列表文件。后者更好,因为后者编码可读性更强。
<p>
上述的对WKT的限制也适用于:
<a href=
"#gis:load-coordinate-system">load-coordinate-system</a>
</div>
<h2>
<a name="data" id="data">Dataset Primitives</a>
</h2>
<div class="dict_entry">
<h3>
<a name="gis:load-dataset" id=
"gis:load-dataset">gis:load-dataset</a>
</h3>
<h4>
gis:load-dataset <i>file</i>
</h4>
<p>
载入给定的数据文件,如果必要重新映射,如果一个定义了全球映射而且数据文件自身有关联的.prj文件,则返回结果数据集。
<p>
如果当前没有 ".prj" 文件,那么 <tt>load-dataset</tt>假设载入数据的映射和当前的全球坐标系一样。
<p>
相关的路径必须和当前模型的位置相关,或者如果当前模型还未被保存的话就是用户的主页路径。
<p>
目前,支持这两种数据文件:
<ul>
<li>"<b>.shp</b>" (ESRI shapefile): 包含矢量数据,包括点,线或者多边形。当目标文件是形状文件时, <tt>load-dataset</tt> 返回一个矢量数据集。
<li>"<b>.asc</b>" 或者 "<b>.grd</b>" (ESRI ASCII
grid): 包含栅格数据,包括一网格的值。如果目标文件是一个ASCII网格文件, <tt>load-dataset</tt>
返回一个栅格数据集。
</ul>
</div>
<div class="dict_entry">
<h3>
<a name="gis:store-dataset" id=
"gis:store-dataset">gis:store-dataset</a>
</h3>
<h4>
gis:store-dataset <i>dataset</i> <i>file</i>
</h4>
<p>
在制定的文件中保存给定的数据集。如果文件的名字没有合适的文件扩展,扩展会自动在名字上添加。
相关的路径必须和当前模型的位置相关,或者如果当前模型还未被保存的话就是用户的主页路径。
<p>
目前,这条原语只适用于山歌文件,而且目前只能保存为ESRI ASCII网格文件的数据集。
</div>
<div class="dict_entry">
<h3>
<a name="gis:type-of" id="gis:type-of">gis:type-of</a>
</h3>
<h4>
gis:type-of <i>dataset</i>
</h4>
<p>
返回给定GIS数据集的类型:
"VECTOR" 或者是"RASTER".
</div>
<div class="dict_entry">
<h3>
<a name="gis:patch-dataset" id=
"gis:patch-dataset">gis:patch-dataset</a>
</h3>
<h4>
gis:patch-dataset <i>patch-variable</i>
</h4>
<p>
返回一个新的栅格,栅格的元胞和netlogo的瓦片直接相关,而且元胞的值包括给定的瓦片变量。这条原语基本上是
<a href=
"#gis:apply-raster">apply-raster</a>的反转; <tt>apply-raster</tt>从一个栅格数据集上复制值到瓦片变量上,这条原语将瓦片变量的值复制到栅格数据集中。
</div>
<div class="dict_entry">
<h3>
<a name="gis:turtle-dataset" id=
"gis:turtle-dataset">gis:turtle-dataset</a>
</h3>
<h4>
gis:turtle-dataset <i>turtle-set</i>
</h4>
<p>
返回一个新的,点的矢量数据集,由给定的主题集合的乌龟构成。点分布在乌龟的位置上,利用当前的坐标转换从netlogo空间转换为GIS空间。而且数据集的属性包括所有乌龟的变量。
</div>
<div class="dict_entry">
<h3>
<a name="gis:link-dataset" id=
"gis:link-dataset">gis:link-dataset</a>
</h3>
<h4>
gis:link-dataset <i>link-set</i>
</h4>
<p>
返回一个新的,线的矢量数据集,由给定主题集合的链接组成。每条线的结尾点处在链接的乌龟的位置,利用当前坐标将netlogo空间转换为GIS空间。而且数据集的属性包括所有的连接变量。
</div>
<h2>
<a name="vector" id="vector">VectorDataset Primitives</a>
</h2>
<div class="dict_entry">
<h3>
<a name="gis:shape-type-of" id=
"gis:shape-type-of">gis:shape-type-of</a>
</h3>
<h4>
gis:shape-type-of <i>VectorDataset</i>
</h4>
<p>
返回给定数据集的形状类型。可能的输出值为
"POINT", "LINE", 和
"POLYGON".
</div>
<div class="dict_entry">
<h3>
<a name="gis:property-names" id=
"gis:property-names">gis:property-names</a>
</h3>
<h4>
gis:property-names <i>VectorDataset</i>
</h4>
<p>
返回一个字符串的列表,每个字符串都是给定矢量数据集中一个矢量型的属性的名字,适合于在
<a href=
"#gis:property-value">gis:property-value</a>中使用。
</div>
<div class="dict_entry">
<h3>
<a name="gis:feature-list-of" id=
"gis:feature-list-of">gis:feature-list-of</a>
</h3>
<h4>
gis:feature-list-of <i>VectorDataset</i>
</h4>
<p>
返回一个给定数据集的所有的矢量型的列表。
</div>
<div class="dict_entry">
<h3>
<a name="gis:vertex-lists-of" id=
"gis:vertex-lists-of">gis:vertex-lists-of</a>
</h3>
<h4>
gis:vertex-lists-of <i>VectorFeature</i>
</h4>
<p>
返回一个顶点值的列表的列表。对点数据集来说,每个顶点列表只包含一个顶点值:点的位置。对线数据集来说每个顶点列表包括至少两个点,而且会展示一个多叉线,连接每对列表中的顶点。对多边形数据集来说,每个顶点列表包括最少三个点,展示了一个多边形连接每个顶点,而且第一个和最后一个顶点是相同的。
</div>
<div class="dict_entry">
<h3>
<a name="gis:centroid-of" id="gis:centroid-of">gis:centroid-of</a>
</h3>
<h4>
gis:centroid-of <i>VectorFeature</i>
</h4>
<p>
返回一个单独的顶点,表示给定型的重心(重力的中心)。对点数据集来说,重心就是所有点的平均位置。对线数据集来说,重心就是所有线的中点的平均位置,以线段的长度作为比重。对多边形数据集来说,重心就是所有组成部分的重心的权重平均。
见 <a href=
"http://www.faqs.org/faqs/graphics/algorithms-faq/">this FAQ</a>
。
</div>
<div class="dict_entry">
<h3>
<a name="gis:location-of" id="gis:location-of">gis:location-of</a>
</h3>
<h4>
gis:location-of <i>Vertex</i>
</h4>
<p>
返回一个两个元素的列表,包括利用当前变换的netlogo世界空间给定的顶点x,y的值(按照这个顺序)或者是空的列表,如果给定的顶点在netlogo世界之外。。
</div>
<div class="dict_entry">
<h3>
<a name="gis:property-value" id=
"gis:property-value">gis:property-value</a>
</h3>
<h4>
gis:property-value <i>VectorFeature</i> <i>property-name</i>
</h4>
<p>
返回给定矢量数据集,给定名称的属性的值。返回的值可能是一个数字、字符串或者布尔变量,取决于访问的值域。
<p>
对形状文件来说,从
dBase <tt>CHARACTER</tt> 和
<tt>DATE</tt> 区域来的值都返回字符串,从
<tt>NUMBER</tt> 和<tt>FLOAT</tt> 区域来的值都返回数字,
从<tt>LOGICAL</tt>区域中来的值都返回布尔值。 <tt>MEMO</tt> 区域不支持。 <tt>DATE</tt>得知利用
ISO 8601 格式转换为字符串。
(<tt>YYYY-MM-DD</tt>).
</div>
<div class="dict_entry">
<h3>
<a name="gis:find-features" id=
"gis:find-features">gis:find-features</a>
</h3>
<h4>
gis:find-features <i>VectorDataset</i> <i>property-name</i>
<i>string</i>
</h4>
<p>
返回所有在给定的数据集中, <i>property-name</i>属性的值和给定的字符串匹配的矢量型的列表。
值的比较和例子相关性不大,而且通配符文字
"*"会匹配所有出现的数字(包括0)或文字。
</div>
<div class="dict_entry">
<h3>
<a name="gis:find-one-feature" id=
"gis:find-one-feature">gis:find-one-feature</a>
</h3>
<h4>
gis:find-one-feature <i>VectorDataset</i> <i>property-name</i>
<i>string</i>
</h4>
<p>
返回在数据集中,<i>property-name</i>属性的值和给定的字符串匹配的第一个出现的矢量型。
值的比较和例子相关性不大,而且通配符文字
"*"会匹配所有出现的数字(包括0)或文字。型按照数据集的源数据文件中出现的顺序查找,而且一旦匹配成功就停止查找。如果没有匹配就返回
<tt>nobody</tt> 。
</div>
<div class="dict_entry">
<h3>
<a name="gis:find-less-than" id=
"gis:find-less-than">gis:find-less-than</a>
</h3>
<h4>
gis:find-less-than <i>VectorDataset</i> <i>property-name</i>
<i>value</i>
</h4>
<p>
返回在数据集中,<i>property-name</i>属性的值比给定的<i>value</i>小的所有矢量型。字符串的值利用
在 <a href=
"http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#compareTo(java.lang.String)">
Java Documentation</a>中定义的case-sensitive
lexicographic 规则比较。在数值化的属性中使用字符串或者在字符串化的属性中使用数字都会被认为是错误。
</div>
<div class="dict_entry">
<h3>
<a name="gis:find-greater-than" id=
"gis:find-greater-than">gis:find-greater-than</a>
</h3>
<h4>
gis:find-greater-than <i>VectorDataset</i> <i>property-name</i>
<i>value</i>
</h4>
<p>
返回在数据集中,<i>property-name</i>属性的值比给定的<i>value</i>大的所有矢量型。字符串的值利用
在 <a href=
"http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#compareTo(java.lang.String)">
Java Documentation</a>中定义的case-sensitive
lexicographic 规则比较。在数值化的属性中使用字符串或者在字符串化的属性中使用数字都会被认为是错误。
</div>
<div class="dict_entry">
<h3>
<a name="gis:find-range" id="gis:find-range">gis:find-range</a>
</h3>
<h4>
gis:find-range <i>VectorDataset</i> <i>property-name</i>
<i>minimum-value</i> <i>maximum-value</i>
</h4>
<p>
返回在数据集中,<i>property-name</i>属性的值比给定的<i>minimum-value</i>严格大而比<i>maximum-value</i>严格小的的所有矢量型。字符串的值利用
在 <a href=
"http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#compareTo(java.lang.String)">
Java Documentation</a>中定义的case-sensitive
lexicographic 规则比较。在数值化的属性中使用字符串或者在字符串化的属性中使用数字都会被认为是错误。
</div>
<div class="dict_entry">
<h3>
<a name="gis:property-minimum" id=
"gis:property-minimum">gis:property-minimum</a>
</h3>
<h4>
gis:property-minimum <i>VectorDataset</i> <i>property-name</i>
</h4>
<p>
返回给定数据集中所有矢量型的给定属性中的最小值。
字符串的值利用
在 <a href=
"http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#compareTo(java.lang.String)">
Java Documentation</a>中定义的case-sensitive
lexicographic 规则比较。
</div>
<div class="dict_entry">
<h3>
<a name="gis:property-maximum" id=
"gis:property-maximum">gis:property-maximum</a>
</h3>
<h4>
gis:property-maximum <i>VectorDataset</i> <i>property-name</i>
</h4>
<p>
返回给定数据集中所有矢量型的给定属性中的最大值。
字符串的值利用
在 <a href=
"http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#compareTo(java.lang.String)">
Java Documentation</a>中定义的case-sensitive
lexicographic 规则比较。
</div>
<div class="dict_entry">
<h3>
<a name="gis:apply-coverage" id=
"gis:apply-coverage">gis:apply-coverage</a>
</h3>
<h4>
gis:apply-coverage <i>VectorDataset</i> <i>property-name</i>
<i>patch-variable</i>
</h4>
<p>
从矢量数据集的型中复制给定的属性的值到给定的瓦片变量中。数据集必须要是一个
<tt>多边形</tt> 数据集;点和线的都不支持。
<p>
对每个瓦片来说,它找到所有和瓦片交互的矢量型。那么,如果这个属性是个字符串属性,它通过计算被矢量型覆盖的瓦片总区域的属性有的可能值来计算主要的值。接着,返回代表瓦片区域的最大比例的值。如果属性是个数字型的属性,它计算所有和瓦片交互的矢量型的属性的加权平均值,权重是它们覆盖的瓦片的比例。
<p>
对这种默认的行为有两种期待:
<ul>
<li>
如果瓦片的区域百分比比被一个矢量型覆盖的最大覆盖要大,那么那个矢量型的属性值就直接被复制过来。如果有多于一个矢量型覆盖的区域比开端大,只有第一个被使用。
<li>如果瓦片面积被矢量型覆盖的总百分比少于最少覆盖开端,目标瓦片变量就被设定为不是一个数字。
</ul>
<p>
默认情况下,最小的界限是10%,最大的界限是33%。使用如下四个原语可以修改这些值。
</div><!--
<div class="dict_entry">
<h3>
<a name="gis:apply-coverages" id="gis:apply-coverages">gis:apply-coverages</a>
</h3>
<h4>
gis:apply-coverages <i>VectorDataset</i> <i>property-name-list</i> <i>patch-variable</i>
<br>
(gis:apply-coverages <i>VectorDataset</i> <i>property-name-list</i> <i>patch-variable</i> ...)
</h4>
<p>
THIS PRIMITIVE IS CURRENTLY BROKEN. DON'T USE IT.
</div>
-->
<div class="dict_entry">
<h3>
<a name="gis:coverage-minimum-threshold" id=
"gis:coverage-minimum-threshold">gis:coverage-minimum-threshold</a>
</h3>
<h4>
gis:coverage-minimum-threshold
</h4>
<p>
返回当前覆盖的最小界限,使用
<a href=
"#gis:apply-coverage">gis:apply-coverage</a>.
</div>
<div class="dict_entry">
<h3>
<a name="gis:set-coverage-minimum-threshold" id=
"gis:set-coverage-minimum-threshold">gis:set-coverage-minimum-threshold</a>
</h3>
<h4>
gis:set-coverage-minimum-threshold <i>new-threshold</i>
</h4>
<p>
设定当前覆盖最小界限,使用
S <a href=
"#gis:apply-coverage">gis:apply-coverage</a>.
</div>
<div class="dict_entry">
<h3>
<a name="gis:coverage-maximum-threshold" id=
"gis:coverage-maximum-threshold">gis:coverage-maximum-threshold</a>
</h3>
<h4>
gis:coverage-maximum-threshold
</h4>
<p>
返回当前覆盖最大范围使用
<a href=
"#gis:apply-coverage">gis:apply-coverage</a>.
</div>
<div class="dict_entry">
<h3>
<a name="gis:set-coverage-maximum-threshold" id=
"gis:set-coverage-maximum-threshold">gis:set-coverage-maximum-threshold</a>
</h3>
<h4>
gis:set-coverage-maximum-threshold <i>new-threshold</i>
</h4>
<p>
设定当前覆盖最大范围,使用
<a href=
"#gis:apply-coverage">gis:apply-coverage</a>.
</div>
<div class="dict_entry">
<h3>
<a name="gis:intersects" id="gis:intersects">gis:intersects?</a>
</h3>
<h4>
gis:intersects? <i>x</i> <i>y</i>
</h4>
<p>
如果给定的物体的特殊显示最少共用一个点,就返回true,否则返回false。这些物体的x和y可以是
<ul>
<li>矢量数据集,这样物体的特殊显示就是数据集包括的所有点、线、多边形的集合。
<li>矢量型,这样,物体的特殊显示就被定义为矢量型有的点、线或多边形。
<li>乌龟,这样特殊显示就是一个点。
<li>连接,特殊显示是一条连接两端乌龟之间的线段。
<li>瓦片,特殊显示是长方形的多边形。
<li>主体集合,特殊显示是所有包含主体的显示的集合。
<li>包含所有列出的元素的列表,包括另一个列表。特殊显示是内容的特殊显示的列表。
</ul>
</div>
<div class="dict_entry">
<h3>
<a name="gis:contains" id="gis:contains">gis:contains?</a>
</h3>
<h4>
gis:contains? <i>x</i> <i>y</i>
</h4>
<p>
如果每个<i>y</i>的特殊显示的点都是<i>x</i>的特殊显示的一部分的话返回true。注意,这表示多边形要包含边界。x和y可以是
<ul>
<li>矢量数据集,这样物体的特殊显示就是数据集包括的所有点、线、多边形的集合。
<li>矢量型,这样,物体的特殊显示就被定义为矢量型有的点、线或多边形。
<li>乌龟,这样特殊显示就是一个点。
<li>连接,特殊显示是一条连接两端乌龟之间的线段。
<li>瓦片,特殊显示是长方形的多边形。
<li>主体集合,特殊显示是所有包含主体的显示的集合。
<li>包含所有列出的元素的列表,包括另一个列表。特殊显示是内容的特殊显示的列表。
</ul>
</div>
<div class="dict_entry">
<h3>
<a name="gis:contained-by" id=
"gis:contained-by">gis:contained-by?</a>
</h3>
<h4>
gis:contained-by? <i>x</i> <i>y</i>
</h4>
<p>
如果每个<i>x</i>的特殊显示的点都是<i>y</i>的特殊显示的一部分的话返回true。注意,这表示多边形要包含边界。x和y可以是
<ul>
<li>矢量数据集,这样物体的特殊显示就是数据集包括的所有点、线、多边形的集合。
<li>矢量型,这样,物体的特殊显示就被定义为矢量型有的点、线或多边形。
<li>乌龟,这样特殊显示就是一个点。
<li>连接,特殊显示是一条连接两端乌龟之间的线段。
<li>瓦片,特殊显示是长方形的多边形。
<li>主体集合,特殊显示是所有包含主体的显示的集合。
<li>包含所有列出的元素的列表,包括另一个列表。特殊显示是内容的特殊显示的列表。
</ul>
</div>
<div class="dict_entry">
<h3>
<a name="gis:have-relationship" id=
"gis:have-relationship">gis:have-relationship?</a>
</h3>
<h4>
gis:have-relationship? <i>x</i> <i>y</i> <i>relationship</i>
</h4>
<p>
如果两个物体的特殊显示具有给定的特殊关系的话就返回true,否则返回false。特殊关系有<b>Dimensionally Extended Nine-
Intersection Model (DE-9IM)</b>矩阵定义。这个矩阵包含9个元素,每个都确定了给定两个物体之间的关系。这些元素鼻血有六个可能的值之一:
<ul>
<li>"T",表示空间必须某种程度上有交集
<li>"F",表示空间必须某种程度上没有交集
<li>"0", 表示空间的交集的维度必须为0(也就是说,必须是一个点或者非空的点集)
<li>"1", 表示空间交集的维度必须为1(也就是说必须是线或者非空的线集)
<li>"2", 表示空间交集的维度必须为2(也就是说,必须是多边形或者非空的多边形集合)
<li>"*", 表示两个空间可能有什么关系
</ul>
<p>
例如矩阵:
<table width="50%" border="1" align="center">
<tr>
<td rowspan="2" colspan="2">
<td colspan="3" align="center">
x
<tr>
<td align="center">
Interior
<td align="center">
Boundary
<td align="center">
Exterior
<tr>
<td rowspan="3" align="center">
y
<td>
Interior
<td align="center">
T
<td align="center">
*
<td align="center">
*
<tr>
<td>
Boundary
<td align="center">
*
<td align="center">
*
<td align="center">
*
<tr>
<td>
Exterior
<td align="center">
F
<td align="center">
F
<td align="center">
*
</table>
<p>
当且仅当物体<i>x</i>的内部的一部分在物体<i>y</i>的内部,而且没有<i>x</i>的内部或者边界与<i>y</i>的外部有交集就返回true。这是一个更加约束的<tt>contains?</tt>原语的形式;而且其中,多边形不包括边界。
<p>
矩阵作为一个字符串被给
<tt>have-relationship?</tt>,它的元素按照下列方式给出:
<table width="25%" border="1" align="center">
<tr>
<td align="center">
1
<td align="center">
2
<td align="center">
3
<tr>
<td align="center">
4
<td align="center">
5
<td align="center">
6
<tr>
<td align="center">
7
<td align="center">
8
<td align="center">
9
</table>
<p>
如果你要使用上述的矩阵,你需要写:
S
<pre>
gis:have-relationship? x y "T*****FF*"
</pre>
<p>
一个更加详细规范的对DE-9IM矩阵的描述和相关的点集理论可以见
<a href=
"http://www.opengeospatial.org/standards/sfs">OpenGIS Simple
Features Specification for SQL</a>.
<p>
物体 x 和 y 可以是:
<ul>
<li>矢量数据集,这样物体的特殊显示就是数据集包括的所有点、线、多边形的集合。
<li>矢量型,这样,物体的特殊显示就被定义为矢量型有的点、线或多边形。
<li>乌龟,这样特殊显示就是一个点。
<li>连接,特殊显示是一条连接两端乌龟之间的线段。
<li>瓦片,特殊显示是长方形的多边形。
<li>主体集合,特殊显示是所有包含主体的显示的集合。
<li>包含所有列出的元素的列表,包括另一个列表。特殊显示是内容的特殊显示的列表。
</ul>
</div>
<div class="dict_entry">
<h3>
<a name="gis:relationship-of" id=
"gis:relationship-of">gis:relationship-of</a>
</h3>
<h4>
gis:relationship-of <i>x</i> <i>y</i>