KML Data

KML Feeds Introduction

Maprosoft allows data to be provided in the form of KML feeds. All the features identified by a single KML feed will be associated with a single Maprosoft feature type. Since each Maprosoft feature types relates to a single shape type (e.g point, polygon, etc), Maprosoft will ignore placemarks in the KML that have a shape that is inconsistent with its associated feature type.

Each <placemark> within a KML feed will result in the creation of a Maprosoft feature.

Microformats within KML Feeds

There are various ways to utilise the power of Maprosoft microformats in KML feeds. Refer to the Microformats page for details about the microformats supported by Maprosoft.

Microformats within Schema Data

The KML format allows the addition of typed data using the <Schema> and <SchemaData> elements. For more information, refer to https://developers.google.com/kml/documentation/extendeddata. If Maprosoft detects a <SimpleData> element with the name attribute matching a Maprosoft microformat name, the content within the element will be parsed as the corresponding microformat.


<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
	<Document>
		<Folder>
			<name>My Data</name>
			<Schema name="MyData" id="MyData">
				<SimpleField name="address" type="string"></SimpleField>
			</Schema>
			<Placemark>
				<name>Some Feature Name</name>
				<ExtendedData>
					<SchemaData schemaUrl="#MyData">
						<SimpleData name="address">
							<streetNum>
								7777
							</streetNum>
							<streetName>
								Harris Street
							</streetName>
							<suburbName>
								Ultimo
							</suburbName>
							<postcode>
								2007
							</postcode>
						</SimpleData>
					</SchemaData>
				</ExtendedData>
				<Polygon>
					etc
				</Polygon>
			</Placemark>
		</Folder>
	</Document>
</kml>

	

Microformats within Name/Value pairs

The KML format allows the addition of untyped data using the <Data> element. For more information, refer to https://developers.google.com/kml/documentation/extendeddata. If Maprosoft detects a <Data> element with the name attribute matching a Maprosoft microformat name, the content within the element will be parsed as the corresponding microformat.


<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
	<Document>
		<Folder>
			<name>My Data</name>
			<Placemark>
				<name>Some Feature Name</name>
				<ExtendedData>
					<Data name="contactDetails">
						<value>
							<department>
								General Enquiries
							</department>
							<phoneNum>
								02 9999 8888
							</phoneNum>
							<faxNum>
								02 9999 7777
							</faxNum>
							<email>
								someone@some-team.com
							</email>
							<website>
								http://www.some-team.com
							</website>
						</value>
					</Data>
					<Data name="address">
						<value>
							<streetNum>
								7777
							</streetNum>
							<streetName>
								Harris Street
							</streetName>
							<suburbName>
								Ultimo
							</suburbName>
							<postcode>
								2007
							</postcode>
						</value>
					</Data>
				</ExtendedData>
				<Polygon>
					etc
				</Polygon>
			</Placemark>
		</Folder>
	</Document>
</kml>

	

Microformats within Placemark Descriptions

Maprosoft will attempt to interpret the <description> section of each <placemark> as Maprosoft metadata. Any Maprosoft meta data that belongs with <feature> elements are allowed within KML <description> elements. See the following example KML:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<kml	xmlns="http://www.opengis.net/kml/2.2" 
	xmlns:ns2="http://www.w3.org/2005/Atom" 
	xmlns:ns3="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" 
	xmlns:ns4="http://www.google.com/kml/ext/2.2">
	<Document>
		<name>Library Information for Maprosoft</name>
		<open>true</open>
		<!--
		Styles are currently ignored by Maprosoft.
		-->
		<Style id="exampleStyleDocument">
			<IconStyle>
				<Icon>
					<href>POSTAL</href>
				</Icon>
			</IconStyle>
			<LabelStyle>
				<color>ff0000cc</color>
				<scale>0.0</scale>
			</LabelStyle>
		</Style>
		<Placemark>
			<name>Library Without Description</name>
			<styleUrl>#exampleStyleDocument</styleUrl>
			<Point>
				<altitudeMode>clampToGround</altitudeMode>
				<coordinates>151.2,-33.9</coordinates>
			</Point>
		</Placemark>
		<Placemark>
			<name>Glebe Library</name>
			<description>
				<![CDATA[
		  			<h1>Glebe Library</h1>
		  			<p>
		  				Any HTML here will be displayed 
		  				by Maprosoft in a popup window when 
		  				the feature is clicked on.
		  			</p>
				]]>
			</description>
			<styleUrl>#exampleStyleDocument</styleUrl>
			<Point>
				<altitudeMode>clampToGround</altitudeMode>
				<coordinates>151.2,-33.88</coordinates>
			</Point>
		</Placemark>
		<Placemark>
			<name>Ultimo Library</name>
			<description>
				<title>
					<text>Ultimo Library</text>
				</title>
				<openHours>
					<openHoursPeriod>
						<day>MONDAY</day>
						<startHour>9</startHour>
						<endHour>19</endHour>
						<startMinute>30</startMinute>
						<endMinute>0</endMinute>
					</openHoursPeriod>
					<openHoursPeriod>
						<day>TUESDAY</day>
						<startHour>9</startHour>
						<endHour>21</endHour>
						<startMinute>0</startMinute>
						<endMinute>30</endMinute>
					</openHoursPeriod>
					<openHoursPeriod>
						<day>WEDNESDAY</day>
						<startHour>8</startHour>
						<endHour>17</endHour>
						<startMinute>30</startMinute>
						<endMinute>30</endMinute>
					</openHoursPeriod>
					<openHoursPeriod>
						<day>THURSDAY</day>
						<startHour>9</startHour>
						<endHour>17</endHour>
						<startMinute>0</startMinute>
						<endMinute>0</endMinute>
					</openHoursPeriod>
					<openHoursPeriod>
						<day>FRIDAY</day>
						<startHour>10</startHour>
						<endHour>21</endHour>
						<startMinute>0</startMinute>
						<endMinute>30</endMinute>
					</openHoursPeriod>
					<openHoursPeriod>
						<day>SATURDAY</day>
						<startHour>9</startHour>
						<endHour>17</endHour>
						<startMinute>0</startMinute>
						<endMinute>30</endMinute>
					</openHoursPeriod>
					<openHoursPeriod>
						<day>SUNDAY</day>
						<startHour>9</startHour>
						<endHour>17</endHour>
						<startMinute>30</startMinute>
						<endMinute>30</endMinute>
					</openHoursPeriod>
				</openHours>
				<address>
					<streetNum>Level 1, Ultimo Community Centre, 40</streetNum>
					<streetName>William Henry Street</streetName>
					<suburbName>Ultimo</suburbName>
					<postcode>2007</postcode>
				</address>
				<contactDetails>
					<phoneNum>02 9298 3110</phoneNum>
					<faxNum>02 9660 9457</faxNum>
					<email>library@cityofsydney.nsw.gov.au</email>
					<website/>
				</contactDetails>
			</description>
			<styleUrl>#exampleStyleDocument</styleUrl>
			<Point>
				<altitudeMode>clampToGround</altitudeMode>
				<coordinates>151.2,-33.87</coordinates>
			</Point>
		</Placemark>
	</Document>
</kml>

	

The last placemark in the KML example above will result in a popup window similar to that at the top of this page.