2026-04-14-1
This commit is contained in:
@@ -2,6 +2,8 @@ import { Controller, Get, Post, Delete, Body, Query, UseGuards, HttpException, H
|
||||
import { ApiTags, ApiOperation, ApiQuery } from '@nestjs/swagger';
|
||||
import { GeocodingService } from './geocoding.service';
|
||||
import { AdminBoundariesService } from './admin-boundaries.service';
|
||||
import { JordanResearchService } from './jordan-research.service';
|
||||
import { AdministrativeLinkingService } from './administrative-linking.service';
|
||||
import { ApiKeyGuard } from '../common/guards/api-key.guard';
|
||||
|
||||
@ApiTags('geocoding')
|
||||
@@ -10,6 +12,8 @@ export class GeocodingController {
|
||||
constructor(
|
||||
private readonly geocodingService: GeocodingService,
|
||||
private readonly adminBoundariesService: AdminBoundariesService,
|
||||
private readonly jordanResearchService: JordanResearchService,
|
||||
private readonly adminLinkingService: AdministrativeLinkingService,
|
||||
) {}
|
||||
|
||||
@Get('search')
|
||||
@@ -120,4 +124,33 @@ export class GeocodingController {
|
||||
) {
|
||||
return this.adminBoundariesService.importFromFile(country, filePath);
|
||||
}
|
||||
|
||||
@Get('research/zarqa')
|
||||
@ApiOperation({ summary: 'Generate a research report for Zarqa, Jordan (Sample Data)' })
|
||||
async zarqaResearch() {
|
||||
return this.jordanResearchService.generateZarqaReport();
|
||||
}
|
||||
|
||||
@Post('admin/sync-neighborhoods')
|
||||
@UseGuards(ApiKeyGuard)
|
||||
@ApiOperation({ summary: 'Sync neighborhood points from OSM for a bbox' })
|
||||
@ApiQuery({ name: 'bbox', required: false })
|
||||
async syncNeighborhoods(@Query('bbox') bbox?: string) {
|
||||
return this.adminLinkingService.syncOsmNeighborhoodPoints(bbox);
|
||||
}
|
||||
|
||||
@Post('admin/generate-voronoi')
|
||||
@UseGuards(ApiKeyGuard)
|
||||
@ApiOperation({ summary: 'Generate Voronoi polygons for neighborhoods' })
|
||||
async generateVoronoi() {
|
||||
return this.adminLinkingService.generateVoronoiNeighborhoods();
|
||||
}
|
||||
|
||||
@Post('admin/link-places')
|
||||
@UseGuards(ApiKeyGuard)
|
||||
@ApiOperation({ summary: 'Link places to administrative hierarchy' })
|
||||
@ApiQuery({ name: 'country', required: true, enum: ['jordan', 'syria'] })
|
||||
async linkPlaces(@Query('country') country: 'jordan' | 'syria') {
|
||||
return this.adminLinkingService.linkPlaces(country);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user