From 1ec214b79639719b28e3434003f27a3b3039ebba Mon Sep 17 00:00:00 2001 From: Dan Joseph Date: Mon, 24 Jun 2024 09:46:54 -0400 Subject: [PATCH 1/3] file and folder rename to current prj type convention --- .../compare_tutorial_damaged_buildings_haiti_screens.json} | 0 .../compare_tutorial_damaged_buildings_haiti_tasks.geojson} | 0 .../compare_tutorial_kutupalong.json} | 0 .../compare_tutorial_tasks_kutupalong.geojson} | 0 .../compare_tutorial_uganda_screens.json} | 0 .../compare_tutorial_uganda_tasks.geojson} | 0 mapswipe_workers/sample_data/{build_area => find}/README.md | 0 .../default_find_tutorial_screens.json} | 0 .../find_tutorial_tasks.geojson} | 0 .../{build_area => find}/solid_waste_tutorial_screens.json | 0 .../{build_area => find}/solid_waste_tutorial_screens_fr.json | 0 .../{build_area => find}/solid_waste_tutorial_tasks.geojson | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename mapswipe_workers/sample_data/{change_detection/change_detection_tutorial_damaged_buildings_haiti_screens.json => compare/compare_tutorial_damaged_buildings_haiti_screens.json} (100%) rename mapswipe_workers/sample_data/{change_detection/change_detection_tutorial_damaged_buildings_haiti_tasks.geojson => compare/compare_tutorial_damaged_buildings_haiti_tasks.geojson} (100%) rename mapswipe_workers/sample_data/{change_detection/change_detection_tutorial_kutupalong.json => compare/compare_tutorial_kutupalong.json} (100%) rename mapswipe_workers/sample_data/{change_detection/change_detection_tutorial_tasks_kutupalong.geojson => compare/compare_tutorial_tasks_kutupalong.geojson} (100%) rename mapswipe_workers/sample_data/{change_detection/change_detection_tutorial_uganda_screens.json => compare/compare_tutorial_uganda_screens.json} (100%) rename mapswipe_workers/sample_data/{change_detection/change_detection_tutorial_uganda_tasks.geojson => compare/compare_tutorial_uganda_tasks.geojson} (100%) rename mapswipe_workers/sample_data/{build_area => find}/README.md (100%) rename mapswipe_workers/sample_data/{build_area/default_build_area_tutorial_screens.json => find/default_find_tutorial_screens.json} (100%) rename mapswipe_workers/sample_data/{build_area/build_area_tutorial_tasks.geojson => find/find_tutorial_tasks.geojson} (100%) rename mapswipe_workers/sample_data/{build_area => find}/solid_waste_tutorial_screens.json (100%) rename mapswipe_workers/sample_data/{build_area => find}/solid_waste_tutorial_screens_fr.json (100%) rename mapswipe_workers/sample_data/{build_area => find}/solid_waste_tutorial_tasks.geojson (100%) diff --git a/mapswipe_workers/sample_data/change_detection/change_detection_tutorial_damaged_buildings_haiti_screens.json b/mapswipe_workers/sample_data/compare/compare_tutorial_damaged_buildings_haiti_screens.json similarity index 100% rename from mapswipe_workers/sample_data/change_detection/change_detection_tutorial_damaged_buildings_haiti_screens.json rename to mapswipe_workers/sample_data/compare/compare_tutorial_damaged_buildings_haiti_screens.json diff --git a/mapswipe_workers/sample_data/change_detection/change_detection_tutorial_damaged_buildings_haiti_tasks.geojson b/mapswipe_workers/sample_data/compare/compare_tutorial_damaged_buildings_haiti_tasks.geojson similarity index 100% rename from mapswipe_workers/sample_data/change_detection/change_detection_tutorial_damaged_buildings_haiti_tasks.geojson rename to mapswipe_workers/sample_data/compare/compare_tutorial_damaged_buildings_haiti_tasks.geojson diff --git a/mapswipe_workers/sample_data/change_detection/change_detection_tutorial_kutupalong.json b/mapswipe_workers/sample_data/compare/compare_tutorial_kutupalong.json similarity index 100% rename from mapswipe_workers/sample_data/change_detection/change_detection_tutorial_kutupalong.json rename to mapswipe_workers/sample_data/compare/compare_tutorial_kutupalong.json diff --git a/mapswipe_workers/sample_data/change_detection/change_detection_tutorial_tasks_kutupalong.geojson b/mapswipe_workers/sample_data/compare/compare_tutorial_tasks_kutupalong.geojson similarity index 100% rename from mapswipe_workers/sample_data/change_detection/change_detection_tutorial_tasks_kutupalong.geojson rename to mapswipe_workers/sample_data/compare/compare_tutorial_tasks_kutupalong.geojson diff --git a/mapswipe_workers/sample_data/change_detection/change_detection_tutorial_uganda_screens.json b/mapswipe_workers/sample_data/compare/compare_tutorial_uganda_screens.json similarity index 100% rename from mapswipe_workers/sample_data/change_detection/change_detection_tutorial_uganda_screens.json rename to mapswipe_workers/sample_data/compare/compare_tutorial_uganda_screens.json diff --git a/mapswipe_workers/sample_data/change_detection/change_detection_tutorial_uganda_tasks.geojson b/mapswipe_workers/sample_data/compare/compare_tutorial_uganda_tasks.geojson similarity index 100% rename from mapswipe_workers/sample_data/change_detection/change_detection_tutorial_uganda_tasks.geojson rename to mapswipe_workers/sample_data/compare/compare_tutorial_uganda_tasks.geojson diff --git a/mapswipe_workers/sample_data/build_area/README.md b/mapswipe_workers/sample_data/find/README.md similarity index 100% rename from mapswipe_workers/sample_data/build_area/README.md rename to mapswipe_workers/sample_data/find/README.md diff --git a/mapswipe_workers/sample_data/build_area/default_build_area_tutorial_screens.json b/mapswipe_workers/sample_data/find/default_find_tutorial_screens.json similarity index 100% rename from mapswipe_workers/sample_data/build_area/default_build_area_tutorial_screens.json rename to mapswipe_workers/sample_data/find/default_find_tutorial_screens.json diff --git a/mapswipe_workers/sample_data/build_area/build_area_tutorial_tasks.geojson b/mapswipe_workers/sample_data/find/find_tutorial_tasks.geojson similarity index 100% rename from mapswipe_workers/sample_data/build_area/build_area_tutorial_tasks.geojson rename to mapswipe_workers/sample_data/find/find_tutorial_tasks.geojson diff --git a/mapswipe_workers/sample_data/build_area/solid_waste_tutorial_screens.json b/mapswipe_workers/sample_data/find/solid_waste_tutorial_screens.json similarity index 100% rename from mapswipe_workers/sample_data/build_area/solid_waste_tutorial_screens.json rename to mapswipe_workers/sample_data/find/solid_waste_tutorial_screens.json diff --git a/mapswipe_workers/sample_data/build_area/solid_waste_tutorial_screens_fr.json b/mapswipe_workers/sample_data/find/solid_waste_tutorial_screens_fr.json similarity index 100% rename from mapswipe_workers/sample_data/build_area/solid_waste_tutorial_screens_fr.json rename to mapswipe_workers/sample_data/find/solid_waste_tutorial_screens_fr.json diff --git a/mapswipe_workers/sample_data/build_area/solid_waste_tutorial_tasks.geojson b/mapswipe_workers/sample_data/find/solid_waste_tutorial_tasks.geojson similarity index 100% rename from mapswipe_workers/sample_data/build_area/solid_waste_tutorial_tasks.geojson rename to mapswipe_workers/sample_data/find/solid_waste_tutorial_tasks.geojson From b5fef5e1b46257e4b4e6edc699e3594aedcaab85 Mon Sep 17 00:00:00 2001 From: Dan Joseph Date: Mon, 24 Jun 2024 09:51:29 -0400 Subject: [PATCH 2/3] delete .DS_Store macOS system file --- .DS_Store | Bin 16388 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 714ca0f7efadfd3790d49c3ef834a3d0932c3b4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16388 zcmeHOU2GIp6h5avbaqN*mI58Xg*By-VyOj-EDE?St$;vi>_1f3*`1-CI6Jf1ncY^g zT7wZaMkAV-m}nxX7>zt>G(MORjWIFtCn3hZ_+nzzCleoxPkQd1*=Bd4n>11jdT(;) z+@Evi=bP`|bMD<)0Ko2?z6~G-01{;;m3n{<%F*QjD#=1({VZRWs;LDjucKT;_5c}h zAPXKOAbpv(Xb=bp1Ox&C0fB%(;95X{`EE*5k+1h##8Dt15cuCCz~+Z2WhUc+obe@} zI_OYERn|}8zn`c~>j2&s4P-o!Grr`eWW!BK`lc8xG0-=s_9#;)84u))FMV@B-yATw zG6pLY+GTZ8NUpE1m+O_Vd|&^BGuiKHUe4{-vd4MN)Qx0N?$f-9LV18LGFR4;L#8pA zP*&}8Y)><7BU@xTHf-9uGuiFrY~3B}_s=(M>fS^`S>2a4@?_el*~XCRnn}|#y@#Yw zC?tgv%9@iWJKCZi8a`PTWjFMi6N znBWN}D`@oVbH~r9R0PO8I9YDK&&R3CDd6;d5l(7PSiU=3}A#HcWq|-4q1w-#FU%hTa^X9GFckaH_aKj2Eyi%5r5tz1To-mE<;3PwIRC7~? zt(*4vaGt?w83VSKHp10sLLqLorb(5@bUODDM`w1r@`2>{tZ!1)PTerySprs`ZOVLBVS^KTBI-K{RQ4R%-w{^89Nk@GLwB&%-Nl4lcm^@CkelU&2@LHGBiJ@DuzDzre5X zJN$*jBb0FkhH)h};*EF{HsdC2!FKG#+i@qxunQ03Av}yna0nBa#1!h7#z*i`d<0)B`e`S(;+;OG9}9s_|FsZhjEB4RLLtA?*c#7J+WynktkIJ?}Z zU*oFP0Ux{OUTWEEEanp@k4L2lx?wgFlI6wM4KcTubzd;0C-ITk#fb!>vTH z7~X+*;%@B4{Y0~Sh-d>uvk@G{V?;Cq$8iEp%%X>RoWv=798ckscp9G~+MU4{@g;l} zUn?Wrfil9KFC|==iz!tWwX2B0GCEfSx#e`p-u;}f7b9Pc{KX&n6$n^16V&h^(*>_M zWLjYSD#A||el8HSe}K0LV?`LdL}Bb=uHPCcil3U-YhLpUw;+aKd;istqILhcm>1c+ z7=R%rEiq{=(WF&ELb2`^>+VHfcLy_GS)^UTy$MIb97P3yg!2&2W9ghnWnv14A{@#h zJCq6pEORo|eCKhzcypn`UXbuRzTcU5x3(BZ@=ziP1S%oGKA~Z`hH`~rC!!e<%`9Cs zQ%mGr;9fNmRzx`>%2~`PM|{R|U3|tO_W$XVq$_{8Mbj$#?VnPN{RYrG|NsBEk~jzi z1Oop}1hA&3zo(m?t?)Tu`D3z0LX`3Ylv!eWGrr^|bYLp1ovkI9EcwGQ)#E|?j4!E$ W(!c&EfUEYon(+U^|6kv~|NjjV%rs;G From d23337ee01dec1d268e7fd499ea53d244a465c19 Mon Sep 17 00:00:00 2001 From: Dan Joseph Date: Mon, 24 Jun 2024 10:39:17 -0400 Subject: [PATCH 3/3] update guidance for creating new find tutorial --- mapswipe_workers/sample_data/find/README.md | 80 +++++++++++++-------- 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/mapswipe_workers/sample_data/find/README.md b/mapswipe_workers/sample_data/find/README.md index 0879a9d39..904b71ec7 100644 --- a/mapswipe_workers/sample_data/find/README.md +++ b/mapswipe_workers/sample_data/find/README.md @@ -1,48 +1,68 @@ # Creating a new 'Find' tutorial +## Use a MapSwipe dev project to establish the tutorial areas -## Create the tutorial areas +1. You will need a GeoJSON of the area covering all the of examples you would like your tutorial to include. You can quickly create a GeoJSON of an area using [https://geojson.io/](https://geojson.io/) if you do not have one already. +1. Use the GeoJSON to create a project on the dev server. You do this in order to generate the outlines of the individual tiles that make up the 3x2 grid on each MapSwipe screen (in both the projects and the tutorials). You will select from the generated grid file to define your tutorial pages. + - Make sure the **Project Type** is set to **Find**. + - You'll need to complete at least 1 mapping session later, so it's recommended that you set the **Group Size** to a small number. The smallest currently available is **10**. +1. Publish your project and complete one mapping session from the dev version of the MapSwipe app on your phone. **IMPORTANT:** Make sure you press 'Complete Session' at the end of your mapping to sync your results with the server. + +## Opening the area of interest in QGIS -1. Create a project on the dev server that covers the areas you want to use in your tutorial. - - Make sure the **Project Type** is set correctly. - - You'll need to complete at least 1 mapping session later, so it's recommended that you set the **Group Size** to a small number (such as 1 🙂). - - You can quickly create a GeoJSON of an area using https://geojson.io/ -1. Publish your project and complete one mapping session from the dev MapSwipe app on your phone. 1. Wait up to 60 minutes for the backend to run the generate stats workflow. Then download the file for your project from https://dev.mapswipe.org/api/tasks/ + - You will be able to identify your task by matching the **Project ID** from https://dev-managers.mapswipe.org/projects/ with the same ID on https://dev.mapswipe.org/api/tasks/. It should be near the bottom of the list as this list is sorted by recency. +1. Unzip the file (it will download as a `*.csv.gz` and you'll need to extract it to have the `*.csv` before use). 1. Open the file in [QGIS](https://qgis.org/en/site/) (or the GIS software of your choice). - - Unzip the file (it will download as a `*.csv.gz` and you'll need to extract is as a `.csv` before use). - - In QGIS you can go to **Layer** > **Add Layer** > **Add Delimited Text Layer...** then select your file then for **Geometry Definition** select **Well known text (WKT)** and set the **Geometry field** to `geom`. Your CSV should have a column with `geom` as the header and the cells populated with `MULTIPOLYGON(((` followed by a series of numbers. + - In QGIS you can go to **Layer** > **Add Layer** > **Add Delimited Text Layer...** then select your file. + - For **File Format**, make sure it is set to **CSV (comma separated values)**. + - Then for **Geometry Definition** select **Well known text (WKT)** and set the **Geometry field** to `geom`. Your CSV should have a column with `geom` as the header and the cells populated with `MULTIPOLYGON(((` followed by a series of numbers. This column defines the cells that you will use for your tutorial. - Large areas with lots of squares may load quite slowly. If you export/save the file as a GeoPackage and use that file in QGIS, then the performance as you move around the map and interact with the file should improve. -1. Keep the `task_id`, `tile_z`, `tile_x`, `tile_y` columns. Add numeric columns titled `screen` and `reference`. -1. Copy the squares for your tutorial to a new layer file. Copy them in sets of 6 - - NOTE: Squares must be copied in sets of 6 (2 wide x 3 tall) to match how they are shown in the app. - - To determine which squares to copy, load the same satellite imagery layer (e.g. Bing) that will be used in the tutorial into QGIS. -1. Populate the `screen` attribute for all squares. The numbers should match the order you want them displayed in the app. Each square in each group of 6 should have the same number. -1. Populate the `reference` attribute for all squares. The numbers should match the correct answer: `0` for no match, `1` for 1 tap (green) for a match, `2` for 2 taps (yellow) for maybe, `3` for 3 taps (red) for bad imagery. -## Create the tutorial screen prompts +## Bing imagery calibration in QGIS -1. Make a copy of the `default_build_area_tutorial_screens.json` file and rename for your tutorial. -1. There will be an object for each screen with a number key matching the screen number. -1. Each screen object will have objects for `instructions`, `hint`, and `success` - and each of those will have a `title`, `icon`, and `description` that can be set. - - The `title` and `description` are both free text. The title will appear first on the screen and be styled bold. - - For `icon` there is an option for each action the user can perform: `swipe-left` for continuing, `tap-1` for yes (green), `tap-2` for maybe (yellow), `tap-3` for bad imagery (red). And also `check` to shop a green-check success icon. - - A user taking the tutorial always sees the `instructions`. A **Show answers** button will appear if the user has tapped the number of times necessary to answer the screen correctly, but they have not answered correctly. For example, if the correct answer is 1 yellow square or 2 green squares (both scenarios requiring 2 taps), then **Show answers** will appear after 2 taps if the correct answer is not provided. After clicking the button, the user will see the `hint` texts. If the user answers correctly they are shown the `success` texts. A user will see either the `hint` or the `success` depending on their taps (but not both). +If you intend to use Bing Imagery for your task and tutorial, it is important to change the version of Bing Imagery you use to create your tutorial. The Python worker for the tutorial uses a g value of `g = 7505`. By default, the g value of Bing Imagery is `g = 1` in QGIS. Hence, it is imperative to make sure we change g value so that the tasks we set for our tutorial appear on the app as we have seen it on QGIS. + +1. Add a Bing Imagery layer to your project. +1. Right click on the layer, and press `Properties`, then `Source`. +1. In the URL, amend the URL from `http://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=1` to `http://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=7505`. +1. Press `Apply`, then `OK`. -## Create the example images +## Selecting tiles from the area for your tutorial -1. The second screen of the tutorial will have 2 images. When uploading the tutorial, you will be able to set "You are looking for \_\_\_\_\_" but will be limited to 15 characters. The other text on the screen is not adjustable, so you will need a picture of the target feature from the ground and from above. - - The pictures will be cropped to a specific ratio in the app. To avoid unexpected results, create images that are approximate 1940 width x 780 height. +1. Export the `.csv` layer as a `GeoJSON`. +1. Open the Attribute Table of the `GeoJSON` and toggle editing mode. +1. Keep the `task_id`, `tile_z`, `tile_x`, `tile_y` columns and delete all other columns. +1. Add **Integer (32 bit)** columns titled `screen` and `reference`. +1. Change the **Symbology** style of the `GeoJSON` to a style with no fill so you can see the imagery through the tiles. +1. Select the squares you want to use for your tutorial. **NOTE:** Squares must be copied in sets of 6 (2 wide x 3 tall) to match how they are shown in the app. +1. Export just the **Selected Features** as a new GeoJSON layer. -## Test the tutorial on the dev server +## Adding `screen` and `reference` attributes to selected tiles -1. Login to https://dev.mapswipe.org/ and selecte **CREATE TUTORIAL**. +1. Open the attribute table of the newest `GeoJSON` layer, and toggle editing. +1. Populate the `screen` attribute for all squares. The numbers should match the order you want them displayed in the app. Each square in each group of 6 should have the same number. +1. Populate the `reference` attribute for all squares. The numbers should match the correct answer: `0` for no match, `1` for 1 tap (green) for a match, `2` for 2 taps (yellow) for maybe, `3` for 3 taps (red) for bad imagery. +1. Populate these fields for all of the tiles you have in your newest `GeoJSON` layer, and **Save** the layer. + +## Create and test the tutorial on the dev server + +1. Go to https://dev-managers.mapswipe.org/ +1. Select **Project** and then **Add New Tutorial**. 1. Check that **Project Type** is set to **Find**. -1. Set **Look For** - this will show up on the second screen of the tutorial. -1. Set the **Name** - you should include a number that you can increment in case you need to make an edit and upload a new version. -1. Upload your JSON tutorial text file, GEOJSON tutorial tasks file, 2 images, set your zoom level, and set the tile server. Click **Submit** and wait for about 5 minutes. +1. Fill in the **Name of the Tutorial**. You should include a number that you can increment in case you need to make an edit and upload a new version. +1. Fill in the **Look For**. This will show up on the second screen of the tutorial. +1. You can add Information Pages. They can have 1, 2, or 3 pictures will accompanying text. Select which type page(s) you want to add from the **Add Page** dropdown. Then populate the text fields and upload image(s). You'll be able to preview the page. Note that will longer text and more pictures, the user will have to scroll to read everything and may miss important information. +1. Upload your `GeoJSON` you just created where it says **Scenario Pages**. + - You should see your selections from in QGIS, ordered according to the value you used for `screen`, and colour coordinated depending on the numbers you used in the `reference` column. +1. Fill in the `Title`, `Icon`, `Description` for each of the scenarios. + - Each scenario page screen will have objects for `instructions`, `hint`, and `success` - and each of those will have a `title`, `icon`, and `description` that can be set. + - The `title` and `description` are both free text. The title will appear first on the screen and be styled bold. + - For `icon` there is an option for each action the user can perform: `swipe-left` for continuing, `tap-1` for yes (green), `tap-2` for maybe (yellow), `tap-3` for bad imagery (red). And also `check` to show a green-check success icon. + - A user taking the tutorial always sees the `instructions`. A **Show answers** button will appear if the user has tapped the number of times necessary to answer the screen correctly, but they have not answered correctly. For example, if the correct answer is 1 yellow square or 2 green squares (both scenarios requiring 2 taps), then **Show answers** will appear after 2 taps if the correct answer is not provided. After clicking the button, the user will see the `hint` texts. If the user answers correctly they are shown the `success` texts. A user will see either the `hint` or the `success` depending on their taps (but not both). +1. Click **Submit** and wait for about 5 minutes. 1. Create a project and set it to use the new tutorial. Check that it works how you expect in the dev app. ## Upload the tutorial to production -1. Repeat the steps from the dev server to upload your new tutorial to the production app. +1. Repeat the steps from the dev server to upload your new tutorial to the production server.