Gebäude-Query hinzugefügt
This commit is contained in:
@@ -59,15 +59,15 @@ export const ContextMenu = () => {
|
|||||||
const addOSMobjects = async (ignorePreviosSelected?: boolean) => {
|
const addOSMobjects = async (ignorePreviosSelected?: boolean) => {
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`https://overpass-api.de/api/interpreter?data=${encodeURIComponent(`
|
`https://overpass-api.de/api/interpreter?data=${encodeURIComponent(`
|
||||||
[out:json];
|
[out:json];
|
||||||
(
|
(
|
||||||
way["leisure"~"pitch|sports_centre"](around:2000, ${contextMenu.lat}, ${contextMenu.lng});
|
way["building"](around:100, ${contextMenu.lat}, ${contextMenu.lng});
|
||||||
relation["leisure"~"pitch|sports_centre"](around:2000, ${contextMenu.lat}, ${contextMenu.lng});
|
relation["building"](around:100, ${contextMenu.lat}, ${contextMenu.lng});
|
||||||
);
|
);
|
||||||
out body;
|
out body;
|
||||||
>;
|
>;
|
||||||
out skel qt;
|
out skel qt;
|
||||||
`)}`,
|
`)}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
|
|||||||
@@ -8,41 +8,5 @@ const router: Router = Router();
|
|||||||
|
|
||||||
router.use("/mail", mailRouter);
|
router.use("/mail", mailRouter);
|
||||||
router.use("/event", eventRouter);
|
router.use("/event", eventRouter);
|
||||||
router.get("/import", async (req, res) => {
|
|
||||||
await Promise.all(
|
|
||||||
DATA.map(async (station) => {
|
|
||||||
try {
|
|
||||||
return await prisma.station.create({
|
|
||||||
data: {
|
|
||||||
aircraftRegistration: "D-H",
|
|
||||||
aircraft: station.aircraft,
|
|
||||||
aircraftSpeed: station.aircraftSpeed,
|
|
||||||
atcCallsign: station.atcCallsign,
|
|
||||||
bosCallsign: station.bosCallsign,
|
|
||||||
bosCallsignShort: station.bosCallsignShort,
|
|
||||||
bosRadioArea: station.bosRadioArea,
|
|
||||||
fir: station.fir,
|
|
||||||
operator: station.operator,
|
|
||||||
bosUse: "PRIMARY",
|
|
||||||
country: station.country as Country,
|
|
||||||
hasNvg: station.hasNvg,
|
|
||||||
hasRope: station.hasRope,
|
|
||||||
hasWinch: station.hasWinch,
|
|
||||||
is24h: station.is24h,
|
|
||||||
hideRangeRings: station.hideRangeRings,
|
|
||||||
locationState: station.locationState,
|
|
||||||
locationStateShort: station.locationStateShort,
|
|
||||||
|
|
||||||
latitude: station.latitude,
|
|
||||||
longitude: station.longitude,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`Error creating station ${station.aircraft}:`, error);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
res.status(200).json({ message: "Import completed" });
|
|
||||||
});
|
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
Reference in New Issue
Block a user