私の質問は非常に簡単です。Google Earth のポリゴンを、色の代わりに画像ファイル (bmp、jpeg、gif など) で塗りつぶすことはできますか?
ありがとうございました!
私の質問は非常に簡単です。Google Earth のポリゴンを、色の代わりに画像ファイル (bmp、jpeg、gif など) で塗りつぶすことはできますか?
ありがとうございました!
私は同じ問題を抱えており、Pablo Reyes が提案したモデル ソリューションが最適であることがわかりました。グラウンド オーバーレイの問題は、画像がプレート カレ投影であることを期待していることです。画像が正投影である場合、非アフィン変換<gx:LatLonQuad>
を適用するため、画像を歪ませて補正しようとします。さらに、 の高度座標はいずれにせよ無視されるため、地球が一定の高度を維持しながら画像が湾曲します。<gx:LatLonQuad>
Pablo Reyes が提供する KML サンプルは優れています。SketchUp を必要としない場合、平面の model.dae ファイルは次のようになります。
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<unit meter="1" name="meter" />
<up_axis>Z_UP</up_axis>
</asset>
<library_visual_scenes>
<visual_scene id="ID1">
<node>
<instance_geometry url="#ID2">
<bind_material>
<technique_common>
<instance_material symbol="Material2" target="#ID3">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" />
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</visual_scene>
</library_visual_scenes>
<library_geometries>
<geometry id="ID2">
<mesh>
<source id="ID8">
<float_array id="ID12" count="24">500.0 500.0 0 -500.0 -500.0 0 -500.0 500.0 0 500.0 -500.0 0 500.0 -500.0 0 500.0 500.0 0 -500.0 -500.0 0 -500.0 500.0 0</float_array>
<technique_common>
<accessor count="8" source="#ID12" stride="3">
<param name="X" type="float" />
<param name="Y" type="float" />
<param name="Z" type="float" />
</accessor>
</technique_common>
</source>
<source id="ID9">
<float_array id="ID13" count="24">0 0 -1 0 0 -1 0 0 -1 0 0 -1 -0 -0 1 -0 -0 1 -0 -0 1 -0 -0 1</float_array>
<technique_common>
<accessor count="8" source="#ID13" stride="3">
<param name="X" type="float" />
<param name="Y" type="float" />
<param name="Z" type="float" />
</accessor>
</technique_common>
</source>
<source id="ID11">
<float_array id="ID14" count="8">1 1 0 0 0 1 1 0</float_array>
<technique_common>
<accessor count="4" source="#ID14" stride="2">
<param name="S" type="float" />
<param name="T" type="float" />
</accessor>
</technique_common>
</source>
<vertices id="ID10">
<input semantic="POSITION" source="#ID8" />
<input semantic="NORMAL" source="#ID9" />
</vertices>
<triangles count="4" material="Material2">
<input offset="0" semantic="VERTEX" source="#ID10" />
<input offset="1" semantic="TEXCOORD" source="#ID11" />
<p>0 0 1 1 2 2 1 1 0 0 3 3 4 3 5 0 6 1 7 2 6 1 5 0</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_materials>
<material id="ID3" name="MaterialName">
<instance_effect url="#ID4" />
</material>
</library_materials>
<library_effects>
<effect id="ID4">
<profile_COMMON>
<newparam sid="ID6">
<surface type="2D">
<init_from>ID5</init_from>
</surface>
</newparam>
<newparam sid="ID7">
<sampler2D>
<source>ID6</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<lambert>
<diffuse>
<texture texture="ID7" texcoord="UVSET0" />
</diffuse>
<transparent opaque="RGB_ZERO">
<color>0.3 0.3 0.3 1</color>
</transparent>
<transparency>
<float>1</float>
</transparency>
</lambert>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_images>
<image id="ID5">
<init_from>images/2Dimage.png</init_from>
</image>
</library_images>
<scene>
<instance_visual_scene url="#ID1" />
</scene>
平面は 1000 メートル四方で、モデル座標系の原点が中心にあります。これは次のように定義されています。
<float_array id="ID12" count="24">500.0 500.0 0 -500.0 -500.0 0 -500.0 500.0 0 500.0 -500.0 0 500.0 -500.0 0 500.0 500.0 0 -500.0 -500.0 0 -500.0 500.0 0</float_array>
画像は平面の端から端まで適用されます。画像が正方形でない場合は、それに応じて平面の寸法を変更する必要があります。<Scale>
プレーンは、および<Orientation>
KML 設定を使用して、GE でサイズ変更および回転できます。また、画像の不透明度は次のように設定されます。
<color>0.3 0.3 0.3 1</color>
これにより、サイズ、場所、方向が異なる複数の画像で同じモデル ファイルを使用できます (すべての画像が同じ形状 (この場合は正方形) である限り)。また、中心の地球に接する正投影を適切にレンダリングします。
ポリゴンを画像で塗りつぶすことはできませんが、Ground Overlay (別名 Image Overlay) を使用できます。
通常のグラウンド オーバーレイでは、回転可能な正方形の境界のみが許可されます。
<kml xmlns="http://www.opengis.net/kml/2.2">
<GroundOverlay>
<name>GroundOverlay.kml</name>
<Icon>
<href>http://www.google.com/intl/en/images/logo.gif</href>
</Icon>
<LatLonBox>
<north>37.83234</north>
<south>37.832122</south>
<east>-122.373033</east>
<west>-122.373724</west>
<rotation>45</rotation>
</LatLonBox>
</GroundOverlay>
</kml>
ただし、イメージ オーバーレイを完全に制御したい場合は、Google Earth 拡張機能を使用できます<gx:LatLonQuad>
。LatLonQuad は、北、南、東、西の境界を定義する 2 点だけではなく、オーバーレイ エリアを定義する四角形の 4 つの頂点の座標を指定します。
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<GroundOverlay>
<name>Quad Image Overlay</name>
<Icon>
<href>http://www.google.com/intl/en/images/logo.gif</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<gx:LatLonQuad>
<coordinates>
31.13309787341621,29.97820855337135,0 31.13521972695729,29.97822570382352,0 31.13414174103354,29.97910121868758,0 31.13378951869572,29.97910728214542,0
</coordinates>
</gx:LatLonQuad>
</GroundOverlay>
</kml>
参考文献: