<?xml version="1.0" encoding="UTF-8"?>
<!--  Delft FEWS Published Interface (Copyright 2003 WL | Delft Hydraulics) -->
<schema xmlns:fews="http://www.wldelft.nl/fews/PI" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.wldelft.nl/fews/PI" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
	<include schemaLocation="pi_sharedtypes.xsd"/>
	<element name="Locations" type="fews:LocationsComplexType">
		<annotation>
			<documentation>Time series location data files identify points at which specific times series exist.
                The point is represented by X, Y and Z coordinates. Each location element of a time
                series location file corresponds to a time series data file and consist of four elements.</documentation>
		</annotation>
	</element>
	<complexType name="LocationsComplexType">
		<annotation>
			<documentation>Time series location data files identify points at which specific times series exist.
                The point is represented by X, Y and Z coordinates. Each location element of a time
                series location file corresponds to a time series data file and consist of four elements.</documentation>
		</annotation>
		<sequence>
			<element name="geoDatum" type="fews:GeoDatumStringType" default="LOCAL"/>
			<element name="location" type="fews:LocationComplexType" minOccurs="0" maxOccurs="unbounded"/>
		</sequence>
		<attribute name="version" type="fews:versionString" use="optional" default="1.9"/>
	</complexType>
	<complexType name="LocationComplexType">
		<sequence>
            <element name="description" type="string" minOccurs="0">
                <annotation>
                    <documentation>Long (descriptive) name of location (tool tip) or description</documentation>
                </annotation>
            </element>
            <element name="shortName" type="string" minOccurs="0">
                <annotation>
                    <documentation>Short name of location for chart legend</documentation>
                </annotation>
            </element>
			<element name="startDateTime" type="fews:nonEmptyStringType" minOccurs="0">
				<annotation>
					<documentation>Available since 2019.02.</documentation>
				</annotation>
			</element>
			<element name="endDateTime" type="fews:nonEmptyStringType" minOccurs="0">
				<annotation>
					<documentation>Available since 2019.02.</documentation>
				</annotation>
			</element>
            <element name="lat" type="double" minOccurs="0">
				<annotation>
					<documentation>Latitude of station</documentation>
				</annotation>
			</element>
			<element name="lon" type="double" minOccurs="0">
				<annotation>
					<documentation>Longitude of station</documentation>
				</annotation>
			</element>
			<element name="x" type="double" minOccurs="0">
				<annotation>
					<documentation>X coordinate of station</documentation>
				</annotation>
			</element>
			<element name="y" type="double" minOccurs="0">
				<annotation>
					<documentation>Y coordinate of station</documentation>
				</annotation>
			</element>
			<element name="z" type="double" minOccurs="0">
				<annotation>
					<documentation>Z coordinate of station</documentation>
				</annotation>
			</element>
			<element name="parentLocationId" type="fews:idString" minOccurs="0">
				<annotation>
					<documentation>Since 2015.01. Location Id of parent location</documentation>
				</annotation>
			</element>
			<group ref="fews:LocationRelationSequence" minOccurs="0">
				<annotation>
					<documentation>Available since 2019.02</documentation>
				</annotation>
			</group>
			<group ref="fews:AttributesSequence" minOccurs="0">
				<annotation>
					<documentation>Since 2017.02. Location attributes</documentation>
				</annotation>
			</group>
		</sequence>
        <attribute name="locationId" type="fews:idString" use="required"/>
	</complexType>

	<group name="LocationRelationSequence">
		<sequence>
			<element name="relation" type="fews:LocationRelationComplexType" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>Available since 2019.02</documentation>
				</annotation>
			</element>
		</sequence>
	</group>
	<complexType name="LocationRelationComplexType">
		<annotation>
			<documentation>Available since 2019.02</documentation>
		</annotation>
		<sequence>
			<element name="relatedLocationId" type="fews:idString"/>
			<element name="startDateTime" type="fews:nonEmptyStringType" minOccurs="0">
				<annotation>
					<documentation>Describes where and why this attribute is used</documentation>
				</annotation>
			</element>
			<element name="endDateTime" type="fews:nonEmptyStringType" minOccurs="0">
				<annotation>
					<documentation>Describes where and why this attribute is used</documentation>
				</annotation>
			</element>
		</sequence>
		<attribute name="id" type="fews:idString"/>
	</complexType>
</schema>
