Introduction
L'annexe 1 de l’ORegBL définit le niveau de chaque information accessible (bâtiment, logement, projet). Les données de niveau A sont publiques et peuvent être utilisées sans restriction. L’indication de la source (auteur, titre et lien vers le jeu de données) est obligatoire.
Télécharger les données
L'essentiel en bref
- Les données ont toujours le statut de la fin de la journée précédente;
- Le téléchargement se fait dans un seul fichier compressé contenant plusieurs fichiers;
- Les fichiers sont séquentiels, comme le sont les fichiers *.csv/*.dsv;
- Le téléchargement contient une documentation sur les données livrées.
Format du fichier
- Extension *.csv/*.dsv
- Séparateur: Tab;
- Avec un en-tête (header);
- UTF-8 ;
- Pas de BOM (Indicateur d'ordre des octets)
- Pas de guillemets (pas de qualificatif de texte / d'inclusion);
- Il n'y a pas de caractères d'échappement;
- Tous les champs de texte sont du type xs:token (Pas de Tab, NL ou LF);
Livraison
| Objet | Signification |
|---|---|
| ch.zip | Données de toute la Suisse |
| {abreviation_du_canton}.zip | Données du canton selon l'abréviation |
| {numero_de_commune}.zip | Données de la commune selon le numéro OFS |
| readme.pdf | Informations générales |
| gebaeude_batiment_edificio.csv | Données liées aux bâtiments |
| gebaeude-batiment-edificio_specifications.pdf | Spécification des données liées aux bâtiments |
| eingang_entree_entrata.csv | Données liées aux entrées |
| eingang-entree-entrata_specifications.pdf | Spécification des données liées aux entrées |
| wohnung_logement_abitazione.csv | Données liées aux logements |
| wohnung-logement-abitazione_specifications.pdf | Spécification des données liées aux logements |
| kodes_codes_codici.csv | Codes liées aux différents caractères livrés |
| license.pdf | License d'utilisation des données publiques |
| data.sqlite | SQLite est un système de base de données relationnelle qui a la particularité de tenir dans un seul fichier. |
| buildings.geojson | Ce fichier comprend les données géospatiales des bâtiments (selon le système de coordonnées suisse MN95/CH1903+) |
| entrances.geojson | Ce fichier comprend les données géospatiales des entrées (selon le système de coordonnées suisse MN95/CH1903+) |
Webservices
Pour cette requête, requestContext=building est obligatoire.
Requête simple de données
La requête simple permet l'interrogation d'un seul bâtiment en indiquant l'identifiant fédéral du bâtiment (EGID) correspondant.
Exemple de requête (maddRequest)
- Appel: POST https://madd.bfs.admin.ch/eCH-0206
- En-tête: 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>
Copier l'exemple
Exemple de réponse (maddResponse)
La réponse contient les caractères du niveau A (données accessibles au public).
<?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>
Copier l'exemple
Requête avancée de données
La requête avancée permet l'interrogation de bâtiments en fonction de différents critères. Ces critères sont indiqués en utilisant le bloc suivant à une ou plusieurs reprises.
<!-- 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>
- L'indication (field) doit être remplacée par l'expression XPATH du champ que l'on souhaite interroger. On utilise pour cela la structure de données maddResponse décrite dans le schéma XML eCH-0206.
- L'indication (operator) doit être remplacée par un des opérateurs suivants: equalTo, greaterThan, lessThan, greaterThanOrEqualTo, lessThanOrEqualTo, notEqualTo, in, notIn, isNull, isNotNull
- L'indication (value) doit être remplacée par la valeur avec laquelle on souhaite rechercher.
Assistant MADD pour la construction des requêtes
Exemple de requête (maddRequest)
- Appel: POST https://madd.bfs.admin.ch/eCH-0206
- En-tête: 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>
Copier l'exemple
Exemple de réponse (maddResponse)
La réponse contient les caractères du niveau A (données accessibles au public).
<?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>
Copier l'exemple
Accès via URL
Il est possible d’obtenir les données publiques pour un bâtiment (EGID) en incluant la demande dans un URL. Exemple pour obtenir directement une réponse XML avec l’EGID 20:
https://madd.bfs.admin.ch/eCH-0206?egid=20
Accès via l'API de swisstopo
swisstopo propose la possibilité de développer des API pour obtenir les données publiques du RegBL.
http://api3.geo.admin.ch/Accès via SQLite
Bien que les bases de données SQLite puissent être ouvertes avec une multitude d’outils tiers (p.ex. DBeaver, HeidiSQL, n’importe quel programme compatible JDBC, etc.), il est recommandé d’utiliser l’outil en ligne de commande officiel de SQLite.
La base de données est composée des tables suivantes:
- _metadata: Métadonnées (étendue et date/heure de génération des données)
- codes: Liste des codes utilisés dans les données
- building: Liste des bâtiments de l’étendue
- dwelling: Liste des logements de l’étendue
- entrance: Liste des entrées de l’étendue
Exemple de requête : les 10 rues ayant le plus d’entrées sur l’étendue
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;
Copier l'exemple
Exemple de requête : parcelles ayant plus de 99 logements
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
Copier l'exemple