1085 lines
25 KiB
TypeScript
1085 lines
25 KiB
TypeScript
export interface ApiEnvelope<T> {
|
|
data: T
|
|
}
|
|
|
|
export interface ApiError {
|
|
code: string
|
|
message: string
|
|
details: Record<string, unknown> | unknown[]
|
|
}
|
|
|
|
export interface ApiErrorEnvelope {
|
|
error: ApiError
|
|
}
|
|
|
|
export interface ProjectRead {
|
|
id: string
|
|
name: string
|
|
description?: string | null
|
|
region: string
|
|
status: string
|
|
created_at?: string | null
|
|
updated_at?: string | null
|
|
}
|
|
|
|
export interface ProjectCreate {
|
|
name: string
|
|
description?: string | null
|
|
region?: string
|
|
}
|
|
|
|
export interface ProjectListResponse {
|
|
items: ProjectRead[]
|
|
total: number
|
|
limit: number
|
|
offset: number
|
|
}
|
|
|
|
export interface DemoWorkflowResponse {
|
|
project_id: string
|
|
area_id: string
|
|
reference_dataset_id: string
|
|
candidate_dataset_id: string
|
|
raster_dataset_id?: string | null
|
|
quality_check_id: string
|
|
metric_count: number
|
|
status: string
|
|
message: string
|
|
created: boolean
|
|
}
|
|
|
|
export interface AreaRead {
|
|
id: string
|
|
project_id: string
|
|
name: string
|
|
original_crs?: string | null
|
|
area_m2?: number | null
|
|
created_at?: string | null
|
|
geometry_type?: string | null
|
|
geometry?: GeoJSON.Polygon | GeoJSON.MultiPolygon | null
|
|
}
|
|
|
|
export interface AreaCreate {
|
|
name: string
|
|
geometry: GeoJSON.Polygon | GeoJSON.MultiPolygon
|
|
crs?: string
|
|
}
|
|
|
|
export interface AreaListResponse {
|
|
items: AreaRead[]
|
|
total: number
|
|
limit: number
|
|
offset: number
|
|
}
|
|
|
|
export interface DatasetCreateResponse {
|
|
id: string
|
|
name: string
|
|
dataset_type: string
|
|
source: string
|
|
dataset_role?: string
|
|
source_name?: string | null
|
|
reference_layer_name?: string | null
|
|
source_metadata?: Record<string, unknown> | null
|
|
provenance_metadata?: Record<string, unknown> | null
|
|
imported_at?: string | null
|
|
temporal_series_key?: string | null
|
|
observed_at?: string | null
|
|
valid_from?: string | null
|
|
valid_to?: string | null
|
|
temporal_granularity?: string | null
|
|
source_version?: string | null
|
|
project_id: string
|
|
area_id?: string | null
|
|
storage_path?: string | null
|
|
original_filename?: string | null
|
|
stored_filename?: string | null
|
|
content_type?: string | null
|
|
size_bytes?: number | null
|
|
checksum_sha256?: string | null
|
|
crs?: string | null
|
|
bounds_json?: Record<string, number> | null
|
|
metadata_json?: Record<string, unknown> | null
|
|
vector_summary?: VectorSummary | null
|
|
status: string
|
|
derived_from_dataset_id?: string | null
|
|
created_at?: string | null
|
|
feature_count?: number | null
|
|
}
|
|
|
|
export interface JobRead {
|
|
id: string
|
|
job_type: string
|
|
status: string
|
|
project_id: string
|
|
dataset_id?: string | null
|
|
input_dataset_id?: string | null
|
|
output_dataset_id?: string | null
|
|
parameters_json: Record<string, unknown>
|
|
result_json?: Record<string, unknown> | null
|
|
error_message?: string | null
|
|
created_at?: string | null
|
|
started_at?: string | null
|
|
finished_at?: string | null
|
|
}
|
|
|
|
export interface JobListResponse {
|
|
items: JobRead[]
|
|
total: number
|
|
limit: number
|
|
offset: number
|
|
}
|
|
|
|
export interface VectorSummary {
|
|
feature_count?: number | null
|
|
geometry_types?: string[] | null
|
|
bounds_json?: Record<string, number> | null
|
|
approximate_area_m2?: number | null
|
|
crs?: string | null
|
|
feature_geometry_count?: number | null
|
|
invalid_features?: number | null
|
|
crs_assumed?: boolean | null
|
|
}
|
|
|
|
export interface VectorSummaryResponse {
|
|
feature_count?: number | null
|
|
geometry_types?: string[] | null
|
|
bounds_json?: Record<string, number> | null
|
|
approximate_area_m2?: number | null
|
|
crs?: string | null
|
|
feature_geometry_count?: number | null
|
|
invalid_features?: number | null
|
|
crs_assumed?: boolean | null
|
|
}
|
|
|
|
export interface RasterMetadataResponse {
|
|
driver: string
|
|
dataset_id?: string
|
|
width: number
|
|
height: number
|
|
band_count: number
|
|
crs?: string | null
|
|
bounds?: number[]
|
|
resolution?: number[]
|
|
dtype?: string[]
|
|
nodata?: unknown
|
|
transform?: string[] | number[] | null
|
|
path?: string
|
|
size_bytes?: number | null
|
|
checksum_sha256?: string | null
|
|
operation?: string | null
|
|
operation_parameters?: Record<string, unknown> | null
|
|
source_dataset_id?: string | null
|
|
}
|
|
|
|
export interface RasterInspectResponse {
|
|
dataset_id: string
|
|
ready: boolean
|
|
metadata: Record<string, unknown>
|
|
}
|
|
|
|
export interface RasterPreviewPayload {
|
|
path: string
|
|
format: string
|
|
width: number | null
|
|
height: number | null
|
|
}
|
|
|
|
export interface RasterPreviewResponse {
|
|
dataset_id: string
|
|
ready: boolean
|
|
preview: RasterPreviewPayload
|
|
metadata?: Record<string, unknown>
|
|
}
|
|
|
|
export interface RasterBandStats {
|
|
band_index: number
|
|
dtype: string | null
|
|
min: number | null
|
|
max: number | null
|
|
mean: number | null
|
|
std: number | null
|
|
nodata_count: number
|
|
nodata_ratio: number
|
|
valid_pixel_count: number
|
|
histogram: number[] | null
|
|
histogram_bins: number[] | null
|
|
}
|
|
|
|
export interface RasterStatsResponse {
|
|
dataset_id: string
|
|
source_dataset_id?: string | null
|
|
bands: RasterBandStats[]
|
|
generated_at?: string | null
|
|
}
|
|
|
|
export interface RasterNdviRequest {
|
|
nir_band: number
|
|
red_band: number
|
|
output_name?: string
|
|
}
|
|
|
|
export interface RasterNdwiRequest {
|
|
green_band: number
|
|
nir_band: number
|
|
output_name?: string
|
|
}
|
|
|
|
export interface RasterNdbiRequest {
|
|
swir_band: number
|
|
nir_band: number
|
|
output_name?: string
|
|
}
|
|
|
|
export interface RasterTileManifestTile {
|
|
path: string
|
|
pixel_window: number[]
|
|
bounds: number[]
|
|
transform: number[]
|
|
index: number
|
|
}
|
|
|
|
export interface RasterTileManifest {
|
|
tile_set_id: string
|
|
source_dataset_id: string
|
|
source_raster_id: string
|
|
bounds: number[]
|
|
tile_size: number
|
|
overlap: number
|
|
parameters: Record<string, unknown>
|
|
created_at: string
|
|
tile_paths: string[]
|
|
count: number
|
|
tiles: RasterTileManifestTile[]
|
|
}
|
|
|
|
export interface RasterTileResponse {
|
|
dataset_id: string
|
|
ready: boolean
|
|
operation: string
|
|
tile_set_id: string
|
|
tile_size: number
|
|
overlap: number
|
|
manifest_path: string
|
|
count: number
|
|
manifest: RasterTileManifest
|
|
}
|
|
|
|
export interface RasterTileHandoff {
|
|
manifest_path: string
|
|
tile_set_id?: string | null
|
|
tile_size?: number | null
|
|
overlap?: number | null
|
|
count?: number | null
|
|
source_dataset_id?: string | null
|
|
created_at?: string | null
|
|
}
|
|
|
|
export interface VectorBBoxResponse {
|
|
dataset_id: string
|
|
bounds_json: Record<string, number> | null
|
|
feature_count: number
|
|
crs?: string | null
|
|
}
|
|
|
|
export interface VectorStatsResponse {
|
|
dataset_id: string
|
|
feature_count: number
|
|
geometry_type_summary: Record<string, number>
|
|
bounds_json: Record<string, number> | null
|
|
crs?: string | null
|
|
}
|
|
|
|
export interface VectorSelectionBBox {
|
|
min_x: number
|
|
min_y: number
|
|
max_x: number
|
|
max_y: number
|
|
crs?: 'EPSG:4326'
|
|
}
|
|
|
|
export interface OrthophotoAcquireRequest {
|
|
bbox: VectorSelectionBBox
|
|
area_id?: string
|
|
force_refresh?: boolean
|
|
}
|
|
|
|
export interface OrthophotoAcquisitionResult {
|
|
output_dataset_id: string
|
|
reused: boolean
|
|
provider: string
|
|
layer: string
|
|
width: number
|
|
height: number
|
|
resolution_m: number
|
|
bbox_epsg4326: number[]
|
|
bbox_epsg31370: number[]
|
|
attribution: string
|
|
limitation_message: string
|
|
}
|
|
|
|
export interface MapViewportState {
|
|
bbox: VectorSelectionBBox
|
|
zoom: number
|
|
}
|
|
|
|
export interface VectorSelectionRequest {
|
|
bbox: VectorSelectionBBox
|
|
area_id?: string
|
|
limit?: number
|
|
}
|
|
|
|
export interface VectorSelectionDeriveRequest extends VectorSelectionRequest {
|
|
output_name?: string
|
|
}
|
|
|
|
export interface VectorSelectionResponse {
|
|
selection_bbox: VectorSelectionBBox
|
|
selection_area_id?: string | null
|
|
feature_count: number
|
|
total_feature_count?: number | null
|
|
limit: number
|
|
truncated: boolean
|
|
geojson: GeoJSON.FeatureCollection
|
|
summary?: VectorSelectionSummary | null
|
|
}
|
|
|
|
export interface VectorSelectionSummary {
|
|
metric_label: string
|
|
metric_value: number
|
|
metric_unit: string
|
|
aggregation_method: string
|
|
primary_metric_key?: string | null
|
|
feature_count: number
|
|
is_estimate: boolean
|
|
warning?: string | null
|
|
metrics?: VectorSelectionMetric[]
|
|
}
|
|
|
|
export interface VectorSelectionMetric {
|
|
metric_key: string
|
|
metric_label: string
|
|
metric_value: number
|
|
metric_unit: string
|
|
aggregation_method: string
|
|
is_estimate: boolean
|
|
warning?: string | null
|
|
}
|
|
|
|
export interface DatasetTemporalUpdate {
|
|
temporal_series_key: string
|
|
observed_at: string
|
|
valid_from?: string | null
|
|
valid_to?: string | null
|
|
temporal_granularity?: string
|
|
source_version?: string | null
|
|
}
|
|
|
|
export interface DatasetVersionRead {
|
|
id: string
|
|
dataset_id: string
|
|
version: number
|
|
storage_path?: string | null
|
|
source_version?: string | null
|
|
observed_at?: string | null
|
|
valid_from?: string | null
|
|
valid_to?: string | null
|
|
checksum_sha256?: string | null
|
|
source_metadata?: Record<string, unknown> | null
|
|
provenance_metadata?: Record<string, unknown> | null
|
|
created_at?: string | null
|
|
}
|
|
|
|
export interface TemporalComparisonRequest {
|
|
earlier_dataset_id: string
|
|
later_dataset_id: string
|
|
bbox: VectorSelectionBBox
|
|
area_id?: string | null
|
|
preview_limit?: number
|
|
}
|
|
|
|
export interface TemporalDatasetRef {
|
|
id: string
|
|
name: string
|
|
observed_at: string
|
|
source_version?: string | null
|
|
}
|
|
|
|
export interface TemporalMetricComparison {
|
|
metric_key: string
|
|
label: string
|
|
unit: string
|
|
aggregation_method: string
|
|
earlier_value: number
|
|
later_value: number
|
|
absolute_change: number
|
|
percent_change?: number | null
|
|
is_estimate: boolean
|
|
warning?: string | null
|
|
}
|
|
|
|
export interface TemporalObservationMetric {
|
|
metric_key: string
|
|
label: string
|
|
value: number
|
|
unit: string
|
|
aggregation_method: string
|
|
is_estimate: boolean
|
|
}
|
|
|
|
export interface TemporalObservation {
|
|
dataset: TemporalDatasetRef
|
|
metrics: TemporalObservationMetric[]
|
|
}
|
|
|
|
export interface TemporalObjectChanges {
|
|
available: boolean
|
|
added_count?: number | null
|
|
removed_count?: number | null
|
|
modified_count?: number | null
|
|
unchanged_count?: number | null
|
|
}
|
|
|
|
export interface TemporalComparisonResponse {
|
|
temporal_series_key: string
|
|
earlier: TemporalDatasetRef
|
|
later: TemporalDatasetRef
|
|
selection_bbox: VectorSelectionBBox
|
|
selection_area_id?: string | null
|
|
metric: TemporalMetricComparison
|
|
metrics: TemporalMetricComparison[]
|
|
timeline: TemporalObservation[]
|
|
object_changes: TemporalObjectChanges
|
|
geojson: GeoJSON.FeatureCollection
|
|
warnings: string[]
|
|
generated_at: string
|
|
}
|
|
|
|
export interface TemporalSeriesDataset {
|
|
id: string
|
|
name: string
|
|
observed_at: string
|
|
source_version?: string | null
|
|
feature_count?: number | null
|
|
}
|
|
|
|
export interface TemporalSeriesRead {
|
|
temporal_series_key: string
|
|
source_name?: string | null
|
|
reference_layer_name?: string | null
|
|
dataset_count: number
|
|
first_observed_at: string
|
|
last_observed_at: string
|
|
datasets: TemporalSeriesDataset[]
|
|
}
|
|
|
|
export interface TemporalSeriesListResponse {
|
|
items: TemporalSeriesRead[]
|
|
total: number
|
|
}
|
|
|
|
export interface DatasetListResponse {
|
|
items: DatasetCreateResponse[]
|
|
total: number
|
|
limit: number
|
|
offset: number
|
|
}
|
|
|
|
export interface GeojsonEnvelopeResponse {
|
|
data: object
|
|
}
|
|
|
|
export interface ChangeDetectionRequest {
|
|
source_dataset_id: string
|
|
target_dataset_id: string
|
|
iou_threshold: number
|
|
include_unchanged: boolean
|
|
}
|
|
|
|
export interface ChangeDetectionSummary {
|
|
source_dataset_id: string
|
|
target_dataset_id: string
|
|
source_feature_count: number
|
|
target_feature_count: number
|
|
added_count: number
|
|
removed_count: number
|
|
unchanged_count: number
|
|
iou_threshold: number
|
|
warnings: string[]
|
|
generated_at: string
|
|
geojson: GeoJSON.FeatureCollection
|
|
}
|
|
|
|
export interface ProviderCapability {
|
|
provider_name: string
|
|
display_name: string
|
|
authority_level: 'authoritative' | 'contextual' | 'manual' | 'fixture' | string
|
|
supported_layers: string[]
|
|
supported_geometry_types: string[]
|
|
supported_query_modes: string[]
|
|
fetch_signature: string
|
|
configured: boolean
|
|
status: string
|
|
limitation_message: string
|
|
attribution: string
|
|
license_note: string
|
|
not_configured_reason: string | null
|
|
}
|
|
|
|
export interface SystemCapabilitiesResponse {
|
|
status: string
|
|
service: string
|
|
version: string
|
|
database: string | null
|
|
postgis: boolean
|
|
rasterio: boolean
|
|
geopandas: boolean
|
|
yolo: boolean | string
|
|
sam: boolean | string
|
|
grb: string
|
|
sentinel: string
|
|
providers: ProviderCapability[]
|
|
}
|
|
|
|
export interface AssistantModelRead {
|
|
name: string
|
|
size_bytes?: number | null
|
|
parameter_size?: string | null
|
|
quantization_level?: string | null
|
|
capabilities: string[]
|
|
}
|
|
|
|
export interface AssistantModelsResponse {
|
|
items: AssistantModelRead[]
|
|
total: number
|
|
default_model?: string | null
|
|
}
|
|
|
|
export interface AssistantStatus {
|
|
enabled: boolean
|
|
reachable: boolean
|
|
status: string
|
|
base_url: string
|
|
default_model?: string | null
|
|
model_count: number
|
|
limitation_message: string
|
|
}
|
|
|
|
export interface AssistantChatMessage {
|
|
role: 'user' | 'assistant'
|
|
content: string
|
|
}
|
|
|
|
export interface AssistantQueryRequest {
|
|
question: string
|
|
model?: string | null
|
|
bbox?: VectorSelectionBBox | null
|
|
area_id?: string | null
|
|
history?: AssistantChatMessage[]
|
|
}
|
|
|
|
export interface AssistantContextMetric {
|
|
theme: string
|
|
label: string
|
|
value: number
|
|
unit: string
|
|
source: string
|
|
dataset_id: string
|
|
observed_at?: string | null
|
|
is_estimate: boolean
|
|
}
|
|
|
|
export interface AssistantTemporalSeries {
|
|
temporal_series_key: string
|
|
label: string
|
|
source: string
|
|
first_year: number
|
|
last_year: number
|
|
observation_count: number
|
|
}
|
|
|
|
export interface AssistantQueryResponse {
|
|
answer: string
|
|
model: string
|
|
scope_label: string
|
|
context_metrics: AssistantContextMetric[]
|
|
temporal_series: AssistantTemporalSeries[]
|
|
source_dataset_ids: string[]
|
|
warnings: string[]
|
|
generated_at: string
|
|
}
|
|
|
|
export interface ProviderCapabilitiesResponse {
|
|
providers: ProviderCapability[]
|
|
}
|
|
|
|
export interface ProviderLayersResponse {
|
|
provider_name: string
|
|
layers: string[]
|
|
}
|
|
|
|
export interface ProviderStatusResponse {
|
|
provider_name: string
|
|
configured: boolean
|
|
status: string
|
|
limitation_message: string
|
|
}
|
|
|
|
export interface ProviderImportResponse {
|
|
provider_name: string
|
|
status: string
|
|
message: string
|
|
requested_layers: string[]
|
|
dataset_id: string | null
|
|
dataset_role?: string | null
|
|
source_name?: string | null
|
|
}
|
|
|
|
export interface DetectionModelCapability {
|
|
model_id: string
|
|
display_name: string
|
|
framework: string
|
|
task_type: string
|
|
supported_classes: string[]
|
|
configured: boolean
|
|
status: string
|
|
limitation_message: string
|
|
version?: string | null
|
|
}
|
|
|
|
export interface DetectionModelsResponse {
|
|
models: DetectionModelCapability[]
|
|
}
|
|
|
|
export interface ModelAssetRead {
|
|
model_asset_id: string
|
|
filename: string
|
|
display_name: string
|
|
model_path: string
|
|
suffix: string
|
|
framework: string
|
|
task_type: string
|
|
size_bytes: number
|
|
sha256: string
|
|
active: boolean
|
|
status: string
|
|
limitation_message: string
|
|
will_download_models: boolean
|
|
}
|
|
|
|
export interface ModelAssetListResponse {
|
|
items: ModelAssetRead[]
|
|
total: number
|
|
model_directory: string
|
|
}
|
|
|
|
export interface YoloPreflightChecks {
|
|
enabled: boolean
|
|
dependencies_available?: boolean | null
|
|
model_path_set?: boolean | null
|
|
model_file_exists?: boolean | null
|
|
model_load_requested: boolean
|
|
model_load_ok?: boolean | null
|
|
manifest_path_set?: boolean | null
|
|
manifest_valid?: boolean | null
|
|
tile_paths_exist?: boolean | null
|
|
tile_limit_ok?: boolean | null
|
|
}
|
|
|
|
export interface YoloPreflightRuntime {
|
|
dependencies_assumed: boolean
|
|
model_directory?: string | null
|
|
yolo_config_dir?: string | null
|
|
torch_version?: string | null
|
|
ultralytics_version?: string | null
|
|
cuda_available?: boolean | null
|
|
}
|
|
|
|
export interface YoloPreflightResponse {
|
|
model_id: string
|
|
model_asset_id?: string | null
|
|
model_path?: string | null
|
|
tile_manifest_path?: string | null
|
|
status: string
|
|
message: string
|
|
checks: YoloPreflightChecks
|
|
runtime: YoloPreflightRuntime
|
|
tile_count: number
|
|
max_tiles: number
|
|
will_download_models: boolean
|
|
will_run_inference: boolean
|
|
error_code?: string | null
|
|
}
|
|
|
|
export interface DetectionRunRequest {
|
|
project_id: string
|
|
dataset_id: string
|
|
model_id: string
|
|
model_asset_id?: string | null
|
|
confidence_threshold: number
|
|
class_filter?: string[] | null
|
|
tile_manifest_path?: string | null
|
|
parameters_json?: Record<string, unknown>
|
|
}
|
|
|
|
export interface DetectionRunResponse {
|
|
analysis_run_id: string
|
|
job_id: string
|
|
project_id: string
|
|
dataset_id: string
|
|
model_id: string
|
|
status: string
|
|
detection_count: number
|
|
error_code?: string | null
|
|
message: string
|
|
}
|
|
|
|
export interface DetectionRunRead {
|
|
id: string
|
|
project_id: string
|
|
dataset_id?: string | null
|
|
job_id?: string | null
|
|
analysis_type: string
|
|
status: string
|
|
model_name?: string | null
|
|
model_version?: string | null
|
|
parameters_json: Record<string, unknown>
|
|
result_json?: Record<string, unknown> | null
|
|
error_message?: string | null
|
|
created_at?: string | null
|
|
started_at?: string | null
|
|
finished_at?: string | null
|
|
}
|
|
|
|
export interface DetectionRunListResponse {
|
|
items: DetectionRunRead[]
|
|
total: number
|
|
}
|
|
|
|
export interface DetectionRead {
|
|
id: string
|
|
project_id: string
|
|
dataset_id?: string | null
|
|
analysis_run_id?: string | null
|
|
job_id?: string | null
|
|
model_name: string
|
|
model_version?: string | null
|
|
class_name: string
|
|
confidence: number
|
|
bbox_json?: Record<string, unknown> | null
|
|
source_tile_path?: string | null
|
|
properties_json?: Record<string, unknown> | null
|
|
created_at?: string | null
|
|
}
|
|
|
|
export interface DetectionListResponse {
|
|
items: DetectionRead[]
|
|
total: number
|
|
}
|
|
|
|
export interface DetectionQaRequest {
|
|
reference_dataset_id: string
|
|
iou_threshold: number
|
|
class_name?: string | null
|
|
min_confidence?: number | null
|
|
}
|
|
|
|
export interface DetectionQaResult {
|
|
status: string
|
|
quality_check_id: string
|
|
analysis_run_id: string
|
|
reference_dataset_id: string
|
|
candidate_feature_count: number
|
|
reference_feature_count: number
|
|
candidate_feature_count_raw?: number
|
|
reference_feature_count_raw?: number
|
|
matches: number
|
|
false_positives: number
|
|
false_negatives: number
|
|
precision?: number | null
|
|
recall?: number | null
|
|
f1_score?: number | null
|
|
mean_iou?: number | null
|
|
iou_threshold: number
|
|
warnings: string[]
|
|
coverage?: {
|
|
applied: boolean
|
|
mode: string
|
|
manifest_path?: string | null
|
|
tile_count: number
|
|
source_crs_values: string[]
|
|
candidate_raw_count: number
|
|
candidate_evaluated_count: number
|
|
candidate_excluded_outside_count: number
|
|
candidate_clipped_boundary_count: number
|
|
reference_raw_count: number
|
|
reference_evaluated_count: number
|
|
reference_excluded_outside_count: number
|
|
reference_clipped_boundary_count: number
|
|
}
|
|
box_to_footprint_diagnostics?: {
|
|
diagnostic_only: boolean
|
|
canonical_method: string
|
|
diagnostic_method: string
|
|
iou_threshold: number
|
|
strict_matches: number
|
|
envelope_matches: number
|
|
possible_box_to_footprint_mismatch_count: number
|
|
envelope_false_positives: number
|
|
envelope_false_negatives: number
|
|
envelope_precision?: number | null
|
|
envelope_recall?: number | null
|
|
envelope_f1_score?: number | null
|
|
envelope_mean_iou?: number | null
|
|
}
|
|
}
|
|
|
|
export type SegmentationModelCapability = DetectionModelCapability
|
|
|
|
export interface SegmentationModelsResponse {
|
|
models: SegmentationModelCapability[]
|
|
}
|
|
|
|
export interface SegmentationRunRequest {
|
|
project_id: string
|
|
dataset_id: string
|
|
model_id: string
|
|
confidence_threshold: number
|
|
class_filter?: string[] | null
|
|
tile_manifest_path?: string | null
|
|
parameters_json?: Record<string, unknown>
|
|
}
|
|
|
|
export interface SegmentationRunResponse {
|
|
analysis_run_id: string
|
|
job_id: string
|
|
project_id: string
|
|
dataset_id: string
|
|
model_id: string
|
|
status: string
|
|
segmentation_count: number
|
|
error_code?: string | null
|
|
message: string
|
|
}
|
|
|
|
export interface SegmentationRunRead {
|
|
id: string
|
|
project_id: string
|
|
dataset_id?: string | null
|
|
job_id?: string | null
|
|
analysis_type: string
|
|
status: string
|
|
model_name?: string | null
|
|
model_version?: string | null
|
|
parameters_json: Record<string, unknown>
|
|
result_json?: Record<string, unknown> | null
|
|
error_message?: string | null
|
|
created_at?: string | null
|
|
started_at?: string | null
|
|
finished_at?: string | null
|
|
}
|
|
|
|
export interface SegmentationRunListResponse {
|
|
items: SegmentationRunRead[]
|
|
total: number
|
|
}
|
|
|
|
export interface SegmentationRead {
|
|
id: string
|
|
project_id: string
|
|
dataset_id?: string | null
|
|
analysis_run_id?: string | null
|
|
job_id?: string | null
|
|
model_name: string
|
|
model_version?: string | null
|
|
class_name: string
|
|
confidence?: number | null
|
|
bbox_json?: Record<string, unknown> | null
|
|
area_m2?: number | null
|
|
mask_path?: string | null
|
|
source_tile_path?: string | null
|
|
tile_index?: number | null
|
|
properties_json?: Record<string, unknown> | null
|
|
provenance_json?: Record<string, unknown> | null
|
|
created_at?: string | null
|
|
}
|
|
|
|
export interface SegmentationListResponse {
|
|
items: SegmentationRead[]
|
|
total: number
|
|
}
|
|
|
|
export interface SegmentationQaRequest {
|
|
reference_dataset_id: string
|
|
iou_threshold: number
|
|
class_name?: string | null
|
|
min_confidence?: number | null
|
|
}
|
|
|
|
export type SegmentationQaResult = DetectionQaResult
|
|
|
|
export interface QaComparisonRequest {
|
|
candidate_dataset_id: string
|
|
reference_dataset_id: string
|
|
iou_threshold: number
|
|
area_id?: string | null
|
|
}
|
|
|
|
export interface QaComparisonResult {
|
|
status: string
|
|
warnings: string[]
|
|
candidate_feature_count: number
|
|
reference_feature_count: number
|
|
matches: number
|
|
false_positives: number
|
|
false_negatives: number
|
|
precision: number | null
|
|
recall: number | null
|
|
f1_score: number | null
|
|
mean_iou: number | null
|
|
iou_threshold: number
|
|
unsupported_geometry: boolean
|
|
unsupported_geometries: string[]
|
|
match_evidence?: Record<string, unknown>[]
|
|
false_positive_evidence?: Record<string, unknown>[]
|
|
false_negative_evidence?: Record<string, unknown>[]
|
|
generated_at: string
|
|
quality_check_id?: string
|
|
}
|
|
|
|
export interface MetricRead {
|
|
id: string
|
|
quality_check_id?: string | null
|
|
analysis_run_id?: string | null
|
|
metric_key: string
|
|
metric_value?: number | null
|
|
metric_unit?: string | null
|
|
label?: string | null
|
|
metadata_json?: Record<string, unknown> | null
|
|
created_at?: string | null
|
|
}
|
|
|
|
export interface QualityCheckRead {
|
|
id: string
|
|
project_id: string
|
|
job_id?: string | null
|
|
analysis_run_id?: string | null
|
|
candidate_dataset_id?: string | null
|
|
reference_dataset_id: string
|
|
check_type: string
|
|
status: string
|
|
score?: number | null
|
|
parameters_json?: Record<string, unknown> | null
|
|
findings_json?: Record<string, unknown> | null
|
|
created_at?: string | null
|
|
completed_at?: string | null
|
|
metrics: MetricRead[]
|
|
}
|
|
|
|
export interface QualityCheckListResponse {
|
|
items: QualityCheckRead[]
|
|
total: number
|
|
limit: number
|
|
offset: number
|
|
}
|
|
|
|
export interface QualityEvidenceGeoJsonResponse {
|
|
quality_check_id: string
|
|
project_id: string
|
|
candidate_dataset_id?: string | null
|
|
reference_dataset_id: string
|
|
analysis_run_id?: string | null
|
|
feature_count: number
|
|
warnings: string[]
|
|
geojson: GeoJSON.FeatureCollection
|
|
}
|
|
|
|
export type DetectionEvidenceRole = 'false_positive' | 'false_negative'
|
|
|
|
export type DetectionReviewDecision =
|
|
| 'confirmed_model_false_positive'
|
|
| 'confirmed_model_false_negative'
|
|
| 'reference_gap_or_change'
|
|
| 'qa_alignment_mismatch'
|
|
| 'imagery_obscured_or_uncertain'
|
|
| 'uncertain'
|
|
| 'unreviewed'
|
|
|
|
export interface DetectionReviewUpsert {
|
|
evidence_role: DetectionEvidenceRole
|
|
evidence_feature_id: string
|
|
decision: DetectionReviewDecision
|
|
notes?: string | null
|
|
reviewed_by?: string
|
|
}
|
|
|
|
export interface DetectionReviewRead {
|
|
id?: string | null
|
|
project_id: string
|
|
quality_check_id: string
|
|
analysis_run_id?: string | null
|
|
evidence_role: DetectionEvidenceRole
|
|
evidence_feature_id: string
|
|
detection_id?: string | null
|
|
reference_feature_id?: string | null
|
|
decision: DetectionReviewDecision
|
|
notes?: string | null
|
|
reviewed_by?: string | null
|
|
confidence?: number | null
|
|
class_name?: string | null
|
|
source_tile_path?: string | null
|
|
created_at?: string | null
|
|
updated_at?: string | null
|
|
}
|
|
|
|
export interface DetectionReviewSummary {
|
|
total: number
|
|
reviewed: number
|
|
remaining: number
|
|
false_positive_total: number
|
|
false_negative_total: number
|
|
decision_counts: Record<string, number>
|
|
}
|
|
|
|
export interface DetectionReviewList {
|
|
items: DetectionReviewRead[]
|
|
total: number
|
|
limit: number
|
|
offset: number
|
|
summary: DetectionReviewSummary
|
|
}
|
|
|
|
export type ExportKind = 'dataset' | 'detection_run' | 'segmentation_run' | 'vector_selection'
|
|
|
|
export interface ExportRead {
|
|
id: string
|
|
project_id: string
|
|
analysis_run_id?: string | null
|
|
export_type: string
|
|
storage_path: string
|
|
metadata_json?: Record<string, unknown> | null
|
|
created_at?: string | null
|
|
status: string
|
|
}
|
|
|
|
export interface ExportCreateResponse {
|
|
export_id: string
|
|
path: string
|
|
status: string
|
|
export_type: string
|
|
metadata_json?: Record<string, unknown> | null
|
|
}
|
|
|
|
export interface ExportListResponse {
|
|
items: ExportRead[]
|
|
total: number
|
|
limit: number
|
|
offset: number
|
|
}
|
|
|
|
export interface ExportContentResponse {
|
|
export_id: string
|
|
export_type: string
|
|
content: Record<string, unknown>
|
|
}
|