|
35 | 35 | ) |
36 | 36 | from tipg.errors import MissingGeometryColumn, NoPrimaryKey, NotFound |
37 | 37 | from tipg.resources.enums import MediaType |
38 | | -from tipg.resources.response import GeoJSONResponse, SchemaJSONResponse |
| 38 | +from tipg.resources.response import GeoJSONResponse, SchemaJSONResponse, orjsonDumps |
39 | 39 | from tipg.settings import FeaturesSettings, MVTSettings, TMSSettings |
40 | 40 |
|
41 | 41 | from fastapi import APIRouter, Depends, Path, Query |
@@ -781,7 +781,7 @@ async def items( # noqa: C901 |
781 | 781 | # NDJSON Response |
782 | 782 | if output_type == MediaType.ndjson: |
783 | 783 | return StreamingResponse( |
784 | | - (orjson.dumps(row) + b"\n" for row in rows), |
| 784 | + (orjsonDumps(row) + b"\n" for row in rows), |
785 | 785 | media_type=MediaType.ndjson, |
786 | 786 | headers={ |
787 | 787 | "Content-Disposition": "attachment;filename=items.ndjson" |
@@ -886,13 +886,13 @@ async def items( # noqa: C901 |
886 | 886 | # HTML Response |
887 | 887 | if output_type == MediaType.html: |
888 | 888 | return self._create_html_response( |
889 | | - request, orjson.dumps(data).decode(), template_name="items" |
| 889 | + request, orjsonDumps(data).decode(), template_name="items" |
890 | 890 | ) |
891 | 891 |
|
892 | 892 | # GeoJSONSeq Response |
893 | 893 | elif output_type == MediaType.geojsonseq: |
894 | 894 | return StreamingResponse( |
895 | | - (orjson.dumps(f) + b"\n" for f in data["features"]), # type: ignore |
| 895 | + (orjsonDumps(f) + b"\n" for f in data["features"]), # type: ignore |
896 | 896 | media_type=MediaType.geojsonseq, |
897 | 897 | headers={ |
898 | 898 | "Content-Disposition": "attachment;filename=items.geojson" |
@@ -1016,7 +1016,7 @@ async def item( |
1016 | 1016 | # NDJSON Response |
1017 | 1017 | if output_type == MediaType.ndjson: |
1018 | 1018 | return StreamingResponse( |
1019 | | - (orjson.dumps(row) + b"\n" for row in rows), |
| 1019 | + (orjsonDumps(row) + b"\n" for row in rows), |
1020 | 1020 | media_type=MediaType.ndjson, |
1021 | 1021 | headers={ |
1022 | 1022 | "Content-Disposition": "attachment;filename=items.ndjson" |
@@ -1050,7 +1050,7 @@ async def item( |
1050 | 1050 | if output_type == MediaType.html: |
1051 | 1051 | return self._create_html_response( |
1052 | 1052 | request, |
1053 | | - orjson.dumps(data).decode(), |
| 1053 | + orjsonDumps(data).decode(), |
1054 | 1054 | template_name="item", |
1055 | 1055 | ) |
1056 | 1056 |
|
@@ -1512,7 +1512,6 @@ async def collection_get_tile( |
1512 | 1512 | return Response(bytes(tile), media_type=MediaType.mvt.value) |
1513 | 1513 |
|
1514 | 1514 | def _tilejson_routes(self): |
1515 | | - |
1516 | 1515 | ############################################################################ |
1517 | 1516 | # ADDITIONAL ENDPOINTS NOT IN OGC Tiles API (tilejson, style.json, viewer) # |
1518 | 1517 | ############################################################################ |
|
0 commit comments