Match up distance from reporter in UI and API
This commit is contained in:
parent
642309520f
commit
f6ce5f91a2
3 changed files with 4 additions and 4 deletions
|
|
@ -35,7 +35,7 @@ func loadImagesForReportNuisance(ctx context.Context, org_id int32, report_ids [
|
|||
"i.storage_uuid AS uuid",
|
||||
"COALESCE(ST_X(i.location), 0) AS \"location.longitude\"",
|
||||
"COALESCE(ST_Y(i.location), 0) AS \"location.latitude\"",
|
||||
"ST_Distance(i.location::geography, n.location::geography) AS \"distance_to_reporter_meters\"",
|
||||
"ST_Distance(i.location::geography, n.location::geography) AS \"distance_from_reporter_meters\"",
|
||||
"COALESCE(MAX(e.value) FILTER (WHERE e.name = 'Make'), '') AS exif_make",
|
||||
"COALESCE(MAX(e.value) FILTER (WHERE e.name = 'Model'), '') AS exif_model",
|
||||
"COALESCE(MAX(e.value) FILTER (WHERE e.name = 'DateTime'), '') AS exif_datetime",
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func (e Exif) MarshalJSON() ([]byte, error) {
|
|||
}
|
||||
|
||||
type Image struct {
|
||||
DistanceToReporterMeters float64 `db:"distance_to_reporter_meters"`
|
||||
DistanceToReporterMeters float64 `db:"distance_from_reporter_meters"`
|
||||
Exif Exif `db:"-" json:"exif"`
|
||||
ExifMake string `db:"exif_make" json:"-"`
|
||||
ExifModel string `db:"exif_model" json:"-"`
|
||||
|
|
@ -48,7 +48,7 @@ type Image struct {
|
|||
|
||||
func (i *Image) MarshalJSON() ([]byte, error) {
|
||||
to_marshal := make(map[string]interface{}, 0)
|
||||
to_marshal["distance_to_reporter_meters"] = i.DistanceToReporterMeters
|
||||
to_marshal["distance_from_reporter_meters"] = i.DistanceToReporterMeters
|
||||
to_marshal["exif"] = Exif{
|
||||
Created: i.ExifDateTime,
|
||||
Make: i.ExifMake,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue