Observation class
Represents a mosquito observation record with comprehensive metadata.
This model corresponds to the Pydantic 'Observation' model used in the CulicidaeLab server API. It contains detailed information about a mosquito sighting including species identification, location, timestamp, and various metadata fields for tracking data quality and provenance.
The observation data supports both user-submitted sightings and data imported from external sources, providing a unified structure for mosquito surveillance and research applications.
Usage Example
// Create a new observation from user input
final observation = Observation(
id: 'obs_123456',
speciesScientificName: 'Aedes aegypti',
count: 1,
location: Location(lat: 40.7128, lng: -74.0060),
observedAt: DateTime.now(),
notes: 'Found near standing water in urban area',
userId: 'user_789',
locationAccuracyM: 10,
dataSource: 'mobile_app',
imageFilename: 'mosquito_20240115_143022.jpg',
modelId: 'culico-net-cls-v1',
confidence: 0.87,
);
// Serialize for API transmission
final json = observation.toJson();
Data Sources
Observations can originate from various sources:
'mobile_app'- User submissions via CulicidaeLab mobile app'web_app'- Submissions via web interface'citizen_science'- Imported from citizen science platforms'research'- Professional research data'surveillance'- Public health surveillance programs
API Integration
This model is designed to be compatible with the CulicidaeLab server API for submitting observations and retrieving surveillance data.
See also:
- Location for geographical coordinate handling
- WebPredictionResult for AI-powered species identification
- CulicidaeLab server API documentation
Constructors
-
Observation({required String id, required String speciesScientificName, required int count, required Location location, required DateTime observedAt, String? notes, String? userId, int? locationAccuracyM, String? dataSource, String? imageFilename, String? modelId, double? confidence, Map<
String, dynamic> ? metadata}) - Creates a new Observation instance.
-
Observation.fromJson(Map<
String, dynamic> json) -
Creates an Observation from a JSON map.
factory
Properties
- confidence → double?
-
Confidence score of the species identification (0.0 to 1.0).
final
- confidencePercentage → String?
-
Gets the confidence as a percentage string.
no setter
- count → int
-
Number of individual mosquitoes observed.
final
- dataSource → String?
-
Source system or platform that generated this observation.
final
- hashCode → int
-
Returns the hash code for this observation.
no setteroverride
- id → String
-
Unique identifier for the observation.
final
- imageFilename → String?
-
Filename of the associated image, if any.
final
- isAiIdentified → bool
-
Checks if this observation was AI-identified.
no setter
- isHighQuality → bool
-
Checks if this observation has high-quality data.
no setter
- location → Location
-
Geographic location where the observation was made.
final
- locationAccuracyDescription → String
-
Gets a human-readable description of location accuracy.
no setter
- locationAccuracyM → int?
-
GPS accuracy of the location measurement in meters.
final
-
metadata
→ Map<
String, dynamic> ? -
Additional metadata as key-value pairs.
final
- modelId → String?
-
Identifier of the AI model used for species identification.
final
- notes → String?
-
Optional user notes about the observation.
final
- observedAt → DateTime
-
Date and time when the observation was made.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speciesScientificName → String
-
Scientific name of the observed mosquito species.
final
- userId → String?
-
Identifier of the user who made the observation.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this Observation to a JSON map.
-
toString(
) → String -
Returns a string representation of this observation.
override
Operators
-
operator ==(
Object other) → bool -
Checks if two Observation instances are equal.
override
Static Methods
-
fromJsonString(
String str) → Observation - Creates an Observation from a JSON string.