﻿<xs:schema xmlns="http://nemus.skogsstyrelsen.se/scheman/avverkningDataTypes/1"
           elementFormDefault="qualified"
           targetNamespace="http://nemus.skogsstyrelsen.se/scheman/avverkningDataTypes/1"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:dt="http://nemus.skogsstyrelsen.se/scheman/dataTypes/2" >

  <xs:import namespace="http://nemus.skogsstyrelsen.se/scheman/dataTypes/2" schemaLocation="dataTypes_2.xsd" />

  <!-- Common complex geometry types-->

  <!-- Hansyn types -->
  

  <xs:complexType name="hansynArterType">
    <xs:sequence>
      <xs:annotation>
        <xs:documentation>Endast POINT, MULTIPOINT, POLYGON eller MULTIPOLYGON är tillåtet.</xs:documentation>
      </xs:annotation>
      <xs:element name="beskrivning" type="dt:notEmptyString" />
      <xs:element name="geometri" type="dt:wktType"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="hansynskravandeBiotopType">

		
        <xs:sequence>
					<!-- Example if validation on beskrivning is needed in the schema. Otherwise remove choice-element and second sequence. -->
					<!--<xs:choice>
						
						<xs:sequence>-->
							<xs:annotation>
								<xs:documentation>
									Endast POLYGON eller MULTIPOLYGON är tillåtet.
								</xs:documentation>
								<xs:documentation>
									Vid val av typen annat är beskrivning obligatoriskt enligt regel
								</xs:documentation>
							</xs:annotation>
							<xs:element name="typ">
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:enumeration value="blockmark" />
										<xs:enumeration value="brandfalt" />
										<xs:enumeration value="brant" />
										<xs:enumeration value="hagmark" />
										<xs:enumeration value="hallmark" />
										<xs:enumeration value="kalla" />
										<xs:enumeration value="myrholme" />
										<xs:enumeration value="naturskog" />
										<xs:enumeration value="omradeLangsVattendrag" />
										<xs:enumeration value="ravin" />
										<xs:enumeration value="smavatten" />
										<xs:enumeration value="sumpskog" />
										<xs:enumeration value="strandskog" />
										<xs:enumeration value="aldreSkogPaUddeOBryn" />
										<xs:enumeration value="annat" />
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="beskrivning" type="dt:notEmptyString" minOccurs="0" />
					
          
          <xs:element name="geometri" type="dt:wktType"/>
        </xs:sequence>

  </xs:complexType>

  <xs:complexType name="hansynForhindraSkadorPaLandOchVattenType">
    <xs:sequence>
      <xs:element name="typ">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="forhindraKorskador" />
            <xs:enumeration value="forhindraLackage" />
            <xs:enumeration value="forhindraSkadaPaStigar" />
            <xs:enumeration value="forhindraSkadaVidOverfarter" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="beskrivning" type="dt:notEmptyString" minOccurs="0" />
      <xs:element name="geometri" type="dt:wktType" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>


  <xs:complexType name="hansynKulturMiljoType">

        <xs:sequence>
          <xs:annotation>
            <xs:documentation>
              Endast POINT, MULTIPOINT, POLYGON eller MULTIPOLYGON är tillåtet för: kolningsplats/tjärframställningsplats, husgrund, industriell lämning, lämning efter äldre tiders renskötsel, röse
            </xs:documentation>
            <xs:documentation>
              Endast POLYGON, MULTIPOLYGON, LINE och MULTILINE är tållåtet för: stenmur, äldre färdväg
            </xs:documentation>
            <xs:documentation>
              Typen annat kräver beskrivning enligt regel.
            </xs:documentation>
          </xs:annotation>
          <xs:element name="typ">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="kolningsplatsTjarframtagningsplats" />
                <xs:enumeration value="husgrund" />
                <xs:enumeration value="industriellLamning" />
                <xs:enumeration value="lamningEfterAldreTidersRenskotsel" />
                <xs:enumeration value="rose" />
                <xs:enumeration value="stenmur" />
                <xs:enumeration value="aldreFardvag" />
								<xs:enumeration value="annat" />
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="beskrivning" type="dt:notEmptyString" minOccurs="0" />
          <xs:element name="geometri" type="dt:wktType" />
        </xs:sequence>

  </xs:complexType>

  <xs:complexType name="hansynRenType">

        <xs:sequence>
          <xs:element name="typ">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="anpassaHyggesstorlek" />
                <xs:enumeration value="ejKoncentreraHyggen" />
                <xs:enumeration value="markberedaSkonsamt" />
                <xs:enumeration value="sparaKantzoner" />
                <xs:enumeration value="sparaTradMedHanglav" />
                <xs:enumeration value="vinteravverka" />
								<xs:enumeration value="annanAtgard" />
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="beskrivning" type="dt:notEmptyString" minOccurs="0" />
          <xs:element name="geometri" type="dt:wktType" minOccurs="0" />
        </xs:sequence>

  </xs:complexType>


  <xs:complexType name="hansynRenanordningarType">
    <xs:sequence>
      <xs:annotation>
        <xs:documentation> Endast POINT, MULTIPOINT, POLYGON, MULTIPOLYGON, LINE eller MULTILINE är tillåtet.</xs:documentation>
      </xs:annotation>
      <xs:element name="typ">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="arbetshage" />
            <xs:enumeration value="beteshage" />
            <xs:enumeration value="flyttled" />
            <xs:enumeration value="hanglavskog" />
            <xs:enumeration value="kalvningsland" />
            <xs:enumeration value="passage" />
            <xs:enumeration value="rastbete" />
            <xs:enumeration value="uppsamlingsomrade" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="beskrivning" type="dt:notEmptyString" minOccurs="0" />
      <xs:element name="geometri" type="dt:wktType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="hansynSkyddszonType">
    <xs:sequence>
      <xs:annotation>
        <xs:documentation>Endast POLYGON eller MULTIPOLYGON är tillåtet.</xs:documentation>
      </xs:annotation>
      <xs:element name="typ">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="bebyggelse" />
            <xs:enumeration value="impediment" />
            <xs:enumeration value="jordbruksmark" />
            <xs:enumeration value="kulturmiljo" />
            <xs:enumeration value="vatten" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="beskrivning" type="dt:notEmptyString" minOccurs="0" />
      <xs:element name="geometri" type="dt:wktType" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="hansynTradType">
    <xs:sequence>
      <xs:annotation>
        <xs:documentation>Endast POINT, MULTIPOINT, POLYGON eller MULTIPOLYGON är tillåtet.</xs:documentation>
      </xs:annotation>
      <xs:element name="typ">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="andraTrad" />
            <xs:enumeration value="barandeTrad" />
            <xs:enumeration value="dodaTrad" />
            <xs:enumeration value="haltradBotrad" />
            <xs:enumeration value="hasselRonnSalg" />
            <xs:enumeration value="lindLonnAskAlm" />
            <xs:enumeration value="naturligaHogstubbar" />
            <xs:enumeration value="ovanligaTradarter" />
            <xs:enumeration value="tillskapadeHogstubbar" />
            <xs:enumeration value="tradMedBrandspar" />
            <xs:enumeration value="tradMedKulturspar" />
            <xs:enumeration value="tradsamling" />
            <xs:enumeration value="vardtrad" />
            <xs:enumeration value="aldreBarrtrad" />
            <xs:enumeration value="aldreLovtrad" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="beskrivning" type="dt:notEmptyString" minOccurs="0" />
      <xs:element name="geometri" type="dt:wktType" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:group name="hansynGroup">
    <xs:choice>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="rodlistadeArterEllerAndraSarskiltSkyddsvardaArter" type="hansynArterType" />
        <xs:element name="hansynskravandeBiotoper" type="hansynskravandeBiotopType" >
          <xs:annotation>
            <xs:documentation>Endast POLYGON eller MULTIPOLYGON är tillåtet. Typen annat kräver beskrivning enligt regel.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="kulturlamningarKulturmiljoer" type="hansynKulturMiljoType" />
        <xs:element name="skyddszoner" type="hansynSkyddszonType" />
        <xs:element name="trad" type="hansynTradType" />
        <xs:element name="forhindraSkadorPaMarkOchVatten" type="hansynForhindraSkadorPaLandOchVattenType" />
      </xs:choice>
      <xs:element name="ingenHansynPlanerad" type="dt:notEmptyString" >
        <xs:annotation>
          <xs:documentation>Beskriv varför ingen hänsyn planeras att tas.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:choice>
  </xs:group>
  <xs:group name="hansynRenGroup">
    <xs:choice>
      <xs:sequence>
        <xs:element name="renanordningar" type="hansynRenanordningarType" minOccurs="0" maxOccurs="unbounded" >
          <xs:annotation>
            <xs:documentation>Ange vilka områden och anordningar som finns inom eller angränsande avverkningsområdet.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="rennaringen" type="hansynRenType" maxOccurs="unbounded" >
          <xs:annotation>
            <xs:documentation>Ange planerad hänsyn till rennäringen. Typen annanAtgard kräver beskrivning enligt regel.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
      <xs:element name="ingenRenHansynPlanerad" type="dt:notEmptyString" >
        <xs:annotation>
          <xs:documentation>Beskriv varför ingen hänsyn planeras att tas.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:choice>
  </xs:group>

  <!-- Harvest types -->
  <xs:complexType name="anvandningAvFrammandeTradartType">
    <xs:sequence>
      <xs:element name="planeradAreal" type="dt:haType" />
      <xs:element name="tradart" type="frammandeTradartType" />
    </xs:sequence>
  </xs:complexType>
  

  <xs:complexType name="omlaggningType">

        <xs:sequence>
          <xs:element name="andamal" type="andamalType">
            <xs:annotation>
              <xs:documentation>Typen ovrigt kräver beskrivning enligt regel.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="beskrivning" type="dt:notEmptyString" minOccurs="0" />
          <xs:element name="arDaOmlaggningenPlaneras" type="dt:yearType" />
        
      </xs:sequence>

  </xs:complexType>


  <xs:group name="bevaraUtvecklaEllerEllerForsoksverksamhetGroup">
    <xs:sequence>
      <xs:element name="bevaraUtvecklaEllerForsoksverksamhet" type="bevaraUtvecklarEllerForsoksverksamhetTypType" />
      <xs:element name="planeradAvverkning" type="dt:haType" />
      <xs:element name="beskrivning" type="dt:notEmptyString" >
        <xs:annotation>
          <xs:documentation>Beskriv syftet och hur åtgärden planeras att utföras.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="avlagg" type="dt:wktType" minOccurs="0" maxOccurs="unbounded">
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="markberedningGroup">
    <xs:sequence>
      <xs:element name="ha" type="dt:haType" />
      <xs:element name="markberedningsmetod" type="markberedningsmetodType" minOccurs="0" />
    </xs:sequence>
  </xs:group>

  <xs:simpleType name="adellovTradartType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="alm" />
      <xs:enumeration value="ask" />
      <xs:enumeration value="avenbok" />
      <xs:enumeration value="bok" />
      <xs:enumeration value="ek" />
      <xs:enumeration value="fagelbar" />
      <xs:enumeration value="lind" />
      <xs:enumeration value="lonn" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="allTradartType">
    <xs:union memberTypes="standardTradartType adellovTradartType frammandeTradartType" />
  </xs:simpleType>
  <xs:simpleType name="andamalType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="annanVag" />
      <xs:enumeration value="betesmark" />
      <xs:enumeration value="skogsbilvag" />
      <xs:enumeration value="tomtmark" />
      <xs:enumeration value="aker" />
			<xs:enumeration value="ovrigt" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="bevaraUtvecklarEllerForsoksverksamhetTypType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="bevaraOchUtvecklaNaturOchKulturmiljovarden" />
      <xs:enumeration value="forsoksverksamhet" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="frammandeTradartType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="contorta" />
      <xs:enumeration value="douglasgran" />
      <xs:enumeration value="europeiskLark" />
      <xs:enumeration value="hemlock" />
      <xs:enumeration value="hybridasp" />
      <xs:enumeration value="hybridlark" />
      <xs:enumeration value="poppel" />
      <xs:enumeration value="rodek" />
      <xs:enumeration value="silvergran" />
      <xs:enumeration value="sitkagran" />
      <xs:enumeration value="svartgran" />
      <xs:enumeration value="svarttall" />
      <xs:enumeration value="sykomorlonn" />
      <xs:enumeration value="tuja" />
      <xs:enumeration value="weymouthtall" />
      <xs:enumeration value="ovrigUtlandskGran" />
      <xs:enumeration value="ovrigUtlandskTall" />
      <xs:enumeration value="ovrigtUtlandsktBarrtrad" />
      <xs:enumeration value="ovrigtUtlandsktLovtrad" />
      <xs:enumeration value="ovrigAdelgran" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="standardOchAdellovTradartType">
    <xs:union memberTypes="standardTradartType adellovTradartType" />
  </xs:simpleType>
  <xs:simpleType name="standardOchFrammandeTradartType">
    <xs:union memberTypes="standardTradartType frammandeTradartType" />
  </xs:simpleType>
  <xs:simpleType name="standardTradartType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="al" />
      <xs:enumeration value="asp" />
      <xs:enumeration value="bjork" />
      <xs:enumeration value="gran" />
      <xs:enumeration value="sibiriskLark" />
      <xs:enumeration value="tall" />
      <xs:enumeration value="ovrigtLov" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Volontary types-->
  <xs:complexType name="ovrigtType">
    <xs:annotation>
      <xs:documentation>Frivilliga kompletterande uppgifter</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="skogsvardsavtalFinns" type="xs:boolean" minOccurs="0">
        <xs:annotation>
          <xs:documentation>Det finns avtal om föryngringsåtgärder mellan skogsägaren och virkesköpande eller annat företag.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="avverkningsplaneringsmiljo" minOccurs="0" >
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="iFaltPaBarmark" />
            <xs:enumeration value="iFaltPaSno" />
            <xs:enumeration value="viaBildmaterial" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="ovrigaUpplysningar" type="dt:notEmptyString" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="markberedningsmetodType">
    <xs:annotation>
      <xs:documentation>Markberedningsmetod</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="annan" />
      <xs:enumeration value="branning" />
      <xs:enumeration value="flack" />
      <xs:enumeration value="fras" />
      <xs:enumeration value="harv" />
      <xs:enumeration value="hog" />
      <xs:enumeration value="invers" />
      <xs:enumeration value="langflack" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Attachment types -->
  <xs:complexType name="bilagaMedSamebyType">
    <xs:sequence>
      <xs:element name="typ" type="bilagaMedSamebyTypType" />
      <xs:group ref="dt:bilagaGroup"/>
    </xs:sequence>
  </xs:complexType>
	
  <xs:complexType name="bilagaType">
    <xs:sequence>
      <xs:element name="typ" type="bilagaTypType" />
      <xs:group ref="dt:bilagaGroup"/>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="bilagaMedSamebyTypType">
    <xs:union memberTypes="bilagaTypType">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="kallelseSamradSameby" />
          <xs:enumeration value="samradsprotokollSameby" />
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
	
  <xs:simpleType name="bilagaTypType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="overlatelsehandling" />
	  <xs:enumeration value="ovrigtDokument" />		
	  <xs:enumeration value="analysprotokoll" />
	  <xs:enumeration value="fotodokumentation" />
	  <xs:enumeration value="hansynsredovisning" />
	  <xs:enumeration value="fullmakt" />
	  <xs:enumeration value="karta" />
	  <xs:enumeration value="traktdirektiv" />
	  <xs:enumeration value="tillstandnatura2000" />
	  <xs:enumeration value="naturvardesbedomning" />
	  <xs:enumeration value="inventeringsprotokoll" />
	  <xs:enumeration value="beslutannanmyndighet" />
	  <xs:enumeration value="svarpakommunikation" />
	</xs:restriction>
  </xs:simpleType>

	<!-- Dispenser -->
	<xs:complexType name="dispensType">
		<xs:sequence>
			<xs:element name="motivDispensTidpunktPaborjaAvverkning" type="dt:notEmptyStringMax2000" minOccurs="0" >
				<xs:annotation>
					<xs:documentation>Ange motiv till dispens för tid till att påbörja avverkning.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="motivOvrigaDispenser" type="dt:notEmptyStringMax2000" minOccurs="0" >
				<xs:annotation>
					<xs:documentation>Ange motiv till övriga dispenser.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
</xs:schema>