|
1 | 1 | package org.nitri.ors.api |
2 | 2 |
|
3 | 3 | import okhttp3.ResponseBody |
| 4 | +import org.nitri.ors.model.elevation.ElevationLineRequest |
| 5 | +import org.nitri.ors.model.elevation.ElevationLineResponse |
| 6 | +import org.nitri.ors.model.elevation.ElevationPointRequest |
| 7 | +import org.nitri.ors.model.elevation.ElevationPointResponse |
4 | 8 | import org.nitri.ors.model.export.ExportRequest |
5 | 9 | import org.nitri.ors.model.export.ExportResponse |
6 | 10 | import org.nitri.ors.model.export.TopoJsonExportResponse |
| 11 | +import org.nitri.ors.model.geocode.GeocodeSearchResponse |
7 | 12 | import org.nitri.ors.model.isochrones.IsochronesRequest |
8 | 13 | import org.nitri.ors.model.isochrones.IsochronesResponse |
9 | 14 | import org.nitri.ors.model.matrix.MatrixRequest |
@@ -127,4 +132,131 @@ interface OpenRouteServiceApi { |
127 | 132 | @Body request: OptimizationRequest |
128 | 133 | ): OptimizationResponse |
129 | 134 |
|
| 135 | + // Elevation |
| 136 | + |
| 137 | + @POST("elevation/line") |
| 138 | + suspend fun getElevationLine( |
| 139 | + @Body request: ElevationLineRequest |
| 140 | + ): ElevationLineResponse |
| 141 | + |
| 142 | + @GET("elevation/point") |
| 143 | + suspend fun getElevationPointSimple( |
| 144 | + @Query("geometry") start: String, // e.g. "8.681495,49.41461" |
| 145 | + ): RouteResponse |
| 146 | + |
| 147 | + @POST("elevation/point") |
| 148 | + suspend fun getElevationPoint( |
| 149 | + @Body request: ElevationPointRequest |
| 150 | + ): ElevationPointResponse |
| 151 | + |
| 152 | + // Geocode |
| 153 | + |
| 154 | + @GET("geocode/search") |
| 155 | + suspend fun geocodeSearch( |
| 156 | + @Query("text") text: String, |
| 157 | + |
| 158 | + // Optional focus point |
| 159 | + @Query("focus.point.lon") focusLon: Double? = null, |
| 160 | + @Query("focus.point.lat") focusLat: Double? = null, |
| 161 | + |
| 162 | + // Optional rectangular boundary |
| 163 | + @Query("boundary.rect.min_lon") rectMinLon: Double? = null, |
| 164 | + @Query("boundary.rect.min_lat") rectMinLat: Double? = null, |
| 165 | + @Query("boundary.rect.max_lon") rectMaxLon: Double? = null, |
| 166 | + @Query("boundary.rect.max_lat") rectMaxLat: Double? = null, |
| 167 | + |
| 168 | + // Optional circular boundary |
| 169 | + @Query("boundary.circle.lon") circleLon: Double? = null, |
| 170 | + @Query("boundary.circle.lat") circleLat: Double? = null, |
| 171 | + @Query("boundary.circle.radius") circleRadiusMeters: Double? = null, |
| 172 | + |
| 173 | + // Other optional filters |
| 174 | + @Query("boundary.gid") boundaryGid: String? = null, |
| 175 | + // Pass comma-separated if multiple, e.g. "DE,AT" |
| 176 | + @Query("boundary.country") boundaryCountry: String? = null, |
| 177 | + // Pelias expects comma-separated values; join your list before passing. |
| 178 | + @Query("sources") sourcesCsv: String? = null, // e.g. "osm,oa,gn,wof" |
| 179 | + @Query("layers") layersCsv: String? = null, // e.g. "region,country,locality,address" |
| 180 | + @Query("size") size: Int? = 10, |
| 181 | + |
| 182 | + // Geocoder uses api_key as query |
| 183 | + @Query("api_key") apiKey: String |
| 184 | + ): GeocodeSearchResponse |
| 185 | + |
| 186 | + @GET("geocode/autocomplete") |
| 187 | + suspend fun autocomplete( |
| 188 | + @Query("api_key") apiKey: String, |
| 189 | + @Query("text") text: String, |
| 190 | + @Query("focus.point.lon") focusLon: Double? = null, |
| 191 | + @Query("focus.point.lat") focusLat: Double? = null, |
| 192 | + @Query("boundary.rect.min_lon") rectMinLon: Double? = null, |
| 193 | + @Query("boundary.rect.min_lat") rectMinLat: Double? = null, |
| 194 | + @Query("boundary.rect.max_lon") rectMaxLon: Double? = null, |
| 195 | + @Query("boundary.rect.max_lat") rectMaxLat: Double? = null, |
| 196 | + @Query("boundary.circle.lon") circleLon: Double? = null, |
| 197 | + @Query("boundary.circle.lat") circleLat: Double? = null, |
| 198 | + @Query("boundary.circle.radius") circleRadius: Double? = null, |
| 199 | + @Query("boundary.country") country: String? = null, |
| 200 | + @Query("sources") sources: List<String>? = null, |
| 201 | + @Query("layers") layers: List<String>? = null, |
| 202 | + @Query("size") size: Int? = null |
| 203 | + ): GeocodeSearchResponse |
| 204 | + |
| 205 | + |
| 206 | + @GET("geocode/search/structured") |
| 207 | + suspend fun geocodeStructured( |
| 208 | + @Query("api_key") apiKey: String, |
| 209 | + |
| 210 | + // Structured query parts (all optional; send only what you have) |
| 211 | + @Query("address") address: String? = null, |
| 212 | + @Query("neighbourhood") neighbourhood: String? = null, |
| 213 | + @Query("borough") borough: String? = null, |
| 214 | + @Query("locality") locality: String? = null, // e.g., city |
| 215 | + @Query("county") county: String? = null, |
| 216 | + @Query("region") region: String? = null, // e.g., state/province |
| 217 | + @Query("country") country: String? = null, // ISO code or name |
| 218 | + @Query("postalcode") postalcode: String? = null, |
| 219 | + |
| 220 | + // Focus point (used for ranking) |
| 221 | + @Query("focus.point.lon") focusLon: Double? = null, |
| 222 | + @Query("focus.point.lat") focusLat: Double? = null, |
| 223 | + |
| 224 | + // Bounding rectangle (optional) |
| 225 | + @Query("boundary.rect.min_lon") rectMinLon: Double? = null, |
| 226 | + @Query("boundary.rect.min_lat") rectMinLat: Double? = null, |
| 227 | + @Query("boundary.rect.max_lon") rectMaxLon: Double? = null, |
| 228 | + @Query("boundary.rect.max_lat") rectMaxLat: Double? = null, |
| 229 | + |
| 230 | + // Bounding circle (optional) |
| 231 | + @Query("boundary.circle.lon") circleLon: Double? = null, |
| 232 | + @Query("boundary.circle.lat") circleLat: Double? = null, |
| 233 | + @Query("boundary.circle.radius") circleRadiusMeters: Double? = null, |
| 234 | + |
| 235 | + // Limit results to a specific country (ISO code) |
| 236 | + @Query("boundary.country") boundaryCountry: String? = null, |
| 237 | + |
| 238 | + // Filters |
| 239 | + @Query("layers") layers: List<String>? = null, // e.g. ["address","venue","street","locality","region","country"] |
| 240 | + @Query("sources") sources: List<String>? = null, // e.g. ["osm","oa","gn","wof"] |
| 241 | + |
| 242 | + // Number of results (default 10) |
| 243 | + @Query("size") size: Int? = null |
| 244 | + ): GeocodeSearchResponse |
| 245 | + |
| 246 | + |
| 247 | + @GET("geocode/reverse") |
| 248 | + suspend fun geocodeReverse( |
| 249 | + @Query("api_key") apiKey: String, |
| 250 | + |
| 251 | + // required |
| 252 | + @Query("point.lon") lon: Double, |
| 253 | + @Query("point.lat") lat: Double, |
| 254 | + |
| 255 | + // optional ranking/filters |
| 256 | + @Query("boundary.circle.radius") radiusKm: Double? = null, // Pelias expects km |
| 257 | + @Query("size") size: Int? = null, // default 10 |
| 258 | + @Query("layers") layers: List<String>? = null, // e.g. ["address","venue"] |
| 259 | + @Query("sources") sources: List<String>? = null, // e.g. ["osm","oa","gn","wof"] |
| 260 | + @Query("boundary.country") boundaryCountry: String? = null // ISO code, e.g. "FR" |
| 261 | + ): GeocodeSearchResponse |
130 | 262 | } |
0 commit comments