How to create a KML file on the basis of a given polygon?

How to create a KML file on the basis of a given polygon?

The function is used to create and write a KML file on the basis of a given Polygons object (a list of Polygon objects of SpatialPolygonsDataFrame class) for the usage in Google Earth and Google Maps. if not NULL the name as character string of the kml file to be written to working directory as “NAME.kml”

How is the KML format used in Google Earth?

KML is a file format used to display geographic data in an Earth browser such as Google Earth. KML uses a tag-based structure with nested elements and attributes and is based on the XML standard. All tags are case-sensitive and must appear exactly as they are listed in the KML Reference. The Reference indicates which tags are optional.

What happens if kmlfile is NOT NULL in KML?

If kmlfile is not NULL the result will be written into that file. If kmlfile is NULL the generated KML lines will be returned (see also value). The conversion can also handle polygons which are marked as holes inside of the Polygons object if these holes are listed right after that polygon in which these holes appear.

How does KML write the latitude and longitude?

kmlwritepolygon (filename,latitude,longitude) writes the geographic latitude and longitude data that define polygon vertices to the file specified by filename in Keyhole Markup Language (KML) format. kmlwritepolygon creates a KML Placemark element for each polygon.

How can I convert a shapefile to KML format?

To open the conversion tool window, double-click Layer To KML for an individual shapefile, or double-click Map To KML for compressed KML files. Under the Layer drop-down box, select the desired shapefile, or drag and drop the desired shapefile into the box. Note : The tool converts the shapefile to KMZ format, which is a compressed version

How can I convert GIS data to KML?

After performing this conversion, you can use the geographic data from your KML in the same ways you would any other GIS data: edit, analyze, and map it. Use the Layer To KML tool to convert any map layer to KML. KML created by this tool will be a snapshot of your data at the time the layer was converted.