Fix address lat/lng location names, populate in report response
This commit is contained in:
parent
7e2a22c58c
commit
59e58840c9
6 changed files with 129 additions and 113 deletions
|
|
@ -70,8 +70,8 @@ func SignalCreateFromPublicreport(ctx context.Context, user User, report_id stri
|
|||
return nil, fmt.Errorf("site from address: %w", err)
|
||||
}
|
||||
site_id = site.ID
|
||||
lat := address.LocationY.GetOr(0.0)
|
||||
lng := address.LocationX.GetOr(0.0)
|
||||
lat := address.LocationLatitude.GetOr(0.0)
|
||||
lng := address.LocationLongitude.GetOr(0.0)
|
||||
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
|
||||
} else if report.LocationLatitude.IsValue() && report.LocationLongitude.IsValue() {
|
||||
lat := report.LocationLatitude.MustGet()
|
||||
|
|
@ -97,8 +97,8 @@ func SignalCreateFromPublicreport(ctx context.Context, user User, report_id stri
|
|||
return nil, fmt.Errorf("find address from raw: %w", err)
|
||||
}
|
||||
site_id = site.ID
|
||||
lat := address.LocationY.GetOr(0.0)
|
||||
lng := address.LocationX.GetOr(0.0)
|
||||
lat := address.LocationLatitude.GetOr(0.0)
|
||||
lng := address.LocationLongitude.GetOr(0.0)
|
||||
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
|
||||
} else {
|
||||
// We have no structured address, no GPS, no unstructued address.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue