Fix signals getting saved with correct location
This commit is contained in:
parent
e86cdc6764
commit
c4359a3c81
2 changed files with 8 additions and 3 deletions
|
|
@ -68,7 +68,7 @@ func SignalCreateFromPublicreport(ctx context.Context, user User, report_id stri
|
||||||
return nil, fmt.Errorf("site from address: %w", err)
|
return nil, fmt.Errorf("site from address: %w", err)
|
||||||
}
|
}
|
||||||
site_id = site.ID
|
site_id = site.ID
|
||||||
lat := address.LocationX.GetOr(0.0)
|
lat := address.LocationY.GetOr(0.0)
|
||||||
lng := address.LocationX.GetOr(0.0)
|
lng := address.LocationX.GetOr(0.0)
|
||||||
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
|
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
|
||||||
} else if report.LocationLatitude.IsValue() && report.LocationLongitude.IsValue() {
|
} else if report.LocationLatitude.IsValue() && report.LocationLongitude.IsValue() {
|
||||||
|
|
@ -95,7 +95,7 @@ func SignalCreateFromPublicreport(ctx context.Context, user User, report_id stri
|
||||||
return nil, fmt.Errorf("find address from raw: %w", err)
|
return nil, fmt.Errorf("find address from raw: %w", err)
|
||||||
}
|
}
|
||||||
site_id = site.ID
|
site_id = site.ID
|
||||||
lat := address.LocationX.GetOr(0.0)
|
lat := address.LocationY.GetOr(0.0)
|
||||||
lng := address.LocationX.GetOr(0.0)
|
lng := address.LocationX.GetOr(0.0)
|
||||||
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
|
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,15 @@ GRANT USAGE ON SCHEMA fileupload TO "tegola";
|
||||||
GRANT USAGE ON SCHEMA import TO "tegola";
|
GRANT USAGE ON SCHEMA import TO "tegola";
|
||||||
GRANT USAGE ON SCHEMA publicreport TO "tegola";
|
GRANT USAGE ON SCHEMA publicreport TO "tegola";
|
||||||
GRANT SELECT ON address TO "tegola";
|
GRANT SELECT ON address TO "tegola";
|
||||||
|
GRANT SELECT ON feature TO "tegola";
|
||||||
|
GRANT SELECT ON feature_pool TO "tegola";
|
||||||
GRANT SELECT ON fileupload.pool TO "tegola";
|
GRANT SELECT ON fileupload.pool TO "tegola";
|
||||||
|
GRANT SELECT ON signal_pool TO "tegola";
|
||||||
GRANT SELECT ON h3_aggregation to "tegola";
|
GRANT SELECT ON h3_aggregation to "tegola";
|
||||||
GRANT SELECT ON organization TO "tegola";
|
GRANT SELECT ON organization TO "tegola";
|
||||||
GRANT SELECT ON publicreport.report_location TO "tegola";
|
GRANT SELECT ON publicreport.report TO "tegola";
|
||||||
|
GRANT SELECT ON signal TO "tegola";
|
||||||
|
GRANT SELECT ON site TO "tegola";
|
||||||
GRANT ALL PRIVILEGES ON SCHEMA public TO $1;
|
GRANT ALL PRIVILEGES ON SCHEMA public TO $1;
|
||||||
-- do import of district data
|
-- do import of district data
|
||||||
ALTER TABLE import.district ADD COLUMN geom_4326 geometry(MultiPolygon,4326) GENERATED ALWAYS AS (ST_Transform(geom, 4326)) STORED;
|
ALTER TABLE import.district ADD COLUMN geom_4326 geometry(MultiPolygon,4326) GENERATED ALWAYS AS (ST_Transform(geom, 4326)) STORED;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue