Skip to content

Commit

Permalink
change min/max timestamp due to chronotope/chrono#1382
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBeilschmidt committed Feb 4, 2024
1 parent eaff95e commit f135954
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 66 deletions.
28 changes: 14 additions & 14 deletions datatypes/src/collections/batch_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ mod tests {
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -541,8 +541,8 @@ mod tests {
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -553,8 +553,8 @@ mod tests {
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}]
Expand Down Expand Up @@ -684,8 +684,8 @@ mod tests {
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -700,8 +700,8 @@ mod tests {
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}]
Expand Down Expand Up @@ -777,8 +777,8 @@ mod tests {
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -796,8 +796,8 @@ mod tests {
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}]
Expand Down
4 changes: 2 additions & 2 deletions datatypes/src/primitives/time_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ impl TimeInstance {
self == Self::MAX
}

pub const MIN: Self = TimeInstance::from_millis_unchecked(-8_334_632_851_200_001 + 1);
pub const MAX: Self = TimeInstance::from_millis_unchecked(8_210_298_412_800_000 - 1);
pub const MIN: Self = TimeInstance::from_millis_unchecked(-8_334_601_228_800_000);
pub const MAX: Self = TimeInstance::from_millis_unchecked(8_210_266_876_799_999);

pub const EPOCH_START: Self = TimeInstance::from_millis_unchecked(0);
}
Expand Down
28 changes: 14 additions & 14 deletions datatypes/src/primitives/time_interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,15 @@ mod tests {

#[test]
fn to_geo_json_event() {
let min_visualizable_value = -8_334_632_851_200_001 + 1;
let max_visualizable_value = 8_210_298_412_800_000 - 1;
let min_visualizable_value = -8_334_601_228_800_000;
let max_visualizable_value = 8_210_266_876_799_999;

assert_eq!(
TimeInterval::new_unchecked(min_visualizable_value, max_visualizable_value)
.as_geo_json_event(),
serde_json::json!({
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval",
})
);
Expand All @@ -555,8 +555,8 @@ mod tests {
)
.as_geo_json_event(),
serde_json::json!({
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval",
})
);
Expand All @@ -567,8 +567,8 @@ mod tests {
)
.as_geo_json_event(),
serde_json::json!({
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval",
})
);
Expand All @@ -578,7 +578,7 @@ mod tests {
fn duration_millis() {
assert_eq!(
TimeInterval::default().duration_ms(),
16_544_931_263_999_999
16_544_868_105_599_999
);

let time_interval = TimeInterval::new(
Expand All @@ -593,32 +593,32 @@ mod tests {
TimeInterval::new(-1, TimeInstance::MAX)
.unwrap()
.duration_ms(),
8_210_298_412_800_000
8_210_266_876_800_000
);
assert_eq!(
TimeInterval::new(0, TimeInstance::MAX)
.unwrap()
.duration_ms(),
8_210_298_412_799_999
8_210_266_876_799_999
);

assert_eq!(
TimeInterval::new(TimeInstance::MIN, -1)
.unwrap()
.duration_ms(),
8_334_632_851_199_999
8_334_601_228_799_999
);
assert_eq!(
TimeInterval::new(TimeInstance::MIN, 0)
.unwrap()
.duration_ms(),
8_334_632_851_200_000
8_334_601_228_800_000
);
assert_eq!(
TimeInterval::new(TimeInstance::MIN, 1)
.unwrap()
.duration_ms(),
8_334_632_851_200_001
8_334_601_228_800_001
);
}

Expand Down
4 changes: 2 additions & 2 deletions datatypes/src/raster/arrow_conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ mod tests {
assert_eq!(schema.metadata()[Y_SIZE_KEY], "3");
assert_eq!(
schema.metadata()[TIME_KEY],
"{\"start\":-8334632851200000,\"end\":8210298412799999}"
"{\"start\":-8334601228800000,\"end\":8210266876799999}"
);
assert_eq!(schema.metadata()[SPATIAL_REF_KEY], "EPSG:4326");

Expand Down Expand Up @@ -312,7 +312,7 @@ mod tests {
assert_eq!(schema.metadata()[Y_SIZE_KEY], "3");
assert_eq!(
schema.metadata()[TIME_KEY],
"{\"start\":-8334632851200000,\"end\":8210298412799999}"
"{\"start\":-8334601228800000,\"end\":8210266876799999}"
);
assert_eq!(schema.metadata()[SPATIAL_REF_KEY], "EPSG:4326");

Expand Down
1 change: 1 addition & 0 deletions expression/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl ToTokens for Prelude {
#![allow(unused_variables)] // expression inputs that are not used
#![allow(unused_parens)] // safety-first parentheses in generated code
#![allow(non_snake_case)] // we use double underscores for generated function names
#![allow(unused_imports)] // TODO: only import dependencies that are actually used

extern crate geoengine_expression_deps;

Expand Down
1 change: 1 addition & 0 deletions expression/src/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const DEPS_LIB_RS: &[u8] = std::include_bytes!("../deps-workspace/lib.rs");
///
/// If this is dropped, the workspace will be deleted.
///
#[derive(Debug)]
pub struct ExpressionDependencies {
// we need to hold this to keep the tempdir alive
_cargo_workspace: tempfile::TempDir,
Expand Down
4 changes: 2 additions & 2 deletions operators/src/mock/mock_raster_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ mod tests {
"params": {
"data": [{
"time": {
"start": -8_334_632_851_200_000_i64,
"end": 8_210_298_412_799_999_i64
"start": -8_334_601_228_800_000_i64,
"end": 8_210_266_876_799_999_i64
},
"tilePosition": [0, 0],
"band": 0,
Expand Down
8 changes: 4 additions & 4 deletions operators/src/source/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ x,y
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -623,8 +623,8 @@ x,y
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}]
Expand Down
24 changes: 12 additions & 12 deletions services/src/api/handlers/wfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,8 @@ x;y
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -923,8 +923,8 @@ x;y
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -935,8 +935,8 @@ x;y
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}]
Expand Down Expand Up @@ -1050,8 +1050,8 @@ x;y
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -1062,8 +1062,8 @@ x;y
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}, {
Expand All @@ -1074,8 +1074,8 @@ x;y
},
"properties": {},
"when": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00",
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00",
"type": "Interval"
}
}]
Expand Down
4 changes: 2 additions & 2 deletions test_data/dataset_defs/germany_polygon.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"spatialReference": "EPSG:4326",
"columns": {},
"time": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00"
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00"
},
"bbox": {
"lowerLeftCoordinate": [5.8524898680001103, 47.2711209110000965],
Expand Down
4 changes: 2 additions & 2 deletions test_data/dataset_defs/landcover.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"spatialReference": "EPSG:4326",
"noDataValue": 255.0,
"time": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00"
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00"
},
"bbox": {
"upperLeftCoordinate": [-180.0, 90.0],
Expand Down
4 changes: 2 additions & 2 deletions test_data/dataset_defs/mock.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"spatialReference": "EPSG:4326",
"columns": {},
"time": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00"
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00"
},
"bbox": {
"lowerLeftCoordinate": [1.0, 2.0],
Expand Down
4 changes: 2 additions & 2 deletions test_data/dataset_defs/natural_earth_2_blue.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"dataType": "U8",
"spatialReference": "EPSG:4326",
"time": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00"
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00"
},
"bbox": {
"upperLeftCoordinate": [-180, 90.0],
Expand Down
4 changes: 2 additions & 2 deletions test_data/dataset_defs/natural_earth_2_green.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"dataType": "U8",
"spatialReference": "EPSG:4326",
"time": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00"
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00"
},
"bbox": {
"upperLeftCoordinate": [-180, 90.0],
Expand Down
4 changes: 2 additions & 2 deletions test_data/dataset_defs/natural_earth_2_red.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"dataType": "U8",
"spatialReference": "EPSG:4326",
"time": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00"
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00"
},
"bbox": {
"upperLeftCoordinate": [-180, 90.0],
Expand Down
4 changes: 2 additions & 2 deletions test_data/dataset_defs/ne_10m_ports (3857).json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
}
},
"time": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00"
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00"
},
"bbox": {
"lowerLeftCoordinate": [-19120007.589356, -7324970.649647],
Expand Down
4 changes: 2 additions & 2 deletions test_data/dataset_defs/ne_10m_ports.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
}
},
"time": {
"start": "-262144-01-01T00:00:00+00:00",
"end": "+262143-12-31T23:59:59.999+00:00"
"start": "-262143-01-01T00:00:00+00:00",
"end": "+262142-12-31T23:59:59.999+00:00"
},
"bbox": {
"lowerLeftCoordinate": [-171.75795, -54.809444],
Expand Down

0 comments on commit f135954

Please sign in to comment.