-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📍 Use the server-side geocoded addresses for place names #1166
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
and user input objects. | ||
As much as possible, these types parallel the types used in the server code. */ | ||
|
||
import { NominatimResponse } from '../diary/addressNamesHelper'; | ||
import { BaseModeKey, MotionTypeKey } from '../diary/diaryHelper'; | ||
import useDerivedProperties from '../diary/useDerivedProperties'; | ||
import { VehicleIdentity } from './appConfigTypes'; | ||
|
@@ -32,8 +33,13 @@ export type ConfirmedPlace = { | |
exit_fmt_time: string; // ISO string e.g. 2023-10-31T12:00:00.000-04:00 | ||
exit_local_dt: LocalDt; | ||
exit_ts: number; // Unix timestamp | ||
|
||
// one of these depending on what we decide to keep on the server | ||
geocoded_address?: NominatimResponse['address']; | ||
reverse_geocode?: NominatimResponse; | ||
|
||
key: string; | ||
location: Geometry; | ||
location: Point; | ||
origin_key: string; | ||
raw_places: ObjectId[]; | ||
source: string; | ||
|
@@ -96,7 +102,7 @@ export type CompositeTrip = { | |
confirmed_trip: ObjectId; | ||
distance: number; | ||
duration: number; | ||
end_confirmed_place: BEMData<ConfirmedPlace>; | ||
end_confirmed_place: ConfirmedPlace; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious about what this change does. Why did we have BEMData before and why don't we need it now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was just incorrect. I noticed because Typescript complained when I accessed properties on the place objects while making the changes
|
||
end_fmt_time: string; | ||
end_loc: Point; | ||
end_local_dt: LocalDt; | ||
|
@@ -113,7 +119,7 @@ export type CompositeTrip = { | |
raw_trip: ObjectId; | ||
sections: SectionData[]; | ||
source: string; | ||
start_confirmed_place: BEMData<ConfirmedPlace>; | ||
start_confirmed_place: ConfirmedPlace; | ||
start_fmt_time: string; | ||
start_loc: Point; | ||
start_local_dt: LocalDt; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! great idea to reuse the data from prior mappings even for trips that don't have the address instead of looking it up.