forked from gwaldron/osgearth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeature_model_scatter.earth
84 lines (72 loc) · 2.93 KB
/
feature_model_scatter.earth
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
<!--
osgEarth Sample
Model Scattering using the "feature_geom" driver.
For each polygon in the feature geometry, scatter model instances within
that polygon as a specific density (instances/sqkm). Scattered placement
is randomized, but it is randomized exactly the same way each time.
-->
<map name="Demo: Model Scattering">
<OGRFeatures name="trees-data">
<url>../data/parks.shp</url>
<build_spatial_index>true</build_spatial_index>
</OGRFeatures>
<FeatureModel name="trees" enabled="true">
<!-- Feature Layer to read the data from -->
<features> trees-data </features>
<!-- The stylesheet will describe how to render the feature data. In this case
we indicate model substitution with density-based scattering. The "density"
units are instances-per-sqkm. -->
<layout>
<crop_features>true</crop_features>
<level max_range="25000" style="park-polygons"/>
<level max_range="7000" style="parks-1"/>
<level max_range="3000" style="parks-2"/>
<level max_range="1000" style="parks-3"/>
</layout>
<styles>
<style type="text/css">
park-polygons {
fill: #00ff007f;
altitude-clamping: terrain-drape;
}
parks {
model: "../data/tree.osg";
model-placement: random;
altitude-clamping: terrain;
altitude-resolution: 0.001;
render-transparent: true;
render-min-alpha: 0.15;
}
parks-1 : parks {
model-density: 1000;
model-scale: 2.0;
model-random-seed: 0;
}
parks-2 : parks {
model-density: 2500;
model-scale: 2.5;
model-random-seed: 1;
}
parks-3 : parks {
model-density: 5000;
model-scale: 2.25;
model-random-seed: 2;
}
</style>
</styles>
</FeatureModel>
<xi:include href="readymap_imagery.xml"/>
<xi:include href="readymap_elevation.xml"/>
<Viewpoints home="0">
<viewpoint name="DC Overview">
<heading>-3.69224e-08</heading>
<pitch>-89.9</pitch>
<range>22073.3m</range>
<long>-77.02170005868915</long>
<lat>38.90150049600116</lat>
<height>-12.07075788639486</height>
<srs>+proj=longlat +datum=WGS84 +no_defs </srs>
</viewpoint>
<viewpoint name="DC close up" heading="-13.48" lat="38.911" long="-77.051" pitch="-10.1" range="2711"/>
</Viewpoints>
</map>