Commit 516fc858 authored by Thomas Graichen's avatar Thomas Graichen

Update ZHV scheme xml and generated classes

- also refactor class names
parent 16a5f80d
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ZHV_Converter" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<configuration default="false" name="ZhvConverter" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="ZHV-Tools" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/zhv_parser/ZHV_Converter.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/zhv_parser/ZhvConverter.py" />
<option name="PARAMETERS" value="../data/examples_zhv/example_multiple_stations.xml" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......
......@@ -180,35 +180,35 @@
</Area>
</Items>
</AreaQuay>
</StopPlace>
<StopPlace>
<Name>
</StopPlace>
<StopPlace>
<Name>
<Name>Chemnitz, Rosenbergstr</Name>
</Name>
<Location>
</Name>
<Location>
<Latitude>50.817779</Latitude>
<Longitude>12.929326</Longitude>
</Location>
<Condition>
</Location>
<Condition>
<ConditionKind>Served</ConditionKind>
</Condition>
<State>
</Condition>
<State>
<StateKind>InOrder</StateKind>
</State>
<DHID>de:14511:30222</DHID>
<Authority>
</State>
<DHID>de:14511:30222</DHID>
<Authority>
<AuthorityId>13</AuthorityId>
<Label>VVO</Label>
</Authority>
<Municipality>
</Authority>
<Municipality>
<MunicipalityCode>14511000</MunicipalityCode>
<Label>Chemnitz</Label>
</Municipality>
<District>
</Municipality>
<District>
<DistrictCode />
<Name />
</District>
<AreaQuay>
</District>
<AreaQuay>
<Items>
<Area>
<Name>
......@@ -359,9 +359,9 @@
</Quays>
</Area>
</Items>
</AreaQuay>
</StopPlace>
<StopPlace>
</AreaQuay>
</StopPlace>
<StopPlace>
<Name>
<Name>Beckedorf (Schaumb.), Robert-Koch-Str.</Name>
</Name>
......@@ -439,8 +439,8 @@
</Area>
</Items>
</AreaQuay>
</StopPlace>
<StopPlace>
</StopPlace>
<StopPlace>
<Name>
<Name>Dresden Fährstelle Ostragehege</Name>
</Name>
......@@ -519,5 +519,62 @@
</Items>
</AreaQuay>
</StopPlace>
</Items>
<StopPlace>
<Name>
<Name>S Neuenhagen</Name>
</Name>
<Location>
<Latitude>52.520674</Latitude>
<Longitude>13.699994</Longitude>
</Location>
<Condition>
<ConditionKind>Served</ConditionKind>
</Condition>
<DHID>de:12064:900320007</DHID>
<Authority>
<AuthorityId>3</AuthorityId>
<Label>VBB</Label>
</Authority>
<Municipality>
<MunicipalityCode>12064336</MunicipalityCode>
<Label>Neuenhagen bei Berlin</Label>
</Municipality>
<District>
<DistrictCode />
<Name />
</District>
<AreaQuay>
<Items>
<Area>
<Name>
<Name>S-Bahnsteig Gleis 1</Name>
</Name>
<Location>
<Latitude>52.52079</Latitude>
<Longitude>13.70045</Longitude>
</Location>
<Condition>
<ConditionKind>Served</ConditionKind>
</Condition>
<DHID>de:12064:900320007:1</DHID>
<Quays>
<Quay>
<Name>
<Name>S-Bahnsteig Gleis 1</Name>
</Name>
<Location>
<Latitude>52.52078</Latitude>
<Longitude>13.700395</Longitude>
</Location>
<Condition>
<ConditionKind>Served</ConditionKind>
</Condition>
<DHID>de:12064:900320007:1:50</DHID>
</Quay>
</Quays>
</Area>
</Items>
</AreaQuay>
</StopPlace>
</Items>
</GetResponseType>
none
1
1.474579E+01 5.158172E+01
1.474310E+01 5.157898E+01
1.472602E+01 5.156452E+01
1.474243E+01 5.154070E+01
1.474795E+01 5.153143E+01
1.474915E+01 5.153130E+01
1.485274E+01 5.150766E+01
1.491869E+01 5.149319E+01
1.495094E+01 5.148427E+01
1.496053E+01 5.147519E+01
1.498033E+01 5.143681E+01
1.498885E+01 5.139591E+01
1.498939E+01 5.137327E+01
1.499250E+01 5.134461E+01
1.500064E+01 5.133931E+01
1.500214E+01 5.133212E+01
1.504596E+01 5.129975E+01
1.505078E+01 5.123583E+01
1.502117E+01 5.120425E+01
1.501598E+01 5.117244E+01
1.499701E+01 5.110608E+01
1.497836E+01 5.106176E+01
1.490178E+01 5.093087E+01
1.484115E+01 5.088907E+01
1.483560E+01 5.088562E+01
1.483398E+01 5.087891E+01
1.481370E+01 5.082151E+01
1.478332E+01 5.081622E+01
1.471107E+01 5.081844E+01
1.470760E+01 5.083119E+01
1.468303E+01 5.083499E+01
1.460047E+01 5.085431E+01
1.459936E+01 5.085471E+01
1.463789E+01 5.091833E+01
1.464210E+01 5.092208E+01
1.457823E+01 5.090779E+01
1.455977E+01 5.090399E+01
1.455210E+01 5.093715E+01
1.457589E+01 5.095659E+01
1.458175E+01 5.097275E+01
1.458596E+01 5.097749E+01
1.458393E+01 5.097879E+01
1.458498E+01 5.098168E+01
1.455514E+01 5.100025E+01
1.454361E+01 5.099937E+01
1.452797E+01 5.100026E+01
1.452345E+01 5.100191E+01
1.452540E+01 5.101210E+01
1.449272E+01 5.101310E+01
1.446218E+01 5.102423E+01
1.445095E+01 5.102080E+01
1.441029E+01 5.101006E+01
1.434728E+01 5.102991E+01
1.431407E+01 5.104243E+01
1.427493E+01 5.099271E+01
1.429657E+01 5.099276E+01
1.432594E+01 5.098959E+01
1.432994E+01 5.098415E+01
1.433452E+01 5.097208E+01
1.432227E+01 5.096816E+01
1.433140E+01 5.095376E+01
1.440874E+01 5.093953E+01
1.441492E+01 5.093769E+01
1.439726E+01 5.088617E+01
1.424942E+01 5.087153E+01
1.423982E+01 5.085493E+01
1.418893E+01 5.083773E+01
1.408357E+01 5.080550E+01
1.405581E+01 5.079981E+01
1.397948E+01 5.079781E+01
1.395918E+01 5.077999E+01
1.395684E+01 5.077951E+01
1.390768E+01 5.077487E+01
1.391193E+01 5.074351E+01
1.384519E+01 5.071483E+01
1.382394E+01 5.071432E+01
1.375672E+01 5.072195E+01
1.368628E+01 5.071126E+01
1.366279E+01 5.072012E+01
1.362166E+01 5.070791E+01
1.356285E+01 5.070578E+01
1.355523E+01 5.070187E+01
1.355071E+01 5.070156E+01
1.355089E+01 5.069964E+01
1.354660E+01 5.069744E+01
1.355152E+01 5.069289E+01
1.355403E+01 5.066593E+01
1.355387E+01 5.066474E+01
1.353104E+01 5.065342E+01
1.353370E+01 5.063757E+01
1.353063E+01 5.063353E+01
1.351868E+01 5.062639E+01
1.350249E+01 5.062322E+01
1.348289E+01 5.060501E+01
1.346554E+01 5.059464E+01
1.340331E+01 5.061242E+01
1.339414E+01 5.063167E+01
1.337352E+01 5.061695E+01
1.335195E+01 5.060633E+01
1.333414E+01 5.059850E+01
1.333600E+01 5.057887E+01
1.329556E+01 5.057054E+01
1.328221E+01 5.056818E+01
1.328128E+01 5.056973E+01
1.327580E+01 5.058134E+01
1.327446E+01 5.058109E+01
1.327341E+01 5.058283E+01
1.325251E+01 5.058203E+01
1.325027E+01 5.057659E+01
1.324740E+01 5.057606E+01
1.323286E+01 5.053889E+01
1.319893E+01 5.049486E+01
1.318832E+01 5.049478E+01
1.311708E+01 5.049812E+01
1.308787E+01 5.049407E+01
1.304347E+01 5.049376E+01
1.304247E+01 5.048779E+01
1.304098E+01 5.048758E+01
1.303075E+01 5.044381E+01
1.298826E+01 5.041597E+01
1.296878E+01 5.040711E+01
1.294442E+01 5.039928E+01
1.287835E+01 5.042749E+01
1.283353E+01 5.044527E+01
1.282147E+01 5.043339E+01
1.281163E+01 5.042646E+01
1.280311E+01 5.042681E+01
1.278987E+01 5.043735E+01
1.278810E+01 5.043899E+01
1.278788E+01 5.043893E+01
1.278656E+01 5.043998E+01
1.278081E+01 5.043705E+01
1.274678E+01 5.042799E+01
1.271770E+01 5.040624E+01
1.271242E+01 5.039525E+01
1.269854E+01 5.039409E+01
1.267133E+01 5.040722E+01
1.255870E+01 5.039114E+01
1.251684E+01 5.038957E+01
1.251439E+01 5.038383E+01
1.249940E+01 5.037166E+01
1.249848E+01 5.034654E+01
1.249806E+01 5.034556E+01
1.246687E+01 5.034338E+01
1.245052E+01 5.033642E+01
1.244639E+01 5.032220E+01
1.240879E+01 5.031439E+01
1.241315E+01 5.029536E+01
1.240428E+01 5.028818E+01
1.239947E+01 5.028526E+01
1.239880E+01 5.028437E+01
1.238392E+01 5.028256E+01
1.236268E+01 5.025619E+01
1.236448E+01 5.023848E+01
1.234218E+01 5.023388E+01
1.234339E+01 5.021733E+01
1.234320E+01 5.018955E+01
1.233281E+01 5.016750E+01
1.228694E+01 5.017165E+01
1.226865E+01 5.019606E+01
1.227119E+01 5.022284E+01
1.223236E+01 5.024537E+01
1.223705E+01 5.026372E+01
1.219353E+01 5.027036E+01
1.217399E+01 5.031796E+01
1.215266E+01 5.031426E+01
1.210021E+01 5.031351E+01
1.207804E+01 5.032785E+01
1.204409E+01 5.032051E+01
1.199071E+01 5.034409E+01
1.197265E+01 5.034479E+01
1.196362E+01 5.035492E+01
1.197374E+01 5.038478E+01
1.194829E+01 5.039054E+01
1.191599E+01 5.042107E+01
1.192091E+01 5.043275E+01
1.189518E+01 5.043467E+01
1.188026E+01 5.044627E+01
1.190107E+01 5.045969E+01
1.193966E+01 5.047380E+01
1.192625E+01 5.051542E+01
1.188300E+01 5.051559E+01
1.186685E+01 5.054517E+01
1.188848E+01 5.056187E+01
1.192297E+01 5.056387E+01
1.192707E+01 5.059411E+01
1.195663E+01 5.061340E+01
1.197935E+01 5.063181E+01
1.201959E+01 5.064526E+01
1.204094E+01 5.062998E+01
1.202671E+01 5.061783E+01
1.205354E+01 5.060341E+01
1.204669E+01 5.058238E+01
1.203547E+01 5.057421E+01
1.204368E+01 5.056309E+01
1.207940E+01 5.056961E+01
1.207968E+01 5.058595E+01
1.211362E+01 5.059133E+01
1.212402E+01 5.058021E+01
1.214674E+01 5.059411E+01
1.215222E+01 5.061774E+01
1.214346E+01 5.063267E+01
1.215961E+01 5.064031E+01
1.219930E+01 5.064031E+01
1.220450E+01 5.065090E+01
1.222859E+01 5.065142E+01
1.223625E+01 5.064500E+01
1.226527E+01 5.064795E+01
1.228744E+01 5.066149E+01
1.231783E+01 5.067658E+01
1.231591E+01 5.068647E+01
1.227239E+01 5.069271E+01
1.223105E+01 5.074912E+01
1.223489E+01 5.077509E+01
1.225733E+01 5.079949E+01
1.224666E+01 5.081575E+01
1.225186E+01 5.082820E+01
1.231646E+01 5.084376E+01
1.238339E+01 5.086536E+01
1.244525E+01 5.086882E+01
1.248768E+01 5.090301E+01
1.254037E+01 5.091734E+01
1.263262E+01 5.091906E+01
1.263070E+01 5.095236E+01
1.261893E+01 5.098623E+01
1.258800E+01 5.098347E+01
1.252258E+01 5.100208E+01
1.250273E+01 5.106070E+01
1.236053E+01 5.107308E+01
1.235683E+01 5.109363E+01
1.228700E+01 5.108745E+01
1.222345E+01 5.110402E+01
1.219814E+01 5.114369E+01
1.220054E+01 5.117775E+01
1.217680E+01 5.117941E+01
1.217704E+01 5.120015E+01
1.219481E+01 5.121526E+01
1.219149E+01 5.125154E+01
1.216717E+01 5.126081E+01
1.216562E+01 5.128516E+01
1.213566E+01 5.131993E+01
1.218231E+01 5.133899E+01
1.217347E+01 5.141243E+01
1.218165E+01 5.142524E+01
1.215820E+01 5.143388E+01
1.215169E+01 5.146561E+01
1.217732E+01 5.147514E+01
1.217861E+01 5.148577E+01
1.220660E+01 5.149042E+01
1.221007E+01 5.149656E+01
1.219024E+01 5.150243E+01
1.219397E+01 5.152778E+01
1.221358E+01 5.154336E+01
1.223773E+01 5.155343E+01
1.223439E+01 5.156070E+01
1.224787E+01 5.157147E+01
1.230704E+01 5.156962E+01
1.235352E+01 5.159285E+01
1.242657E+01 5.158896E+01
1.242722E+01 5.160568E+01
1.245182E+01 5.161287E+01
1.256073E+01 5.161412E+01
1.259047E+01 5.162977E+01
1.263535E+01 5.163243E+01
1.264997E+01 5.162523E+01
1.267039E+01 5.163571E+01
1.269232E+01 5.166379E+01
1.275282E+01 5.166238E+01
1.278131E+01 5.165019E+01
1.279366E+01 5.166582E+01
1.284030E+01 5.168380E+01
1.286702E+01 5.168380E+01
1.291113E+01 5.166707E+01
1.291340E+01 5.165269E+01
1.297743E+01 5.165566E+01
1.297315E+01 5.166958E+01
1.303567E+01 5.166879E+01
1.303995E+01 5.164315E+01
1.306428E+01 5.165378E+01
1.310940E+01 5.161576E+01
1.313663E+01 5.162327E+01
1.317784E+01 5.160292E+01
1.321112E+01 5.155906E+01
1.323646E+01 5.152292E+01
1.322889E+01 5.144616E+01
1.323759E+01 5.140497E+01
1.328876E+01 5.140529E+01
1.328675E+01 5.141551E+01
1.333313E+01 5.144569E+01
1.337952E+01 5.144333E+01
1.341809E+01 5.146077E+01
1.343611E+01 5.145409E+01
1.349334E+01 5.142706E+01
1.354375E+01 5.140883E+01
1.355409E+01 5.139058E+01
1.361182E+01 5.139373E+01
1.362201E+01 5.137784E+01
1.367102E+01 5.137784E+01
1.368681E+01 5.138340E+01
1.374675E+01 5.137202E+01
1.375445E+01 5.136773E+01
1.376336E+01 5.137733E+01
1.381155E+01 5.137683E+01
1.384800E+01 5.138997E+01
1.393953E+01 5.139199E+01
1.396909E+01 5.140311E+01
1.399339E+01 5.140261E+01
1.399258E+01 5.138214E+01
1.400473E+01 5.137936E+01
1.400513E+01 5.139199E+01
1.401404E+01 5.140412E+01
1.404847E+01 5.142307E+01
1.405029E+01 5.144314E+01
1.406851E+01 5.144995E+01
1.404341E+01 5.148174E+01
1.410942E+01 5.150696E+01
1.411124E+01 5.152611E+01
1.415012E+01 5.154929E+01
1.422302E+01 5.154475E+01
1.428822E+01 5.153493E+01
1.434046E+01 5.152183E+01
1.439271E+01 5.154249E+01
1.445143E+01 5.154576E+01
1.445105E+01 5.155649E+01
1.450044E+01 5.155775E+01
1.454378E+01 5.155900E+01
1.454428E+01 5.156809E+01
1.456545E+01 5.157560E+01
1.458813E+01 5.157592E+01
1.460879E+01 5.156621E+01
1.460829E+01 5.155367E+01
1.462038E+01 5.155336E+01
1.462340E+01 5.155806E+01
1.466826E+01 5.155837E+01
1.467934E+01 5.158469E+01
1.467373E+01 5.160647E+01
1.470801E+01 5.160582E+01
1.474579E+01 5.158172E+01
END
END
......@@ -8,9 +8,9 @@
</xs:complexType>
<xs:element name="Items">
<xs:complexType>
<xs:choice>
<xs:element ref="ns1:StopPlace"/>
<xs:element ref="ns1:Area"/>
<xs:choice minOccurs="0">
<xs:element maxOccurs="unbounded" ref="ns1:StopPlace"/>
<xs:element maxOccurs="unbounded" ref="ns1:Area"/>
</xs:choice>
</xs:complexType>
</xs:element>
......@@ -20,6 +20,7 @@
<xs:element ref="ns1:Name"/>
<xs:element ref="ns1:Location"/>
<xs:element ref="ns1:Condition"/>
<xs:element minOccurs="0" ref="ns1:State"/>
<xs:element ref="ns1:DHID"/>
<xs:element ref="ns1:Authority"/>
<xs:element ref="ns1:Municipality"/>
......@@ -54,9 +55,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DistrictCode">
<xs:complexType/>
</xs:element>
<xs:element name="DistrictCode" type="xs:string"/>
<xs:element name="AreaQuay" type="ns1:Items"/>
<xs:element name="Area">
<xs:complexType>
......@@ -64,6 +63,10 @@
<xs:element ref="ns1:Name"/>
<xs:element ref="ns1:Location"/>
<xs:element ref="ns1:Condition"/>
<xs:choice minOccurs="0">
<xs:element ref="ns1:Description"/>
<xs:element ref="ns1:State"/>
</xs:choice>
<xs:element ref="ns1:DHID"/>
<xs:element ref="ns1:Quays"/>
</xs:sequence>
......@@ -72,7 +75,7 @@
<xs:element name="Quays">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns1:Quay"/>
<xs:element maxOccurs="unbounded" ref="ns1:Quay"/>
</xs:sequence>
</xs:complexType>
</xs:element>
......@@ -82,6 +85,10 @@
<xs:element ref="ns1:Name"/>
<xs:element ref="ns1:Location"/>
<xs:element ref="ns1:Condition"/>
<xs:choice minOccurs="0">
<xs:element ref="ns1:Description"/>
<xs:element ref="ns1:State"/>
</xs:choice>
<xs:element ref="ns1:DHID"/>
</xs:sequence>
</xs:complexType>
......@@ -111,6 +118,21 @@
</xs:complexType>
</xs:element>
<xs:element name="ConditionKind" type="xs:NCName"/>
<xs:element name="State">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns1:StateKind"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="StateKind" type="xs:NCName"/>
<xs:element name="DHID" type="xs:NMTOKEN"/>
<xs:element name="Label" type="xs:string"/>
<xs:element name="Description">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:Description"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
......@@ -3,7 +3,7 @@ from enum import Enum
# This is representing the first two digits of Germany's "Amtlicher Gemeindeschlüssel":
# https://www.destatis.de/DE/Themen/Laender-Regionen/Regionales/Gemeindeverzeichnis/Glossar/amtlicher-gemeindeschluessel.html
from zhv_parser.ZHV_Classes import StopPlace
from zhv_parser.ZhvClasses import StopPlace
class RegionCode(Enum):
......
......@@ -11,9 +11,9 @@ from osmium.osm import Location
from osmium.osm._osm import RelationMember
from osmium.osm.mutable import Relation, Node
from zhv_parser import ZHV_Classes
from zhv_parser import ZhvClasses
from zhv_parser.RegionCode import RegionCode
from zhv_parser.ZHV_Classes import StopPlace, Area, Quay, Name
from zhv_parser.ZhvClasses import StopPlace, Area, Quay, Name
# ZHV related XML tags, elements
namespace: str = "{http://zhv.xml.wvi/}"
......@@ -103,7 +103,7 @@ class ZhvConverter:
tag=(tag_stop_place, tag_area, tag_quay))
for action, elem in context:
if elem.tag == tag_stop_place and action == event_start:
stop_place_class = ZHV_Classes.StopPlace
stop_place_class = ZhvClasses.StopPlace
stop_place = stop_place_class.factory()
stop_place.build(elem)
if not self.is_stop_place_in_region(RegionCode.SACHSEN, stop_place):
......@@ -137,7 +137,7 @@ class ZhvConverter:
list_stop_signs = list()
for action, elem in context:
if elem.tag == tag_area and action == event_start:
area_class = ZHV_Classes.Area
area_class = ZhvClasses.Area
area = area_class.factory()
area.build(elem)
list_stop_signs += self.area_to_osm(area, context)
......@@ -170,7 +170,7 @@ class ZhvConverter:
for action, elem in context:
if elem.tag == tag_quay and action == event_start:
quay_class = ZHV_Classes.Quay
quay_class = ZhvClasses.Quay
quay = quay_class.factory()
quay.build(elem)
list_nodes.append(self.quay_to_osm(quay, stop_sign_type, context))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment