Compare commits

..

2 Commits

Author SHA1 Message Date
57e3c4d3ad Merge branch 'main' of https://git.olemenke.com/Ol86/HKA-OSM 2026-04-27 14:15:03 +02:00
7fb116ab2f Change name and add new query function 2026-04-27 14:15:01 +02:00
2 changed files with 16 additions and 3 deletions

View File

@@ -103,7 +103,7 @@ export class OSMMap implements OnInit {
// Create a new LayerGroup to hold the building polygons
const resultingLayer = new L.LayerGroup();
this.overpass.fetchBuildings(building_name).subscribe((data) => {
this.overpass.fetchIndoorData(building_name).subscribe((data) => {
console.log('Fetched building data from Overpass API:', data);
// Create a mapping of node IDs to their coordinates

View File

@@ -28,10 +28,10 @@ export class Overpass {
constructor(private http: HttpClient) {}
fetchBuildings(building_name: string) {
fetchIndoorData(building_name: string) {
const header = { 'Content-Type': 'text/plain' };
const query = `
[out:json][timeout:25];
[out:json][timeout:90];
nwr["building"]["operator"="Hochschule Karlsruhe"]["name"="${building_name}"](49.014442, 8.387954, 49.017847, 8.395448)->.building;
(
nwr["indoor"="room"](area.building);
@@ -42,4 +42,17 @@ export class Overpass {
return this.http.post<OverpassResponse>(this.apiUrl, query, { headers: header });
}
fetchBuildingData() {
const header = { 'Content-Type': 'text/plain' };
const query = `
[out:json][timeout:90];
(
nwr["building"="university"]["operator"="Hochschule Karlsruhe"](49.014442, 8.387954, 49.017847, 8.395448);
);
(._;>;);
out body;
`;
return this.http.post<OverpassResponse>(this.apiUrl, query, { headers: header });
}
}