diff --git a/tests/projects/conflation/cassette/TestConflationProjectE2E.test_conflation_project_e2e.yaml b/tests/projects/conflation/cassette/TestConflationProjectE2E.test_conflation_project_e2e.yaml new file mode 100644 index 0000000..f12c3f1 --- /dev/null +++ b/tests/projects/conflation/cassette/TestConflationProjectE2E.test_conflation_project_e2e.yaml @@ -0,0 +1,179 @@ +interactions: + - request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.5 + method: GET + uri: https://drive.google.com/uc?export=download&id=10e50MsbO8BdKVwsjRFmoQQzharX_Am2f + response: + body: + string: '' + headers: + Accept-CH: + - Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Full-Version, Sec-CH-UA-Full-Version-List, + Sec-CH-UA-Model, Sec-CH-UA-WoW64, Sec-CH-UA-Form-Factors, Sec-CH-UA-Platform, + Sec-CH-UA-Platform-Version + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - '0' + Content-Security-Policy: + - script-src 'nonce-7pwRZRdV3luL9vhndcbIWQ' 'unsafe-inline';object-src 'none';base-uri + 'self';report-uri /_/DriveUntrustedContentHttp/cspreport;worker-src 'self' + - require-trusted-types-for 'script';report-uri /_/DriveUntrustedContentHttp/cspreport + Content-Type: + - application/binary + Cross-Origin-Opener-Policy: + - same-origin + Date: + - Wed, 21 Jan 2026 15:36:50 GMT + Expires: + - Mon, 01 Jan 1990 00:00:00 GMT + Location: + - https://drive.usercontent.google.com/download?id=10e50MsbO8BdKVwsjRFmoQQzharX_Am2f&export=download + Permissions-Policy: + - ch-ua-arch=*, ch-ua-bitness=*, ch-ua-full-version=*, ch-ua-full-version-list=*, + ch-ua-model=*, ch-ua-wow64=*, ch-ua-form-factors=*, ch-ua-platform=*, ch-ua-platform-version=* + Pragma: + - no-cache + Server: + - ESF + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + status: + code: 303 + message: See Other + - request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.5 + method: GET + uri: https://drive.usercontent.google.com/download?id=10e50MsbO8BdKVwsjRFmoQQzharX_Am2f&export=download + response: + body: + string: '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"coordinates":[[[-99.09607039754393,19.42606297126916],[-99.09607039754393,19.42583707815382],[-99.09587079004991,19.42583707815382],[-99.09587079004991,19.42606297126916],[-99.09607039754393,19.42606297126916]]],"type":"Polygon"}},{"type":"Feature","properties":{},"geometry":{"coordinates":[[[-99.096234519261,19.42567393293139],[-99.096234519261,19.42543967283784],[-99.09605709037753,19.42543967283784],[-99.09605709037753,19.42567393293139],[-99.096234519261,19.42567393293139]]],"type":"Polygon"}},{"type":"Feature","properties":{},"geometry":{"coordinates":[[[-99.09455578224427,19.42536198674972],[-99.09455578224427,19.42495865737405],[-99.09425641045227,19.42495865737405],[-99.09425641045227,19.42536198674972],[-99.09455578224427,19.42536198674972]]],"type":"Polygon"}},{"type":"Feature","properties":{},"geometry":{"coordinates":[[[-99.09346758953988,19.42222047258528],[-99.09346758953988,19.422018804123567],[-99.09335354314331,19.422018804123567],[-99.09335354314331,19.42222047258528],[-99.09346758953988,19.42222047258528]]],"type":"Polygon"}}]}' + headers: + Accept-Ranges: + - bytes + Access-Control-Allow-Credentials: + - 'false' + Access-Control-Allow-Headers: + - Accept, Accept-Language, Authorization, Cache-Control, Content-Disposition, + Content-Encoding, Content-Language, Content-Length, Content-MD5, Content-Range, + Content-Type, Date, developer-token, financial-institution-id, X-Goog-Sn-Metadata, + X-Goog-Sn-PatientId, GData-Version, google-cloud-resource-prefix, linked-customer-id, + login-customer-id, x-goog-request-params, Host, If-Match, If-Modified-Since, + If-None-Match, If-Unmodified-Since, Origin, OriginToken, Pragma, Range, request-id, + Signature, Signature-Agent, Signature-Input, Slug, Transfer-Encoding, User-Agent, + hotrod-board-name, hotrod-chrome-cpu-model, hotrod-chrome-processors, Want-Digest, + X-Ad-Manager-Impersonation, x-chrome-connected, X-ClientDetails, X-Client-Pctx, + X-Client-Version, x-debug-settings-metadata, X-Firebase-AppId, X-Firebase-AppVersion, + X-Firebase-Locale, X-Goog-Firebase-Installations-Auth, X-Firebase-Client, + X-Firebase-Client-Log-Type, X-Firebase-GMPID, X-Firebase-Auth-Token, X-Firebase-AppCheck, + X-Firebase-RC-Fetch-Type, X-Firebase-Token, X-Goog-Drive-Client-Version, X-Goog-Drive-Resource-Keys, + X-GData-Client, X-GData-Key, X-GoogApps-Allowed-Domains, X-Goog-AdX-Buyer-Impersonation, + X-Goog-Api-Client, X-Goog-Visibilities, X-Goog-AuthUser, X-Google-EOM, x-goog-ext-124712974-jspb, + x-goog-ext-467253834-jspb, x-goog-ext-353267353-bin, x-goog-ext-353267353-jspb, + x-goog-ext-251363160-jspb, x-goog-ext-259736195-jspb, x-goog-ext-477772811-jspb, + x-goog-ext-359275022-bin, x-goog-ext-328800237-jspb, x-goog-ext-198889211-bin, + x-goog-ext-202735639-bin, x-goog-ext-223261916-bin, x-goog-ext-223435598-bin, + x-goog-ext-233818517-bin, x-goog-ext-202964622-bin, X-Goog-PageId, X-Goog-Encode-Response-If-Executable, + X-Goog-Correlation-Id, X-Goog-Request-Info, X-Goog-Request-Reason, X-Goog-Request-Time, + X-Goog-Experiments, x-goog-iam-authority-selector, x-goog-iam-authorization-token, + X-Goog-Spatula, X-Goog-Travel-Bgr, X-Goog-Travel-Settings, X-Goog-Upload-Command, + X-Goog-Upload-Content-Disposition, X-Goog-Upload-Content-Length, X-Goog-Upload-Content-Type, + X-Goog-Upload-File-Name, X-Goog-Upload-Header-Content-Encoding, X-Goog-Upload-Header-Content-Length, + X-Goog-Upload-Header-Content-Type, X-Goog-Upload-Header-Transfer-Encoding, + X-Goog-Upload-Offset, X-Goog-Upload-Protocol, x-goog-user-project, X-Goog-Visitor-Id, + X-Goog-FieldMask, X-Google-Project-Override, x-goog-maps-api-salt, x-goog-maps-api-signature, + x-goog-maps-client-id, X-Goog-Api-Key, x-goog-spanner-database-role, X-HTTP-Method-Override, + X-JavaScript-User-Agent, X-Pan-Versionid, X-Proxied-User-IP, X-Origin, X-Referer, + X-Requested-With, X-Stadia-Client-Context, X-Upload-Content-Length, X-Upload-Content-Type, + X-Use-Alt-Service, X-Use-HTTP-Status-Code-Override, X-Ios-Bundle-Identifier, + X-Places-Ios-Sdk, X-Android-Package, X-Android-Cert, X-Places-Android-Sdk, + X-Goog-Maps-Ios-Uuid, X-Goog-Maps-Android-Uuid, X-Ariane-Xsrf-Token, X-YouTube-Bootstrap-Logged-In, + X-Youtube-Client-Name, X-Youtube-Client-Version, X-Youtube-Finch-Config-Data, + X-Youtube-Finch-Hash-Data, X-YouTube-Lava-Device-Context, X-YouTube-VVT, X-YouTube-Page-CL, + X-YouTube-Page-Label, X-YouTube-Page-Timestamp, X-Compass-Routing-Destination, + x-framework-xsrf-token, X-Goog-Meeting-ABR, X-Goog-Meeting-Botguardid, X-Goog-Meeting-Bot-Info, + X-Goog-Meeting-ClientInfo, X-Goog-Meeting-ClientVersion, X-Goog-Meeting-Debugid, + X-Goog-Meeting-Identifier, X-Goog-Meeting-Interop-Cohorts, X-Goog-Meeting-Interop-Type, + X-Goog-Meeting-OidcIdToken, X-Goog-Meeting-RtcClient, X-Goog-Meeting-StartSource, + X-Goog-Meeting-Token, X-Goog-Meeting-Viewer-Token, X-Goog-Healthcare-Audit-First-Party-Application-Access, + Prefer, X-Client-Data, x-sdm-id-token, X-Sfdc-Authorization, MIME-Version, + Content-Transfer-Encoding, X-Earth-Engine-App-ID-Token, X-Earth-Engine-Computation-Profile, + X-Earth-Engine-Computation-Profiling, X-Play-Console-Experiments-Override, + X-Play-Console-Session-Id, x-alkali-account-key, x-alkali-application-key, + x-alkali-auth-apps-namespace, x-alkali-auth-entities-namespace, x-alkali-auth-entity, + x-alkali-client-locale, EES-S7E-MODE, cast-device-capabilities, X-Server-Timeout, + x-foyer-client-environment, x-goog-greenenergyuserappservice-metadata, x-goog-sherlog-context, + X-Server-Token, x-rfui-request-context, x-goog-nest-jwt, X-Cloud-Trace-Context, + traceparent, x-goog-chat-space-id, x-goog-pan-request-context, X-AppInt-Credentials + Access-Control-Allow-Methods: + - GET,HEAD,OPTIONS + Access-Control-Allow-Origin: + - '*' + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + Cache-Control: + - private, max-age=0 + Content-Disposition: + - attachment; filename="features.geojson" + Content-Length: + - '1149' + Content-Security-Policy: + - sandbox + - default-src 'none' + - frame-ancestors 'none' + Content-Type: + - application/octet-stream + Cross-Origin-Embedder-Policy: + - require-corp + Cross-Origin-Opener-Policy: + - same-origin + Cross-Origin-Resource-Policy: + - same-site + Date: + - Wed, 21 Jan 2026 15:36:51 GMT + Expires: + - Wed, 21 Jan 2026 15:36:51 GMT + Last-Modified: + - Wed, 21 Jan 2026 14:21:46 GMT + Server: + - UploadServer + X-Content-Security-Policy: + - sandbox + X-Content-Type-Options: + - nosniff + X-GUploader-UploadID: + - AJRbA5W0Cq-k7b04ZdoF-OEEtJyLFxuomTtLGeiLvKTkgGpAeQ-XxE3t9sHHaCLfGf3eqnU + X-Goog-Hash: + - crc32c=hrZfGQ== + status: + code: 200 + message: OK +version: 1 diff --git a/tests/projects/conflation/cover_image.jpg b/tests/projects/conflation/cover_image.jpg new file mode 100644 index 0000000..3188304 Binary files /dev/null and b/tests/projects/conflation/cover_image.jpg differ diff --git a/tests/projects/conflation/exports/expected_project_aggregated_result_modified.csv b/tests/projects/conflation/exports/expected_project_aggregated_result_modified.csv new file mode 100644 index 0000000..9329342 --- /dev/null +++ b/tests/projects/conflation/exports/expected_project_aggregated_result_modified.csv @@ -0,0 +1,5 @@ +idx,task_id,0_count,1_count,2_count,3_count,total_count,0_share,1_share,2_share,3_share,agreement,quadkey,geom,tile_z,reference +0,t1,0,1,0,0,1,0.0,1.0,0.0,0.0,,,"MULTIPOLYGON(((-99.0960703975439 19.4260629712692,-99.0960703975439 19.4258370781538,-99.0958707900499 19.4258370781538,-99.0958707900499 19.4260629712692,-99.0960703975439 19.4260629712692)))",,"[{""numberIntersecting"": 0}]" +1,t2,1,0,0,0,1,1.0,0.0,0.0,0.0,,,"MULTIPOLYGON(((-99.096234519261 19.4256739329314,-99.096234519261 19.4254396728378,-99.0960570903775 19.4254396728378,-99.0960570903775 19.4256739329314,-99.096234519261 19.4256739329314)))",,"[{""numberIntersecting"": 0}]" +2,t3,1,0,0,0,1,1.0,0.0,0.0,0.0,,,"MULTIPOLYGON(((-99.0945557822443 19.4253619867497,-99.0945557822443 19.424958657374,-99.0942564104523 19.424958657374,-99.0942564104523 19.4253619867497,-99.0945557822443 19.4253619867497)))",,"[{""osmId"": 1158869168, ""osmType"": ""ways_poly"", ""version"": 1, ""numberIntersecting"": 1}]" +3,t4,0,0,0,1,1,0.0,0.0,0.0,1.0,,,"MULTIPOLYGON(((-99.0934675895399 19.4222204725853,-99.0934675895399 19.4220188041236,-99.0933535431433 19.4220188041236,-99.0933535431433 19.4222204725853,-99.0934675895399 19.4222204725853)))",,"[{""numberIntersecting"": 4}]" diff --git a/tests/projects/conflation/exports/expected_project_aggregated_result_with_geometry_modified.geojson b/tests/projects/conflation/exports/expected_project_aggregated_result_with_geometry_modified.geojson new file mode 100644 index 0000000..39158c8 --- /dev/null +++ b/tests/projects/conflation/exports/expected_project_aggregated_result_with_geometry_modified.geojson @@ -0,0 +1,137 @@ +{ + "type": "FeatureCollection", + "name": "tmp4mcoqzc0", + "features": [ + { + "type": "Feature", + "properties": { + "idx": 0.0, + "task_id": "t1", + "0_count": 0.0, + "1_count": 1.0, + "2_count": 0.0, + "3_count": 0.0, + "total_count": 1.0, + "0_share": 0.0, + "1_share": 1.0, + "2_share": 0.0, + "3_share": 0.0, + "reference": [{ "numberIntersecting": 0 }] + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-99.0960703975439, 19.4260629712692], + [-99.0960703975439, 19.4258370781538], + [-99.0958707900499, 19.4258370781538], + [-99.0958707900499, 19.4260629712692], + [-99.0960703975439, 19.4260629712692] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "idx": 1.0, + "task_id": "t2", + "0_count": 1.0, + "1_count": 0.0, + "2_count": 0.0, + "3_count": 0.0, + "total_count": 1.0, + "0_share": 1.0, + "1_share": 0.0, + "2_share": 0.0, + "3_share": 0.0, + "reference": [{ "numberIntersecting": 0 }] + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-99.096234519261, 19.4256739329314], + [-99.096234519261, 19.4254396728378], + [-99.0960570903775, 19.4254396728378], + [-99.0960570903775, 19.4256739329314], + [-99.096234519261, 19.4256739329314] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "idx": 2.0, + "task_id": "t3", + "0_count": 1.0, + "1_count": 0.0, + "2_count": 0.0, + "3_count": 0.0, + "total_count": 1.0, + "0_share": 1.0, + "1_share": 0.0, + "2_share": 0.0, + "3_share": 0.0, + "reference": [ + { + "osmId": 1158869168, + "osmType": "ways_poly", + "version": 1, + "numberIntersecting": 1 + } + ] + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-99.0945557822443, 19.4253619867497], + [-99.0945557822443, 19.424958657374], + [-99.0942564104523, 19.424958657374], + [-99.0942564104523, 19.4253619867497], + [-99.0945557822443, 19.4253619867497] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "idx": 3.0, + "task_id": "t4", + "0_count": 0.0, + "1_count": 0.0, + "2_count": 0.0, + "3_count": 1.0, + "total_count": 1.0, + "0_share": 0.0, + "1_share": 0.0, + "2_share": 0.0, + "3_share": 1.0, + "reference": [{ "numberIntersecting": 4 }] + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-99.0934675895399, 19.4222204725853], + [-99.0934675895399, 19.4220188041236], + [-99.0933535431433, 19.4220188041236], + [-99.0933535431433, 19.4222204725853], + [-99.0934675895399, 19.4222204725853] + ] + ] + ] + } + } + ] +} diff --git a/tests/projects/conflation/exports/expected_project_groups_modified.csv b/tests/projects/conflation/exports/expected_project_groups_modified.csv new file mode 100644 index 0000000..beb5554 --- /dev/null +++ b/tests/projects/conflation/exports/expected_project_groups_modified.csv @@ -0,0 +1,2 @@ +,group_id,project_id,number_of_tasks,required_count,finished_count,progress,total_area,time_spent_max_allowed,number_of_users_required +0,g100,01K339HAWZCTCBRVQMQFWRTHXX,4,3,0,0,0.0026785353186614,24.4,3 diff --git a/tests/projects/conflation/exports/expected_project_history.csv b/tests/projects/conflation/exports/expected_project_history.csv new file mode 100644 index 0000000..9608953 --- /dev/null +++ b/tests/projects/conflation/exports/expected_project_history.csv @@ -0,0 +1,2 @@ +day,number_of_results,number_of_results_progress,cum_number_of_results,cum_number_of_results_progress,progress,cum_progress,number_of_users,number_of_new_users,cum_number_of_users,project_id +2026-01-21,4,4,4,4,0.3333333333333333,0.3333333333333333,1,1,1,01K339HAWZCTCBRVQMQFWRTHXX diff --git a/tests/projects/conflation/exports/expected_project_result_modified.csv b/tests/projects/conflation/exports/expected_project_result_modified.csv new file mode 100644 index 0000000..972caaa --- /dev/null +++ b/tests/projects/conflation/exports/expected_project_result_modified.csv @@ -0,0 +1,5 @@ +,project_id,group_id,task_id,user_id,timestamp,start_time,end_time,app_version,client_type,result,reference,username +0,01K339HAWZCTCBRVQMQFWRTHXX,g100,t1,01K6CPB1ETTF7MT9EAAQDQM4A9,2026-01-21 14:38:10.783+00,2026-01-21 14:38:10.783+00,2026-01-21 14:38:33.619+00,0.3.0-dev,web,1,"{""numberIntersecting"": 0}",Ram Bahadur +1,01K339HAWZCTCBRVQMQFWRTHXX,g100,t2,01K6CPB1ETTF7MT9EAAQDQM4A9,2026-01-21 14:38:10.783+00,2026-01-21 14:38:10.783+00,2026-01-21 14:38:33.619+00,0.3.0-dev,web,0,"{""numberIntersecting"": 0}",Ram Bahadur +2,01K339HAWZCTCBRVQMQFWRTHXX,g100,t3,01K6CPB1ETTF7MT9EAAQDQM4A9,2026-01-21 14:38:10.783+00,2026-01-21 14:38:10.783+00,2026-01-21 14:38:33.619+00,0.3.0-dev,web,0,"{""osmId"": 1158869168, ""osmType"": ""ways_poly"", ""version"": 1, ""numberIntersecting"": 1}",Ram Bahadur +3,01K339HAWZCTCBRVQMQFWRTHXX,g100,t4,01K6CPB1ETTF7MT9EAAQDQM4A9,2026-01-21 14:38:10.783+00,2026-01-21 14:38:10.783+00,2026-01-21 14:38:33.619+00,0.3.0-dev,web,3,"{""numberIntersecting"": 4}",Ram Bahadur diff --git a/tests/projects/conflation/exports/expected_project_tasks_modified.csv b/tests/projects/conflation/exports/expected_project_tasks_modified.csv new file mode 100644 index 0000000..5470fd9 --- /dev/null +++ b/tests/projects/conflation/exports/expected_project_tasks_modified.csv @@ -0,0 +1,5 @@ +,project_id,group_id,task_id,geom,tile_z +0,01K339HAWZCTCBRVQMQFWRTHXX,g100,t1,"MULTIPOLYGON(((-99.0960703975439 19.4260629712692,-99.0960703975439 19.4258370781538,-99.0958707900499 19.4258370781538,-99.0958707900499 19.4260629712692,-99.0960703975439 19.4260629712692)))", +1,01K339HAWZCTCBRVQMQFWRTHXX,g100,t2,"MULTIPOLYGON(((-99.096234519261 19.4256739329314,-99.096234519261 19.4254396728378,-99.0960570903775 19.4254396728378,-99.0960570903775 19.4256739329314,-99.096234519261 19.4256739329314)))", +2,01K339HAWZCTCBRVQMQFWRTHXX,g100,t3,"MULTIPOLYGON(((-99.0945557822443 19.4253619867497,-99.0945557822443 19.424958657374,-99.0942564104523 19.424958657374,-99.0942564104523 19.4253619867497,-99.0945557822443 19.4253619867497)))", +3,01K339HAWZCTCBRVQMQFWRTHXX,g100,t4,"MULTIPOLYGON(((-99.0934675895399 19.4222204725853,-99.0934675895399 19.4220188041236,-99.0933535431433 19.4220188041236,-99.0933535431433 19.4222204725853,-99.0934675895399 19.4222204725853)))", diff --git a/tests/projects/conflation/exports/expected_project_users.csv b/tests/projects/conflation/exports/expected_project_users.csv new file mode 100644 index 0000000..ec18913 --- /dev/null +++ b/tests/projects/conflation/exports/expected_project_users.csv @@ -0,0 +1,2 @@ +idx,project_id,user_id,username,groups_completed,total_contributions,agreeing_contributions,disagreeing_contributions,simple_agreement_score +0,01K339HAWZCTCBRVQMQFWRTHXX,01K6CPB1ETTF7MT9EAAQDQM4A9,Ram Bahadur,1,4,0,0, diff --git a/tests/projects/conflation/features.geojson b/tests/projects/conflation/features.geojson new file mode 100644 index 0000000..ba33346 --- /dev/null +++ b/tests/projects/conflation/features.geojson @@ -0,0 +1,69 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + [-99.09607039754393, 19.42606297126916], + [-99.09607039754393, 19.42583707815382], + [-99.09587079004991, 19.42583707815382], + [-99.09587079004991, 19.42606297126916], + [-99.09607039754393, 19.42606297126916] + ] + ], + "type": "Polygon" + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + [-99.096234519261, 19.42567393293139], + [-99.096234519261, 19.42543967283784], + [-99.09605709037753, 19.42543967283784], + [-99.09605709037753, 19.42567393293139], + [-99.096234519261, 19.42567393293139] + ] + ], + "type": "Polygon" + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + [-99.09455578224427, 19.42536198674972], + [-99.09455578224427, 19.42495865737405], + [-99.09425641045227, 19.42495865737405], + [-99.09425641045227, 19.42536198674972], + [-99.09455578224427, 19.42536198674972] + ] + ], + "type": "Polygon" + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + [-99.09346758953988, 19.42222047258528], + [-99.09346758953988, 19.422018804123567], + [-99.09335354314331, 19.422018804123567], + [-99.09335354314331, 19.42222047258528], + [-99.09346758953988, 19.42222047258528] + ] + ], + "type": "Polygon" + } + } + ] +} diff --git a/tests/projects/conflation/project_data.json5 b/tests/projects/conflation/project_data.json5 new file mode 100644 index 0000000..89325af --- /dev/null +++ b/tests/projects/conflation/project_data.json5 @@ -0,0 +1,385 @@ +{ + contributor_user_firebase_id: '01K6CPB1ETTF7MT9EAAQDQM4A9', + assets: { + image: 'assets/tests/projects/conflation/cover_image.jpg', + }, + // Create organization + create_organization: { + clientId: '01K6CKWDFX8HZFY5PHJZN1AYH9', + name: 'Togglecorp', + description: 'Togglecorp (test) organization', + }, + // Create tutorial + create_tutorial: { + clientId: '01K4MQ88R61EDAMS0K0TW0N17A', + name: 'Conflation Tutorial', + }, + update_tutorial: { + clientId: '01K4MQ88R61EDAMS0K0TW0N17A', + name: 'Conflation Tutorial', + scenarios: [ + { + create: { + clientId: '01K4S0NP93KN45MAX2Z5N6PVGX', + hintDescription: 'Click Yes', + hintIcon: 'HELP_OUTLINE', + hintTitle: 'This building looks correct', + instructionsDescription: 'This building looks correct', + instructionsIcon: 'CLOSE_OUTLINE', + instructionsTitle: 'Correct building', + scenarioPageNumber: 1, + successDescription: 'This building is correct', + successIcon: 'CHECKMARK_OUTLINE', + successTitle: 'Well done', + tasks: [ + { + clientId: '01K4S0NP93AQKZ6S558VPVQS19', + projectTypeSpecifics: { + conflation: { + identifier: 1098299960, + objectGeometry: '{"type":"Polygon","coordinates":[[[84.001574,28.1935348],[84.001576,28.1934266],[84.0016578,28.1934278],[84.0016558,28.1935359],[84.001574,28.1935348]]]}', + }, + }, + reference: 1, + }, + ], + }, + }, + ], + informationPages: [ + { + create: { + clientId: '01K4S214M1SSN4N862GYP0BA12', + pageNumber: 1, + title: 'Compare building footprints', + blocks: [ + { + blockNumber: 1, + blockType: 'TEXT', + clientId: '01K4S21NP6BG28SYXV0W6EYRVZ', + text: 'It might look something like this as well', + }, + { + blockNumber: 2, + blockType: 'TEXT', + clientId: '01K4S21W8S2EMAH4GQZRXPPE6K', + text: 'It might look something like this as well', + }, + ], + }, + }, + ], + }, + // Create project + create_project: { + clientId: '01K339HAWZCTCBRVQMQFWRTHXX', + topic: 'fAIr', + region: 'Manbhawan', + projectNumber: 2, + projectType: 'CONFLATION', + projectInstruction: 'Compare buildings', + lookFor: 'building', + description: 'This is a conflation project.', + requestingOrganization: 'Togglecorp', + }, + update_project: { + clientId: '01K339HAWZCTCBRVQMQFWRTHXX', + additionalInfoUrl: 'https://fair.hotosm.org', + description: 'This is a conflation project with an extended description', + verificationNumber: 3, + projectInstruction: 'Compare buildings', + groupSize: 25, + team: null, + topic: 'fAIr', + tutorial: null, + maxTasksPerUser: 30, + projectNumber: 2, + region: 'Manbhawan', + image: null, + projectTypeSpecifics: { + conflation: { + objectSource: { + objectGeojsonUrl: 'https://drive.google.com/uc?export=download&id=10e50MsbO8BdKVwsjRFmoQQzharX_Am2f', + }, + tileServerProperty: { + name: 'BING', + bing: { + credits: '© 2019 Microsoft Corporation, Earthstar Geographics SIO', + }, + }, + }, + }, + }, + update_processed_project: { + clientId: '01K339HAWZCTCBRVQMQFWRTHXX', + additionalInfoUrl: 'https://fair.hotosm.org', + description: 'This is a conflation project with an extended description', + projectInstruction: 'Compare buildings', + projectNumber: 2, + region: 'Manbhawan', + topic: 'fAIr', + // NOTE: These values will be injected by test scripts + image: null, + tutorial: null, + team: null, + }, + // Expected tutorial + expected_tutorial_data: { + contributorCount: 0, + informationPages: [ + { + blocks: [ + { + blockNumber: 1, + blockType: 'text', + textDescription: 'It might look something like this as well', + }, + { + blockNumber: 2, + blockType: 'text', + textDescription: 'It might look something like this as well', + }, + ], + pageNumber: 1, + title: 'Compare building footprints', + }, + ], + inputGeometries: '', + lookFor: 'building', + name: 'Conflation Tutorial', + progress: 0, + projectDetails: 'This is a conflation project with an extended description', + projectId: 'tutorial_01K4MQ88R61EDAMS0K0TW0N17A', + projectTopicKey: 'conflation tutorial', + projectType: 8, + screens: [ + { + hint: { + description: 'Click Yes', + icon: 'help-outline', + title: 'This building looks correct', + }, + instructions: { + description: 'This building looks correct', + icon: 'close-outline', + title: 'Correct building', + }, + success: { + description: 'This building is correct', + icon: 'checkmark-outline', + title: 'Well done', + }, + }, + ], + status: 'tutorial', + tileServer: { + apiKey: 'dummy-bing', + credits: '© 2019 Microsoft Corporation, Earthstar Geographics SIO', + name: 'bing', + url: 'https://ecn.t0.tiles.virtualearth.net/tiles/a{quad_key}.jpeg?g=15384&mkt=en-US&token={apiKey}', + }, + tutorialDraftId: '', + zoomLevel: 18, + }, + expected_tutorial_groups_data: { + '101': { + finishedCount: 0, + groupId: 101, + numberOfTasks: 1, + progress: 0, + projectId: 'tutorial_01K4MQ88R61EDAMS0K0TW0N17A', + requiredCount: 0, + }, + }, + expected_tutorial_tasks_data: { + // NOTE: The tasks have been decoded + '101': [ + { + taskId: 't1', + geojson: { + coordinates: [ + [ + [84.001574, 28.1935348], + [84.001576, 28.1934266], + [84.0016578, 28.1934278], + [84.0016558, 28.1935359], + [84.001574, 28.1935348], + ], + ], + type: 'Polygon', + }, + properties: { + id: 1098299960, + reference: 1, + screen: 1, + }, + // FIXME(tnagorra): The geometry was wrong in previous version (Added space after POLYGON and longitude values) + geometry: 'POLYGON ((84.001574 28.1935348,84.001576 28.1934266,84.0016578 28.1934278,84.0016558 28.1935359,84.001574 28.1935348))', + }, + ], + }, + // Expected project + expected_project_data: { + contributorCount: 0, + created: '2026-01-21T13:49:30.764081+00:00', + createdBy: '01K6CPB1ETTF7MT9EAAQDQM4A9', + groupMaxSize: 25, + groupSize: 25, + isFeatured: false, + language: 'en-us', + lookFor: 'building', + manualUrl: 'https://fair.hotosm.org', + maxTasksPerUser: 30, + name: 'Conflate Features - fAIr - Manbhawan (2) Togglecorp', + progress: 0, + projectDetails: 'This is a conflation project with an extended description', + projectId: '01K339HAWZCTCBRVQMQFWRTHXX', + projectInstruction: 'Compare buildings', + projectNumber: 2, + projectRegion: 'Manbhawan', + projectTopic: 'fAIr', + projectTopicKey: 'conflate features - fair - manbhawan (2) togglecorp', + projectType: 8, + requestingOrganisation: 'Togglecorp', + requiredResults: 12, + resultCount: 0, + status: 'active', + tileServer: { + apiKey: 'dummy-bing', + credits: '© 2019 Microsoft Corporation, Earthstar Geographics SIO', + name: 'bing', + url: 'https://ecn.t0.tiles.virtualearth.net/tiles/a{quad_key}.jpeg?g=15384&mkt=en-US&token={apiKey}', + }, + tutorialId: 'tutorial_01K4MQ88R61EDAMS0K0TW0N17A', + verificationNumber: 3, + }, + expected_project_groups_data: { + g100: { + finishedCount: 0, + groupId: 'g100', + numberOfTasks: 4, + progress: 0, + projectId: '01K339HAWZCTCBRVQMQFWRTHXX', + requiredCount: 3, + }, + }, + expected_project_tasks_data: { + g100: [ + { + projectId: '01K339HAWZCTCBRVQMQFWRTHXX', + taskId: 't1', + geojson: { + type: 'Polygon', + coordinates: [ + [ + [-99.0960703975439, 19.4260629712692], + [-99.0960703975439, 19.4258370781538], + [-99.0958707900499, 19.4258370781538], + [-99.0958707900499, 19.4260629712692], + [-99.0960703975439, 19.4260629712692], + ], + ], + }, + }, + { + projectId: '01K339HAWZCTCBRVQMQFWRTHXX', + taskId: 't2', + geojson: { + type: 'Polygon', + coordinates: [ + [ + [-99.096234519261, 19.4256739329314], + [-99.096234519261, 19.4254396728378], + [-99.0960570903775, 19.4254396728378], + [-99.0960570903775, 19.4256739329314], + [-99.096234519261, 19.4256739329314], + ], + ], + }, + }, + { + projectId: '01K339HAWZCTCBRVQMQFWRTHXX', + taskId: 't3', + geojson: { + type: 'Polygon', + coordinates: [ + [ + [-99.0945557822443, 19.4253619867497], + [-99.0945557822443, 19.424958657374], + [-99.0942564104523, 19.424958657374], + [-99.0942564104523, 19.4253619867497], + [-99.0945557822443, 19.4253619867497], + ], + ], + }, + }, + { + projectId: '01K339HAWZCTCBRVQMQFWRTHXX', + taskId: 't4', + geojson: { + type: 'Polygon', + coordinates: [ + [ + [-99.0934675895399, 19.4222204725853], + [-99.0934675895399, 19.4220188041236], + [-99.0933535431433, 19.4220188041236], + [-99.0933535431433, 19.4222204725853], + [-99.0934675895399, 19.4222204725853], + ], + ], + }, + }, + ], + }, + // Create contributor group + create_contributor_user_group: [ + { + clientId: '01K49J0QPCZM2JCNC9AEE6HT8Y', + name: 'User Group 01', + description: 'First user group', + }, + ], + create_results: { + g100: { + '01K6CPB1ETTF7MT9EAAQDQM4A9': { + startTime: '2026-01-21T14:38:10.783Z', + endTime: '2026-01-21T14:38:33.619Z', + appVersion: '0.3.0-dev', + clientType: 'web', + reference: { + t1: { numberIntersecting: 0 }, + t2: { numberIntersecting: 0 }, + t3: { + numberIntersecting: 1, + osmId: 1158869168, + osmType: 'ways_poly', + version: 1, + }, + t4: { numberIntersecting: 4 }, + }, + results: { + t1: 1, + t2: 0, + t3: 0, + t4: 3, + }, + }, + }, + }, + expected_pulled_results_data: { + mapping_session_count: 1, + mapping_session_results_count: 4, + mapping_session_user_groups_count: 0, + progress: 33, + }, + expected_project_exports_data: { + aggregated_results: 'assets/tests/projects/conflation/exports/expected_project_aggregated_result_modified.csv', + aggregated_results_with_geometry: 'assets/tests/projects/conflation/exports/expected_project_aggregated_result_with_geometry_modified.geojson', + results: 'assets/tests/projects/conflation/exports/expected_project_result_modified.csv', + history: 'assets/tests/projects/conflation/exports/expected_project_history.csv', + groups: 'assets/tests/projects/conflation/exports/expected_project_groups_modified.csv', + tasks: 'assets/tests/projects/conflation/exports/expected_project_tasks_modified.csv', + users: 'assets/tests/projects/conflation/exports/expected_project_users.csv', + area_of_interest: 'assets/tests/projects/conflation/exports/expected_project_aoi.geojson', + }, +}