Skip to content

Instantly share code, notes, and snippets.

@Rohit-554
Last active March 10, 2024 07:58
Show Gist options
  • Select an option

  • Save Rohit-554/2e7b455c90a8586a3136c16b4c818189 to your computer and use it in GitHub Desktop.

Select an option

Save Rohit-554/2e7b455c90a8586a3136c16b4c818189 to your computer and use it in GitHub Desktop.
//pin
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>PointKML</name>
<Placemark>
<name>Point</name>
<Style>
<IconStyle>
<scale>1</scale>
</IconStyle>
</Style>
<Point>
<altitudeMode>absolute</altitudeMode>
<coordinates>-122.364657,37.824787,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
//pathboundary
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>CylindricalPath</name>
<Style id="pathStyle">
<LineStyle>
<color>ff0000ff</color> <!-- Blue color for the line -->
<width>2</width>
</LineStyle>
<PolyStyle>
<color>7f00ff00</color> <!-- Green color for the extruded area -->
</PolyStyle>
</Style>
<Placemark>
<name>Cylindrical Path</name>
<styleUrl>#pathStyle</styleUrl>
<Polygon>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-122.0822035425683,37.42228990140251,0
-122.0817634361024,37.42228990140251,0
-122.081241783965,37.42228990140251,0
-122.0807342516814,37.42228990140251,0
-122.0800737743589,37.42228990140251,0
-122.0792307122774,37.42228990140251,0
-122.078346244249,37.42228990140251,0
-122.0775235458336,37.42228990140251,0
-122.0765646795579,37.42228990140251,0
-122.0756517899874,37.42228990140251,0
-122.0822035425683,37.42228990140251,0 <!-- Close the loop -->
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
//pin
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>PointKML</name>
<Placemark>
<name>Point</name>
<Style>
<IconStyle>
<scale>1</scale>
</IconStyle>
</Style>
<Point>
<altitudeMode>absolute</altitudeMode>
<coordinates>-122.364657,37.824787,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Folder>
<name>Ground Overlays</name>
<description>Examples of ground overlays</description>
<GroundOverlay>
<name>Large-scale overlay on terrain</name>
<description>Overlay shows Mount Etna erupting
on July 13th, 2001.</description>
<Icon>
<href>https://cdn.pixabay.com/photo/2023/04/17/19/27/plum-blossom-7933169_1280.jpg</href>
</Icon>
<LatLonBox>
<north>37.91904192681665</north>
<south>37.46543388598137</south>
<east>15.35832653742206</east>
<west>14.60128369746704</west>
<rotation>-0.1556640799496235</rotation>
</LatLonBox>
</GroundOverlay>
</Folder>
</kml>
//hollow box
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>PolygonStyle.kml</name>
<open>1</open>
<Style id="examplePolyStyle">
<PolyStyle>
<color>ff0000cc</color>
<colorMode>random</colorMode>
</PolyStyle>
</Style>
<Placemark>
<name>hollow box</name>
<styleUrl>#examplePolyStyle</styleUrl>
<Polygon>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-122.3662784465226,37.81884427772081,30
-122.3652480684771,37.81926777010555,30
-122.365640222455,37.81986126286519,30
-122.36666937925,37.81942987753481,30
-122.3662784465226,37.81884427772081,30
</coordinates>
</LinearRing>
</outerBoundaryIs>
<innerBoundaryIs>
<LinearRing>
<coordinates>
-122.366212593918,37.81897719083808,30
-122.3654241733188,37.81929450992014,30
-122.3657048517827,37.81973175302663,30
-122.3664882465854,37.81940249291773,30
-122.366212593918,37.81897719083808,30
</coordinates>
</LinearRing>
</innerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
/rightangle3dtriangle
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>LinearRing.kml</name>
<Polygon>
<altitudeMode>relativeToGround</altitudeMode>
<extrude>1</extrude>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-122.365662,37.826988,10
-122.365202,37.826302,100
-122.364581,37.82655,100
-122.365038,37.827237,10
-122.365662,37.826988,10
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</kml>
//extruded region
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>West Bengal Boundary</name>
<Style>
<PolyStyle>
<color>ff0000ff</color> <!-- Red color -->
</PolyStyle>
</Style>
<Polygon>
<altitudeMode>relativeToGround</altitudeMode>
<extrude>1</extrude>
<outerBoundaryIs>
<LinearRing>
<coordinates>
87.605,25.837,0
88.631,26.326,0
88.425,26.861,0
88.991,26.878,0
88.951,27.078,0
89.636,26.731,0
89.749,26.295,0
88.967,25.927,0
88.987,25.259,0
88.127,25.157,0
87.534,24.313,0
88.210,24.245,0
88.201,24.010,0
87.865,23.624,0
87.628,23.625,0
87.032,22.973,0
86.241,22.846,0
85.827,22.081,0
86.366,21.580,0
86.068,21.290,0
85.314,21.551,0
85.316,20.647,0
85.564,20.388,0
85.375,19.996,0
84.673,19.964,0
84.801,19.446,0
85.321,18.964,0
85.910,19.016,0
86.354,19.369,0
87.033,18.997,0
87.035,19.454,0
88.091,20.091,0
88.887,21.000,0
89.031,21.630,0
89.417,21.950,0
89.730,22.038,0
89.847,21.853,0
90.019,21.936,0
91.687,23.630,0
91.829,23.629,0
92.019,23.714,0
92.376,23.396,0
92.082,22.798,0
91.906,23.629,0
91.094,22.158,0
90.272,22.055,0
89.861,21.669,0
89.643,21.050,0
89.086,21.220,0
88.522,21.790,0
88.177,22.138,0
87.778,22.284,0
87.414,22.579,0
87.342,22.852,0
87.197,22.866,0
86.951,23.622,0
86.582,23.625,0
86.179,24.044,0
85.678,24.429,0
85.735,25.149,0
85.433,25.577,0
84.979,25.732,0
84.734,26.390,0
85.071,26.667,0
86.025,26.600,0
87.104,26.347,0
87.281,26.527,0
88.061,26.366,0
87.605,25.837,0
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</kml>
// 3d construction shape
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>LinearRing.kml</name>
<Polygon>
<altitudeMode>relativeToGround</altitudeMode>
<extrude>1</extrude>
<outerBoundaryIs>
<LinearRing>
<coordinates>
0.0,0.0,5000
0.5,0.0,10000
1.0,0.0,5000
1.0,0.5,10000
1.0,1.0,5000
0.5,1.0,10000
0.0,1.0,5000
0.0,0.5,10000
0.0,0.0,5000
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</kml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment