diff --git a/platform/signal.go b/platform/signal.go index 383b1875..996c44ca 100644 --- a/platform/signal.go +++ b/platform/signal.go @@ -68,7 +68,7 @@ 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.LocationX.GetOr(0.0) + lat := address.LocationY.GetOr(0.0) lng := address.LocationX.GetOr(0.0) location = fmt.Sprintf("POINT(%f %f)", lng, lat) } 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) } site_id = site.ID - lat := address.LocationX.GetOr(0.0) + lat := address.LocationY.GetOr(0.0) lng := address.LocationX.GetOr(0.0) location = fmt.Sprintf("POINT(%f %f)", lng, lat) } else { diff --git a/tools/drop-and-recreate.sql b/tools/drop-and-recreate.sql index f06c1c04..595aa5bc 100644 --- a/tools/drop-and-recreate.sql +++ b/tools/drop-and-recreate.sql @@ -12,10 +12,15 @@ GRANT USAGE ON SCHEMA fileupload TO "tegola"; GRANT USAGE ON SCHEMA import TO "tegola"; GRANT USAGE ON SCHEMA publicreport 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 signal_pool TO "tegola"; GRANT SELECT ON h3_aggregation 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; -- do import of district data ALTER TABLE import.district ADD COLUMN geom_4326 geometry(MultiPolygon,4326) GENERATED ALWAYS AS (ST_Transform(geom, 4326)) STORED;