Skip to content

Commit d5e0692

Browse files
committed
Add export repository
1 parent f9b95b3 commit d5e0692

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.nitri.ors.repository
2+
3+
import org.nitri.ors.api.OpenRouteServiceApi
4+
import org.nitri.ors.model.export.ExportRequest
5+
import org.nitri.ors.model.export.ExportResponse
6+
import org.nitri.ors.model.export.TopoJsonExportResponse
7+
8+
class ExportRepository(private val api: OpenRouteServiceApi) {
9+
10+
suspend fun export(boundingBox: List<Double>, profile: String, geometry: Boolean? = null): ExportResponse {
11+
val request = ExportRequest(
12+
boundingBox = boundingBox,
13+
profile = profile,
14+
geometry = geometry
15+
)
16+
return api.export(profile, request)
17+
}
18+
19+
suspend fun export(profile: String, request: ExportRequest): ExportResponse {
20+
return api.export(profile, request)
21+
}
22+
23+
suspend fun exportJson(profile: String, request: ExportRequest): ExportResponse {
24+
return api.exportJson(profile, request)
25+
}
26+
27+
suspend fun exportTopoJson(profile: String, request: ExportRequest): TopoJsonExportResponse {
28+
return api.exportTopoJson(profile, request)
29+
}
30+
}

0 commit comments

Comments
 (0)