Einführung
Anhang 1 der VGWR definiert die Berechtigungsstufe der einzelnen zugänglichen Informationen (Gebäude, Wohnung, Projekt). Daten der Stufe A sind öffentlich und können ohne Einschränkung verwendet werden. Eine Quellenangabe ist Pflicht (Autor, Titel und Link zum Datensatz).
Daten herunterladen
Wichtigste Punkte
- Die Daten haben immer den Stand Ende des Vortages;
- Der Download erfolgt durch eine Zip-Datei, welche mehrere Dateien enthält;
- Die Dateien sind zeilenorientiert, wie man das von *.csv/*.dsv Dateien her kennt;
- Der Download enthält eine Dokumentation aller Felder.
Datei Format
- Extension *.csv/*.dsv
- Tab-separiert;
- Mit Header;
- UTF-8 ;
- Kein BOM (Indicateur d'ordre des octets)
- Keine Hochkommas zur Markierung (kein Textqualifizierer / Enclosement);
- Es gibt keine Escape Zeichen;
- Alle Text Felder sind vom Typ xs:token (Keine Tab, NL oder LF);
Lieferung
| Item | Bedeutung |
|---|---|
| ch.zip | Daten aus der gesamten Schweiz |
| {kantonsabkuerzung}.zip | Daten des Kantons nach Abkürzung |
| {bfs_nummer_der_gemeinde}.zip | Gemeindedaten nach BFS-Nummer |
| readme.pdf | Allgemeine Informationen |
| gebaeude_batiment_edificio.csv | Gebäudebezogene Daten |
| gebaeude-batiment-edificio_specifications.pdf | Spezifikation der gebäudebezogenen Daten |
| eingang_entree_entrata.csv | Eingängenbezogene Daten |
| eingang-entree-entrata_specifications.pdf | Spezifikation der eingängenbezogenen Daten |
| wohnung_logement_abitazione.csv | Wohnungenbezogene Daten |
| wohnung-logement-abitazione_specifications.pdf | Spezifikation der wohnungenbezogenen Daten |
| kodes_codes_codici.csv | Codes im Zusammenhang mit den verschiedenen gelieferten Merkmalen |
| license.pdf | Lizenz zur Nutzung öffentlicher Daten |
| data.sqlite | SQLite ist ein relationales Datenbanksystem dass die besonderheit besitzt, in eine einzige Datei zu passen. |
| buildings.geojson | Diese Datei enthält die Geodaten der Gebäude (gemäss dem Schweizer Koordinatensystem LV95/CH1903+) |
| entrances.geojson | Diese Datei enthält die Geodaten der Eingänge (gemäss dem Schweizer Koordinatensystem LV95/CH1903+) |
Webservices
Für diese Abfrage ist requestContext=building obligatorisch.
Einfache Abfrage von Daten
Die einfache Datenabfrage ermöglicht die Abfrage eines einzelnen Gebäudes unter Angabe des entsprechenden Eidgenössischen Gebäudeidentifikators (EGID).
Beispielabfrage (maddRequest)
- Aufruf: POST https://madd.bfs.admin.ch/eCH-0206
- Header: Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<eCH-0206:maddRequest xmlns:eCH-0058="http://www.ech.ch/xmlns/eCH-0058/5" xmlns:eCH-0206="http://www.ech.ch/xmlns/eCH-0206/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ech.ch/xmlns/eCH-0206/2 eCH-0206-2-0-draft.xsd">
<eCH-0206:requestHeader>
<eCH-0206:messageId>myMessageId</eCH-0206:messageId>
<eCH-0206:businessReferenceId>BFS/OFS/UST</eCH-0206:businessReferenceId>
<eCH-0206:requestingApplication>
<eCH-0058:manufacturer>soapUI</eCH-0058:manufacturer>
<eCH-0058:product>Request-http</eCH-0058:product>
<eCH-0058:productVersion>5.2.1</eCH-0058:productVersion>
</eCH-0206:requestingApplication>
<eCH-0206:comment>EGID=20, Dataset 3</eCH-0206:comment>
<eCH-0206:requestDate>2021-02-22T16:15:47Z</eCH-0206:requestDate>
</eCH-0206:requestHeader>
<eCH-0206:requestContext>building</eCH-0206:requestContext>
<eCH-0206:requestQuery>
<eCH-0206:EGID>20</eCH-0206:EGID>
</eCH-0206:requestQuery>
</eCH-0206:maddRequest>
Beispiel kopieren
Beispielantwort (maddResponse)
Die Antwort enthält die Merkmale der Stufe A (öffentlich zugängliche Daten).
<?xml version="1.0" encoding="UTF-8"?>
<maddResponse xmlns="http://www.ech.ch/xmlns/eCH-0206/2" xmlns:eCH-0058="http://www.ech.ch/xmlns/eCH-0058/5" xmlns:eCH-0129="http://www.ech.ch/xmlns/eCH-0129/5" xmlns:eCH-0007="http://www.ech.ch/xmlns/eCH-0007/6">
<status>
<code>100</code>
<message>OK</message>
</status>
<responseHeader>
<messageId>0fb277e6-8bc6-11eb-999f-0242ac130003</messageId>
<requestMessageId>myMessageId</requestMessageId>
<businessReferenceId>BFS/OFS/UST</businessReferenceId>
<respondingApplication>
<eCH-0058:manufacturer>SFSO</eCH-0058:manufacturer>
<eCH-0058:product>MADD</eCH-0058:product>
<eCH-0058:productVersion>0.1</eCH-0058:productVersion>
</respondingApplication>
<comment>no comment</comment>
<responseDate>2021-03-23T10:53:54</responseDate>
</responseHeader>
<originalRequest xsi:schemaLocation="http://www.ech.ch/xmlns/eCH-0206/2 eCH-0206-2-0-draft.xsd" xmlns:eCH-0206="http://www.ech.ch/xmlns/eCH-0206/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<eCH-0206:requestHeader>
<eCH-0206:messageId>myMessageId</eCH-0206:messageId>
<eCH-0206:businessReferenceId>BFS/OFS/UST</eCH-0206:businessReferenceId>
<eCH-0206:requestingApplication>
<eCH-0058:manufacturer>soapUI</eCH-0058:manufacturer>
<eCH-0058:product>Request-http</eCH-0058:product>
<eCH-0058:productVersion>5.2.1</eCH-0058:productVersion>
</eCH-0206:requestingApplication>
<eCH-0206:comment>EGID=20, Dataset 3</eCH-0206:comment>
<eCH-0206:requestDate>2021-02-22T16:15:47Z</eCH-0206:requestDate>
</eCH-0206:requestHeader>
<eCH-0206:requestContext>building</eCH-0206:requestContext>
<eCH-0206:requestQuery>
<eCH-0206:EGID>20</eCH-0206:EGID>
</eCH-0206:requestQuery>
</originalRequest>
<maddAuthorization>
<maddId>anonymous</maddId>
<maddDataSet>3</maddDataSet>
</maddAuthorization>
<buildingList>
<buildingItem>
<EGID>20</EGID>
<building>
<officialBuildingNo>1145</officialBuildingNo>
<coordinates>
<east>2676418.734</east>
<north>1236038.458</north>
<originOfCoordinates>901</originOfCoordinates>
</coordinates>
<buildingStatus>1004</buildingStatus>
<buildingCategory>1020</buildingCategory>
<buildingClass>1110</buildingClass>
<dateOfConstruction>
<dateOfConstruction>1981</dateOfConstruction>
<periodOfConstruction>8016</periodOfConstruction>
</dateOfConstruction>
<surfaceAreaOfBuilding>100</surfaceAreaOfBuilding>
<numberOfFloors>2</numberOfFloors>
<recordModification>
<createDate>2001-11-29</createDate>
<updateDate>2021-03-15</updateDate>
</recordModification>
</building>
<buildingEntranceList>
<buildingEntranceItem>
<EDID>0</EDID>
<buildingEntrance>
<EGAID>100000353</EGAID>
<buildingEntranceNo>9</buildingEntranceNo>
<coordinates>
<east>2676421.673</east>
<north>1236041.077</north>
</coordinates>
<recordModification>
<createDate>2016-12-14</createDate>
<updateDate>2021-03-22</updateDate>
</recordModification>
<street>
<ESID>10106397</ESID>
<isOfficialDescription>1</isOfficialDescription>
<streetNameList>
<streetNameItem>
<language>9901</language>
<descriptionLong>Loorenfeldstrasse</descriptionLong>
<descriptionShort>Loorenfeldstr.</descriptionShort>
<descriptionIndex>Loo</descriptionIndex>
</streetNameItem>
</streetNameList>
</street>
<locality>
<swissZipCode>8910</swissZipCode>
<swissZipCodeAddOn>0</swissZipCodeAddOn>
<placeName>Affoltern am Albis</placeName>
</locality>
</buildingEntrance>
<dwellingList>
<dwellingItem>
<EWID>2</EWID>
<dwelling>
<floor>3100</floor>
<multipleFloor>1</multipleFloor>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2019-12-11</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
</dwellingList>
</buildingEntranceItem>
</buildingEntranceList>
<municipality>
<municipalityId>2</municipalityId>
<municipalityName>Affoltern am Albis</municipalityName>
<cantonAbbreviation>ZH</cantonAbbreviation>
</municipality>
<realestateIdentificationList>
<realestateIdentificationItem>
<EGRID>CH627781288948</EGRID>
<number>4135</number>
<subDistrict>0</subDistrict>
</realestateIdentificationItem>
</realestateIdentificationList>
</buildingItem>
</buildingList>
<responseMetadata>
<statisticsList>
<statisticsItem>
<objectType>building</objectType>
<objectCount>1</objectCount>
</statisticsItem>
</statisticsList>
<lastUpdateDate>2021-03-23T09:00:39</lastUpdateDate>
<exportDate>2021-03-23T09:34:32</exportDate>
<remarkList>
<remarkItem>no remark</remarkItem>
</remarkList>
</responseMetadata>
</maddResponse>
Beispiel kopieren
Erweiterte Abfrage von Daten
Die erweiterte Datenabfrage ermöglicht die Abfrage von Gebäuden nach verschiedenen Kriterien. Diese Kriterien werden angegeben, indem der folgende Block ein- oder mehrmals verwendet wird.
<!-- Can be repeated as much as needed -->
<!-- (Each added condition reduces the number of entries ("AND" condition)) -->
<eCH-0206:condition>
<eCH-0206:attributePath>(field)</eCH-0206:attributePath>
<!--Possible values for element 'operator': equalTo, greaterThan, lessThan, greaterThanOrEqualTo, lessThanOrEqualTo, notEqualTo, in, notIn, isNull, isNotNull -->
<eCH-0206:operator>(operator)</eCH-0206:operator>
<eCH-0206:attributeValue>(value)</eCH-0206:attributeValue>
</eCH-0206:condition>
- Die Angabe (field) muss durch den XPATH-Ausdruck des Feldes ersetzt werden, das man abfragen möchte. Dazu wird die Datenstruktur maddResponse verwendet, die im XML-Schema eCH-0206 beschrieben ist.
- Die Angabe (operator) muss durch einen der folgenden Operatoren ersetzt werden: equalTo, greaterThan, lessThan, greaterThanOrEqualTo, lessThanOrEqualTo, notEqualTo, in, notIn, isNull, isNotNull.
- Die Angabe (value) muss durch den Wert ersetzt werden, mit dem gesucht werden soll.
MADD-Assistent für die Erstellung von Abfragen
Beispielanfrage (maddRequest)
- Aufruf: POST https://madd.bfs.admin.ch/eCH-0206
- Header: Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<eCH-0206:maddRequest xmlns:eCH-0058="http://www.ech.ch/xmlns/eCH-0058/5" xmlns:eCH-0206="http://www.ech.ch/xmlns/eCH-0206/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ech.ch/xmlns/eCH-0206/2 eCH-0206-2-0-draft.xsd">
<eCH-0206:requestHeader>
<eCH-0206:messageId>myMessageId</eCH-0206:messageId>
<eCH-0206:businessReferenceId>BFS/OFS/UST</eCH-0206:businessReferenceId>
<eCH-0206:requestingApplication>
<eCH-0058:manufacturer>soapUI</eCH-0058:manufacturer>
<eCH-0058:product>Request-http</eCH-0058:product>
<eCH-0058:productVersion>5.2.1</eCH-0058:productVersion>
</eCH-0206:requestingApplication>
<eCH-0206:comment>EGID=20, Dataset 3</eCH-0206:comment>
<eCH-0206:requestDate>2021-02-22T16:15:47Z</eCH-0206:requestDate>
</eCH-0206:requestHeader>
<eCH-0206:requestContext>building</eCH-0206:requestContext>
<eCH-0206:requestQuery>
<!-- Can be repeated as much as needed -->
<!-- (Each added condition reduces the number of entries ("AND" condition)) -->
<eCH-0206:condition>
<eCH-0206:attributePath>/eCH-0206:maddResponse/eCH-0206:buildingList/eCH-0206:buildingItem/eCH-0206:buildingEntranceList/eCH-0206:buildingEntranceItem/eCH-0206:EDID</eCH-0206:attributePath>
<eCH-0206:operator>equalTo</eCH-0206:operator>
<!--Possible values for element 'operator': equalTo, greaterThan, lessThan, greaterThanOrEqualTo, lessThanOrEqualTo, notEqualTo, in, notIn, isNull, isNotNull -->
<eCH-0206:attributeValue>0</eCH-0206:attributeValue>
</eCH-0206:condition>
<!-- Can be repeated as much as needed -->
<!-- (Each added condition reduces the number of entries ("AND" condition)) -->
<eCH-0206:condition>
<eCH-0206:attributePath>/eCH-0206:maddResponse/eCH-0206:buildingList/eCH-0206:buildingItem/eCH-0206:building/eCH-0206:numberOfFloors</eCH-0206:attributePath>
<eCH-0206:operator>greaterThanOrEqualTo</eCH-0206:operator>
<eCH-0206:attributeValue>10</eCH-0206:attributeValue>
</eCH-0206:condition>
<!-- Can be repeated as much as needed -->
<!-- (Each added condition reduces the number of entries ("AND" condition)) -->
<eCH-0206:condition>
<eCH-0206:attributePath>/eCH-0206:maddResponse/eCH-0206:buildingList/eCH-0206:buildingItem/eCH-0206:municipality/eCH-0206:municipalityId</eCH-0206:attributePath>
<eCH-0206:operator>equalTo</eCH-0206:operator>
<eCH-0206:attributeValue>2937</eCH-0206:attributeValue>
</eCH-0206:condition>
</eCH-0206:requestQuery>
</eCH-0206:maddRequest>
Beispiel kopieren
Beispielantwort (maddResponse)
Die Antwort enthält die Merkmale der Stufe A (öffentlich zugängliche Daten).
<?xml version="1.0" encoding="UTF-8"?>
<maddResponse xmlns="http://www.ech.ch/xmlns/eCH-0206/2" xmlns:eCH-0058="http://www.ech.ch/xmlns/eCH-0058/5" xmlns:eCH-0129="http://www.ech.ch/xmlns/eCH-0129/5" xmlns:eCH-0007="http://www.ech.ch/xmlns/eCH-0007/6">
<status>
<code>100</code>
<message>OK</message>
</status>
<responseHeader>
<messageId>3ecfdd48-d0d5-11ec-b160-0242ac1d0004</messageId>
<requestMessageId>myMessageId</requestMessageId>
<businessReferenceId>BFS/OFS/UST</businessReferenceId>
<respondingApplication>
<eCH-0058:manufacturer>SFSO</eCH-0058:manufacturer>
<eCH-0058:product>MADD</eCH-0058:product>
<eCH-0058:productVersion>0.1</eCH-0058:productVersion>
</respondingApplication>
<comment>no comment</comment>
<responseDate>2022-05-11T02:51:24</responseDate>
</responseHeader>
<originalRequest xmlns:eCH-0058="http://www.ech.ch/xmlns/eCH-0058/5" xmlns:eCH-0206="http://www.ech.ch/xmlns/eCH-0206/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ech.ch/xmlns/eCH-0206/2 eCH-0206-2-0-draft.xsd">
<eCH-0206:requestHeader>
<eCH-0206:messageId>myMessageId</eCH-0206:messageId>
<eCH-0206:businessReferenceId>BFS/OFS/UST</eCH-0206:businessReferenceId>
<eCH-0206:requestingApplication>
<eCH-0058:manufacturer>soapUI</eCH-0058:manufacturer>
<eCH-0058:product>Request-http</eCH-0058:product>
<eCH-0058:productVersion>5.2.1</eCH-0058:productVersion>
</eCH-0206:requestingApplication>
<eCH-0206:comment>EGID=20, Dataset 3</eCH-0206:comment>
<eCH-0206:requestDate>2021-02-22T16:15:47Z</eCH-0206:requestDate>
</eCH-0206:requestHeader>
<eCH-0206:requestContext>building</eCH-0206:requestContext>
<eCH-0206:requestQuery>
<eCH-0206:condition>
<eCH-0206:attributePath>/eCH-0206:maddResponse/eCH-0206:buildingList/eCH-0206:buildingItem/eCH-0206:buildingEntranceList/eCH-0206:buildingEntranceItem/eCH-0206:EDID</eCH-0206:attributePath>
<eCH-0206:operator>equalTo</eCH-0206:operator>
<eCH-0206:attributeValue>0</eCH-0206:attributeValue>
</eCH-0206:condition>
<eCH-0206:condition>
<eCH-0206:attributePath>/eCH-0206:maddResponse/eCH-0206:buildingList/eCH-0206:buildingItem/eCH-0206:building/eCH-0206:numberOfFloors</eCH-0206:attributePath>
<eCH-0206:operator>greaterThanOrEqualTo</eCH-0206:operator>
<eCH-0206:attributeValue>10</eCH-0206:attributeValue>
</eCH-0206:condition>
<eCH-0206:condition>
<eCH-0206:attributePath>/eCH-0206:maddResponse/eCH-0206:buildingList/eCH-0206:buildingItem/eCH-0206:municipality/eCH-0206:municipalityId</eCH-0206:attributePath>
<eCH-0206:operator>equalTo</eCH-0206:operator>
<eCH-0206:attributeValue>2937</eCH-0206:attributeValue>
</eCH-0206:condition>
</eCH-0206:requestQuery>
</originalRequest>
<maddAuthorization>
<maddId>anonymous</maddId>
<maddDataSet>3</maddDataSet>
</maddAuthorization>
<buildingList>
<buildingItem>
<EGID>474529</EGID>
<building>
<officialBuildingNo>1915</officialBuildingNo>
<coordinates>
<east>2688903.353</east>
<north>1282572.449</north>
<originOfCoordinates>901</originOfCoordinates>
</coordinates>
<buildingStatus>1004</buildingStatus>
<buildingCategory>1020</buildingCategory>
<buildingClass>1122</buildingClass>
<dateOfConstruction>
<dateOfConstruction>1969</dateOfConstruction>
<periodOfConstruction>8014</periodOfConstruction>
</dateOfConstruction>
<surfaceAreaOfBuilding>201</surfaceAreaOfBuilding>
<numberOfFloors>10</numberOfFloors>
<thermotechnicalDeviceForHeating1>
<heatGeneratorHeating>7430</heatGeneratorHeating>
<energySourceHeating>7530</energySourceHeating>
<informationSourceHeating>860</informationSourceHeating>
<revisionDate>2001-11-29</revisionDate>
</thermotechnicalDeviceForHeating1>
<thermotechnicalDeviceForWarmWater1>
<heatGeneratorHotWater>7630</heatGeneratorHotWater>
<energySourceHeating>7530</energySourceHeating>
<informationSourceHeating>860</informationSourceHeating>
<revisionDate>2001-11-29</revisionDate>
</thermotechnicalDeviceForWarmWater1>
<thermotechnicalDeviceForWarmWater2>
<heatGeneratorHotWater>7600</heatGeneratorHotWater>
<energySourceHeating>7500</energySourceHeating>
<informationSourceHeating>860</informationSourceHeating>
<revisionDate>2001-11-29</revisionDate>
</thermotechnicalDeviceForWarmWater2>
<recordModification>
<createDate>2001-11-29</createDate>
<updateDate>2021-03-12</updateDate>
</recordModification>
</building>
<buildingEntranceList>
<buildingEntranceItem>
<EDID>0</EDID>
<buildingEntrance>
<EGAID>100353828</EGAID>
<buildingEntranceNo>52</buildingEntranceNo>
<coordinates>
<east>2688896.21</east>
<north>1282567.433</north>
</coordinates>
<isOfficialAddress>1</isOfficialAddress>
<recordModification>
<createDate>2016-12-14</createDate>
<updateDate>2022-05-03</updateDate>
</recordModification>
<street>
<ESID>10091258</ESID>
<isOfficialDescription>1</isOfficialDescription>
<streetNameList>
<streetNameItem>
<language>9901</language>
<descriptionLong>Schaffhauserstrasse</descriptionLong>
<descriptionShort>Schaffhauserstr.</descriptionShort>
<descriptionIndex>Sch</descriptionIndex>
</streetNameItem>
</streetNameList>
</street>
<locality>
<swissZipCode>8212</swissZipCode>
<swissZipCodeAddOn>0</swissZipCodeAddOn>
<placeName>Neuhausen am Rheinfall</placeName>
</locality>
</buildingEntrance>
<dwellingList>
<dwellingItem>
<EWID>1</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3401</floor>
<multipleFloor>0</multipleFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>2</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3100</floor>
<multipleFloor>0</multipleFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>3</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3105</floor>
<multipleFloor>0</multipleFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>4</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>3</noOfHabitableRooms>
<floor>3404</floor>
<multipleFloor>0</multipleFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>65</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>5</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>3</noOfHabitableRooms>
<floor>3104</floor>
<multipleFloor>0</multipleFloor>
<locationOfDwellingOnFloor>rechts</locationOfDwellingOnFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>65</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>6</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3101</floor>
<multipleFloor>0</multipleFloor>
<locationOfDwellingOnFloor>links</locationOfDwellingOnFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>7</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3402</floor>
<multipleFloor>0</multipleFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>8</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3403</floor>
<multipleFloor>0</multipleFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>9</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3104</floor>
<multipleFloor>0</multipleFloor>
<locationOfDwellingOnFloor>links</locationOfDwellingOnFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>10</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>3</noOfHabitableRooms>
<floor>3103</floor>
<multipleFloor>0</multipleFloor>
<locationOfDwellingOnFloor>rechts</locationOfDwellingOnFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>65</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>11</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>3</noOfHabitableRooms>
<floor>3102</floor>
<multipleFloor>0</multipleFloor>
<locationOfDwellingOnFloor>rechts</locationOfDwellingOnFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>65</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>12</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3102</floor>
<multipleFloor>0</multipleFloor>
<locationOfDwellingOnFloor>links</locationOfDwellingOnFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>13</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>3</noOfHabitableRooms>
<floor>3101</floor>
<multipleFloor>0</multipleFloor>
<locationOfDwellingOnFloor>rechts</locationOfDwellingOnFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>65</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
<dwellingItem>
<EWID>14</EWID>
<dwelling>
<yearOfConstruction>1999</yearOfConstruction>
<noOfHabitableRooms>4</noOfHabitableRooms>
<floor>3103</floor>
<multipleFloor>0</multipleFloor>
<locationOfDwellingOnFloor>links</locationOfDwellingOnFloor>
<kitchen>1</kitchen>
<surfaceAreaOfDwelling>75</surfaceAreaOfDwelling>
<dwellingStatus>3004</dwellingStatus>
<recordModification>
<createDate>2003-05-03</createDate>
<updateDate>2016-04-21</updateDate>
</recordModification>
</dwelling>
</dwellingItem>
</dwellingList>
</buildingEntranceItem>
</buildingEntranceList>
<municipality>
<municipalityId>2937</municipalityId>
<municipalityName>Neuhausen am Rheinfall</municipalityName>
<cantonAbbreviation>SH</cantonAbbreviation>
</municipality>
<realestateIdentificationList>
<realestateIdentificationItem>
<EGRID>CH315448087262</EGRID>
<number>2020</number>
<subDistrict>0</subDistrict>
</realestateIdentificationItem>
</realestateIdentificationList>
</buildingItem>
...
</buildingList>
<responseMetadata>
<statisticsList>
<statisticsItem>
<objectType>municipality_xml</objectType>
<objectCount>7</objectCount>
</statisticsItem>
<statisticsItem>
<objectType>building_xml</objectType>
<objectCount>7</objectCount>
</statisticsItem>
<statisticsItem>
<objectType>entrance_xml</objectType>
<objectCount>7</objectCount>
</statisticsItem>
<statisticsItem>
<objectType>dwelling_xml</objectType>
<objectCount>202</objectCount>
</statisticsItem>
<statisticsItem>
<objectType>street_xml</objectType>
<objectCount>7</objectCount>
</statisticsItem>
<statisticsItem>
<objectType>locality_xml</objectType>
<objectCount>7</objectCount>
</statisticsItem>
<statisticsItem>
<objectType>streetname_xml</objectType>
<objectCount>7</objectCount>
</statisticsItem>
<statisticsItem>
<objectType>constructionWork_xml</objectType>
<objectCount>0</objectCount>
</statisticsItem>
</statisticsList>
<lastUpdateDate>2022-05-11T01:26:26</lastUpdateDate>
<exportDate>2022-05-11T01:48:47</exportDate>
<remarkList>
<remarkItem>no remark</remarkItem>
</remarkList>
</responseMetadata>
</maddResponse>
Beispiel kopieren
Zugriff via URL
Öffentliche Daten für ein Gebäude (EGID) können durch Einfügen der Anforderung in eine URL abgerufen werden.
Beispiel für die Anzeige von Daten mit EGID 20:
https://www.housing-stat.ch/fr/madd/egid.html?egid=20
Beispiel, um direkt eine XML-Antwort mit EGID 20 zu erhalten:
https://madd.bfs.admin.ch/eCH-0206?egid=20
Zugriff via API von swisstopo
swisstopo bietet die Möglichkeit, APIs zu erstellen, um öffentliche Daten aus dem GWR zu erhalten. Weitere Informationen finden Sie auf der Seite:
http://api3.geo.admin.ch/Zugriff via SQLite
Obwohl SQLite-Datenbanken mit einer Vielzahl von Drittanbieter-Tools geöffnet werden können (z.B. DBeaver, HeidiSQL, jedes JDBC-kompatible Programm usw.), wird empfohlen, das offizielle Kommandozeilen-Tool von SQLite zu verwenden.
Die Datenbank besteht aus den folgenden Tabellen:
- _metadata: Metadaten (Umfang und Datum/Uhrzeit der Datengenerierung)
- codes: Liste der in den Daten verwendeten Codes
- building: Liste der Gebäude im gelieferten Perimeter
- dwelling: Liste der Wohnungen im gelieferten Perimeter
- entrance: Liste der Einträge im gelieferten Perimeter
Beispielanfrage : die 10 Strassen mit den meisten Eingänge im Umfang
sqlite>SELECT STRNAME || ' ' || DPLZ4 || ' ' || DPLZNAME as street, COUNT(*) AS number_of_buildings_in_street FROM entrance GROUP BY STRNAME, DPLZ4, DPLZNAME ORDER BY 2 DESC LIMIT 10;
Beispiel kopieren
Beispielanfrage : Parzellen mit mehr als 99 Wohnungen
sqlite>SELECT b.ggdenr as Gemeindenummer, b.ggdename as Gemeindename, b.lparz as Parzelle, count(1) as Anzahl_wohnungen from building b inner join dwelling d on d.egid = b.egid GROUP BY b.lparz, b.ggdenr, b.ggdename HAVING count(1) > 99 ORDER BY Gemeindenummer ASC
Beispiel kopieren
sqlite>SELECT STRNAME || ' ' || DPLZ4 || ' ' || DPLZNAME as street, COUNT(*) AS number_of_buildings_in_street FROM entrance GROUP BY STRNAME, DPLZ4, DPLZNAME ORDER BY 2 DESC LIMIT 10;
Beispiel kopieren
Beispielanfrage : Parzellen mit mehr als 99 Wohnungen
sqlite>SELECT b.ggdenr as Gemeindenummer, b.ggdename as Gemeindename, b.lparz as Parzelle, count(1) as Anzahl_wohnungen from building b inner join dwelling d on d.egid = b.egid GROUP BY b.lparz, b.ggdenr, b.ggdename HAVING count(1) > 99 ORDER BY Gemeindenummer ASC
Beispiel kopieren