Skip to content

Commit

Permalink
Survey: update institutions_bboxes.json, include Landkreis in survey
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannaPeanut committed Jun 18, 2024
1 parent 4971512 commit a971812
Show file tree
Hide file tree
Showing 6 changed files with 1,672 additions and 640 deletions.
3 changes: 2 additions & 1 deletion src/survey-public/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ export type TResponseConfig = {
export type TProgress = Record<"SURVEY" | "MORE" | "FEEDBACK" | "EMAIL", number>

export type TInstitutionsBboxes = {
name: string
institution: string
landkreis: string
id: string
bbox: number[]
}[]
8 changes: 5 additions & 3 deletions src/survey-public/radnetz-brandenburg/SurveyBB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ const StartContent: React.FC = () => {
export const SurveyBB: React.FC<Props> = ({ surveyId }) => {
const router = useRouter()
const { id } = router.query
const name = institutions_bboxes.find((i) => i.id === id)?.name || "invalid"
const institution = institutions_bboxes.find((i) => i.id === id)?.institution || "invalid"
const landkreis = institutions_bboxes.find((i) => i.id === id)?.landkreis || "invalid"

// in survey radnetz-brandenburg, the institution id is passed as a query parameter in the original url sent to the user
// the institution name should appear in the survey response
Expand All @@ -213,11 +214,12 @@ export const SurveyBB: React.FC<Props> = ({ surveyId }) => {

// todo survey ? effect and dependency router?
useEffect(() => {
router.query.institution = encodeURIComponent(name)
router.query.institution = encodeURIComponent(institution)
router.query.landkreis = encodeURIComponent(landkreis)
void router.push({ query: router.query }, undefined, {
scroll: false,
})
}, [name, router.query.id])
}, [institution, landkreis, router.query.id])

return (
<SurveyMainPage
Expand Down
2 changes: 1 addition & 1 deletion src/survey-public/radnetz-brandenburg/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- get the csv file from fmc drive
- the csv should not contain any polish (or other non german) special characters
- check if it is utf8 encoded (open with excel or numbers) - in case it is not: export it as utf8 encoded csv
- transform to json - run `node src/survey-public/utils/csvToJson.js src/survey-public/radnetz-brandenburg/data/filename src/survey-public/radnetz-brandenburg/data/kvdaten_BB_bboxes_TEST.json`
- transform to json - run `node src/survey-public/utils/csvToJson.js src/survey-public/radnetz-brandenburg/data/filename src/survey-public/radnetz-brandenburg/data/institutions_bboxes.json`

### geodata for SurveyMap und SurveyMapLine.tsx

Expand Down
210 changes: 0 additions & 210 deletions src/survey-public/radnetz-brandenburg/data/bboxen_export_TESTDATEN.csv

This file was deleted.

Loading

0 comments on commit a971812

Please sign in to comment.