Make scripts compatible with TM version 2
-
URL to get the TM project AoI as geoJSON is different
- for v3
https://domain.tld/api/v1/project/$tm_project/tasks?as_file=true
- for v2 it should be
http://domain.tld/project/$tm_project/tasks.json
- for v3
-
geoJSON syntax is different
v3
{"geometry": {"coordinates": [[[[20.6792488633444, 5.75776765885041], ...... [-7.841512825894925,
5.75776765885041]]]], "type": "MultiPolygon"}, "properties": {"taskId": 529, "taskSplittable": false,
"taskStatus": "READY", "taskX": null, "taskY": null, "taskZoom": null}, "type": "Feature"}], "type":
"FeatureCollection"}
v2
{"geometry": {"type": "MultiPolygon", "coordinates": [[[[-7.841512825894925, 8.883928242656987] ......
[-7.841512825894925, 8.883928242656987]]]]}, "type": "Feature", "id": 2932, "properties": {"state": 0,
"locked": false}}]}
where state
is the task_status ("2" stands for mapped, "3" for validated).
When importing a geoJSON with the v2 syntax with ogr2ogr in Pgsql, "id": 2932
is lost, here is a screenshot of the table in PGAdmin :
ogc_fid
field is an auto-generated serial value
Suggestion : parse the geoJSON file to put "id" in "properties" list, before ogr2ogr import.