Skip to content

Commit d520c63

Browse files
author
Nicolas Hervé
committed
feat: move geojson format to kili_formats, add export for geospatial projects
1 parent 6f99400 commit d520c63

File tree

21 files changed

+41
-2206
lines changed

21 files changed

+41
-2206
lines changed

docs/sdk/label_utils.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,24 @@ The module `kili.utils.labels` provides a set of helpers to convert point, bound
5656

5757
### Point
5858

59-
::: kili.utils.labels.geojson.point
59+
::: kili_formats.format.geojson.point
6060

6161
### Line
6262

63-
::: kili.utils.labels.geojson.line
63+
::: kili_formats.format.geojson.line
6464

6565
### Bounding box
6666

67-
::: kili.utils.labels.geojson.bbox
67+
::: kili_formats.format.geojson.bbox
6868

6969
### Polygon
7070

71-
::: kili.utils.labels.geojson.polygon
71+
::: kili_formats.format.geojson.polygon
7272

7373
### Segmentation
7474

75-
::: kili.utils.labels.geojson.segmentation
75+
::: kili_formats.format.geojson.segmentation
7676

7777
### Collection
7878

79-
::: kili.utils.labels.geojson.collection
79+
::: kili_formats.format.geojson.collection

docs/sdk/tutorials/geojson.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Kili SDK provides a set of label utils to convert Kili labels to GeoJSON:
170170

171171

172172
```python
173-
from kili.utils.labels.geojson import (
173+
from kili_formats.format.geojson import (
174174
features_to_feature_collection,
175175
kili_bbox_annotation_to_geojson_polygon_feature,
176176
kili_json_response_to_feature_collection,
@@ -312,7 +312,7 @@ However, since the GeoJSON file we are using does not have the `kili` key in the
312312

313313

314314
```python
315-
from kili.utils.labels.geojson import (
315+
from kili_formats.format.geojsonon import (
316316
geojson_linestring_feature_to_kili_line_annotation,
317317
geojson_point_feature_to_kili_point_annotation,
318318
geojson_polygon_feature_to_kili_polygon_annotation,

recipes/geojson.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
"metadata": {},
315315
"outputs": [],
316316
"source": [
317-
"from kili.utils.labels.geojson import (\n",
317+
"from kili_formats.format.geojson import (\n",
318318
" features_to_feature_collection,\n",
319319
" kili_bbox_annotation_to_geojson_polygon_feature,\n",
320320
" kili_json_response_to_feature_collection,\n",
@@ -588,7 +588,7 @@
588588
"metadata": {},
589589
"outputs": [],
590590
"source": [
591-
"from kili.utils.labels.geojson import (\n",
591+
"from kili_formats.format.geojsonon import (\n",
592592
" geojson_linestring_feature_to_kili_line_annotation,\n",
593593
" geojson_point_feature_to_kili_point_annotation,\n",
594594
" geojson_polygon_feature_to_kili_polygon_annotation,\n",

src/kili/adapters/kili_api_gateway/asset/operations_mixin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
from typing import Dict, Generator, List
44

5+
from kili_formats.tool.annotations_to_json_response import (
6+
AnnotationsToJsonResponseConverter,
7+
)
8+
59
from kili.adapters.kili_api_gateway.asset.formatters import (
610
load_asset_json_fields,
711
)
@@ -18,9 +22,6 @@
1822
QueryOptions,
1923
fragment_builder,
2024
)
21-
from kili.adapters.kili_api_gateway.label.annotation_to_json_response import (
22-
AnnotationsToJsonResponseConverter,
23-
)
2425
from kili.adapters.kili_api_gateway.label.common import get_annotation_fragment
2526
from kili.adapters.kili_api_gateway.project.common import get_project
2627
from kili.domain.asset import AssetFilters
@@ -47,6 +48,7 @@ def list_assets(
4748
"LLM_RLHF",
4849
"LLM_INSTR_FOLLOWING",
4950
"LLM_STATIC",
51+
"GEOSPATIAL",
5052
}:
5153
yield from self.list_assets_split(filters, fields, options, project_info)
5254
return

0 commit comments

Comments
 (0)