Skip to content

Commit

Permalink
fixing whitespaceing and srid errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dr4hcu5-jan committed Jan 4, 2024
1 parent 0100f66 commit 270d0f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions resources/queries.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- name: filter-locations
ST_CONTAINS(ST_COLLECT(ARRAY((SELECT geom FROM geodata.shapes WHERE key = any($1)))),ST_TRANSFORM(location, 4236));
ST_CONTAINS(ST_COLLECT(ARRAY((SELECT geom FROM geodata.shapes WHERE key = any($1)))),ST_TRANSFORM(location, 4326));

-- name: filter-reality
real = $1 OR real IS NULL;
Expand All @@ -9,7 +9,7 @@ active = $1 OR active IS NULL;

-- name: extended-usage-locations
SELECT
id, water_right, name, no, active, ST_ASGEOJSON(ST_TRANSFORM(location, 4236)) as location, basin_no, county,
id, water_right, name, no, active, ST_ASGEOJSON(ST_TRANSFORM(location, 4326)) as location, basin_no, county,
eu_survey_area, field,
groundwater_volume,
legal_scope, local_sub_district, maintenance_association, municipal_area, plot, real, rivershed, serial_no,
Expand All @@ -20,7 +20,7 @@ FROM

-- name: usage-locations
SELECT
id, water_right, name, no, active, ST_ASGEOJSON(ST_TRANSFORM(location, 4236)) as location, real
id, water_right, name, no, active, ST_ASGEOJSON(ST_TRANSFORM(location, 4326)) as location, real
FROM
nlwkn_water_rights.e_usage_locations;

Expand Down
12 changes: 6 additions & 6 deletions routes/locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func UsageLocations(w http.ResponseWriter, r *http.Request) {
}

if len(arguments) == 0 {
filter = fmt.Sprintf("WHERE %s", filter)
filter = fmt.Sprintf(" WHERE %s", filter)
} else {
filter = fmt.Sprintf("AND %s", filter)
filter = fmt.Sprintf(" AND %s", filter)
}

// now set the correct argument number
Expand All @@ -78,9 +78,9 @@ func UsageLocations(w http.ResponseWriter, r *http.Request) {
}

if len(arguments) == 0 {
filter = fmt.Sprintf("WHERE %s", filter)
filter = fmt.Sprintf(" WHERE %s", filter)
} else {
filter = fmt.Sprintf("AND %s", filter)
filter = fmt.Sprintf(" AND %s", filter)
}

// now set the correct argument number
Expand All @@ -98,9 +98,9 @@ func UsageLocations(w http.ResponseWriter, r *http.Request) {
}

if len(arguments) == 0 {
filter = fmt.Sprintf("WHERE %s", filter)
filter = fmt.Sprintf(" WHERE %s", filter)
} else {
filter = fmt.Sprintf("AND %s", filter)
filter = fmt.Sprintf(" AND %s", filter)
}

// now set the correct argument number
Expand Down

0 comments on commit 270d0f8

Please sign in to comment.