first version worth putting in git - compiles and runs - missing a lot still.

This commit is contained in:
stopflock
2025-07-18 14:25:22 -05:00
parent bd0898c5e4
commit eee92f4f21
71 changed files with 2728 additions and 2 deletions
+33
View File
@@ -0,0 +1,33 @@
/// A bundle of preset OSM tags that describe a particular camera model/type.
class CameraProfile {
final String name;
final Map<String, String> tags;
const CameraProfile({
required this.name,
required this.tags,
});
// Builtin ALPR profile (Flock Falconstyle).
factory CameraProfile.alpr() => const CameraProfile(
name: 'ALPR Camera',
tags: {
'man_made': 'surveillance',
'surveillance:type': 'ALPR',
'surveillance': 'public',
'surveillance:zone': 'traffic',
'camera:type': 'fixed',
'camera:mount': 'pole',
},
);
CameraProfile copyWith({
String? name,
Map<String, String>? tags,
}) =>
CameraProfile(
name: name ?? this.name,
tags: tags ?? this.tags,
);
}
+18
View File
@@ -0,0 +1,18 @@
import 'package:latlong2/latlong.dart';
class OsmCameraNode {
final int id;
final LatLng coord;
final Map<String, String> tags;
OsmCameraNode({
required this.id,
required this.coord,
required this.tags,
});
bool get hasDirection => tags.containsKey('direction');
double? get directionDeg =>
hasDirection ? double.tryParse(tags['direction']!) : null;
}
+16
View File
@@ -0,0 +1,16 @@
import 'package:latlong2/latlong.dart';
import 'camera_profile.dart';
class PendingUpload {
final LatLng coord;
final double direction;
final CameraProfile profile;
final DateTime queuedAt;
PendingUpload({
required this.coord,
required this.direction,
required this.profile,
}) : queuedAt = DateTime.now();
}