From d3c98b5f483e1f0537d9adfceafaedec7790dbd6 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 22 Jun 2022 16:22:37 +0200 Subject: [PATCH] rm user docs on geofilters see https://git.mpib-berlin.mpg.de/castellum/documentation/-/merge_requests/112 --- docs/geo.md | 81 ++--------------------------------------------------- 1 file changed, 3 insertions(+), 78 deletions(-) diff --git a/docs/geo.md b/docs/geo.md index e7ef7f3d8..ed8a68b73 100644 --- a/docs/geo.md +++ b/docs/geo.md @@ -16,19 +16,7 @@ describes how this feature can be activated and used. castellum by default. However, some additional steps are needed. -## Example use case - -If the desired participants for a study should be older than 40 years -and live in an area where the noise from an airport is over 40dB you -would create and upload a GeoJSON file with a (multi)polygon spanning -the area where this condition applies. Afterwards proceed as usual with -setting the filter for age in the study filter UI. The resulting -subjects in the recruitment interface match the filter condition AND -their contact address is located inside the uploaded polygon. - -## Geocoding - -### Nominatim +## Set up Nominatim Nominatim is a free geocoder from the OpenStreetMap ecosystem. A public instance is available at . For bulk @@ -59,7 +47,8 @@ Further reading: - - -### Configure Castellum + +## Configure Castellum - Add `'django.contrib.gis'` and `'castellum.geofilters'` to `INSTALLED_APPS` @@ -78,67 +67,3 @@ Further reading: to determine if an address doesn't exist at all, is misspelled or can't be geocoded because it's not in the database used for geocoding. - - -## Create a geo filter - -### GeoJSON format - -Provide a valid [GeoJSON](https://tools.ietf.org/html/rfc7946) file with -a either a single feature or a feature collection of type "Polygon" or -"MultiPolygon". Castellum will then filter all subjects that live inside -this (multi)polygon, so it should enclose all areas where the conditions -for recruitment are met. Note that the Coordinate Reference System (CRS) -must be WGS84 (EPSG:4326). - -This is an example of a valid GeoJSON file: - -``` -{ - "type": "Feature", - "properties": {}, - "geometry": { - "type": "Polygon", - "coordinates": [[ - [13.3517429, 52.5189382], - [13.2908489, 52.5165476], - [13.3463410, 52.4848593], - [13.3512518, 52.4468630], - [13.3964313, 52.4785787], - [13.4627272, 52.4504546], - [13.4308069, 52.4893448], - [13.4730399, 52.5192370], - [13.4141102, 52.5180417], - [13.3821899, 52.5604549], - [13.3517429, 52.5189382] - ]] - } -} -``` - - is a simple tool to preview and edit GeoJSON. - -### How to convert a shapefile to GeoJSON - -Most Geographic Information Systems (GIS) such as QGIS or ArcGIS support -the conversion to GeoJSON out of the box. Desktop GIS applications -should automatically reproject the shapefile to WGS84 during the export -to GeoJSON format. - -### How to optimize GeoJSON for performance - -The duration of the calculation scales roughly linearly to the number of -vertices in the GeoJSON file. If the calculation takes too long, try to -reduce the number of vertices in the file. This can be achieved in two -ways: - -- Crop the spatial extent of your geographic data to the extent of the - area where the subjects live (or at least most of them). This makes - sense if most of your subjects are from the same city or state. -- Generalize your polygon. This reduces the amount of vertices while - retaining the general shape of the polygon. This makes sense of the - resolution of your data is very high. Remember that Castellum - derives the subjects' geolocations from their addresses, which refer - to houses. Therefore, a polygon with a resolution of 10cm has no - advantage over one with a resolution of 10m, as address data is - resolved to 10m at best, as determined by typical house sizes. -- GitLab