Vizzuality/landgriffon

View on GitHub
api/src/modules/geo-regions/dto/geo-feature-response.dto.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { ApiProperty } from '@nestjs/swagger';
import {
  Feature,
  FeatureCollection,
  GeoJsonProperties,
  Geometry,
} from 'geojson';

class FeatureClass implements Feature {
  @ApiProperty()
  geometry: Geometry;
  @ApiProperty()
  properties: GeoJsonProperties;
  @ApiProperty()
  type: 'Feature';
}

class FeatureCollectionClass implements FeatureCollection {
  @ApiProperty()
  features: Feature[];
  @ApiProperty()
  type: 'FeatureCollection';
}

export class GeoFeatureResponse {
  @ApiProperty()
  geojson: FeatureClass;
}

export class GeoFeatureCollectionResponse {
  @ApiProperty()
  geojson: FeatureCollectionClass;
}