Compare commits
2 Commits
b1464cc32e
...
57e3c4d3ad
| Author | SHA1 | Date | |
|---|---|---|---|
| 57e3c4d3ad | |||
| 7fb116ab2f |
@@ -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
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user