Skip to content

Commit

Permalink
added an initial (mostly reverse-engineered) API-design pass for the …
Browse files Browse the repository at this point in the history
…indoor maps `RemoteMap`
  • Loading branch information
CommanderStorm committed Aug 13, 2024
1 parent 6720338 commit ec0e473
Show file tree
Hide file tree
Showing 3 changed files with 471 additions and 3 deletions.
299 changes: 298 additions & 1 deletion data/output/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ paths:
examples:
- Waiting for first sync with TUMonline
tags:
- core
- calendar
'/api/locations/{id}/preview':
get:
operationId: previews
Expand Down Expand Up @@ -901,6 +901,51 @@ paths:
- Not found
tags:
- maps
/api/maps/indoor:
get:
operationId: list-indoor-maps
summary: Lists indoor maps in bounding box
description: Returns all the available maps for a given bbox
parameters:
- name: bbox
in: query
description: 'Bounding box according to https://datatracker.ietf.org/doc/html/rfc7946#section-5'
required: true
schema:
type: string
pattern: '-?[\d]+.[\d]+,-?[\d]+.[\d]+,-?[\d]+.[\d]+,-?[\d]+.[\d]+'
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RemoteMap'
tags:
- maps
'/api/maps/indoor/{id}':
get:
operationId: get-indoor-map
summary: Get indoor features
description: Get all features of a certain indoor map
parameters:
- name: id
in: path
description: id of the map returned by prior listing
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FeatureCollection'
tags:
- maps
/api/feedback/get_token:
post:
operationId: get_token
Expand Down Expand Up @@ -1290,6 +1335,258 @@ paths:
- health
components:
schemas:
RemoteMap:
type: object
properties:
name:
type: string
path:
type: string
required:
- name
- path
GeoJsonObject:
description: |
GeoJSon object The coordinate reference system for all GeoJSON coordinates is a geographic coordinate reference system, using the World Geodetic System 1984 (WGS 84) datum, with longitude and latitude units of decimal degrees. This is equivalent to the coordinate reference system identified by the Open Geospatial Consortium (OGC) URN An OPTIONAL third-position element SHALL be the height in meters above or below the WGS 84 reference ellipsoid. In the absence of elevation values, applications sensitive to height or depth SHOULD interpret positions as being at local ground or sea level.
type: object
properties:
type:
type: string
enum:
- Feature
- FeatureCollection
- Point
- MultiPoint
- LineString
- MultiLineString
- Polygon
- MultiPolygon
- GeometryCollection
bbox:
description: |
A GeoJSON object MAY have a member named "bbox" to include information on the coordinate range for its Geometries, Features, or FeatureCollections. The value of the bbox member MUST be an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries.
type: array
items:
type: number
discriminator:
propertyName: type
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3'
required:
- type
Geometry:
description: |
Abstract type for all GeoJSon object except Feature and FeatureCollection
allOf:
- $ref: '#/components/schemas/GeoJsonObject'
- type: object
properties:
type:
type: string
enum:
- Point
- MultiPoint
- LineString
- MultiLineString
- Polygon
- MultiPolygon
- GeometryCollection
required:
- type
discriminator:
propertyName: type
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3'
GeometryElement:
description: |
Abstract type for all GeoJSon 'Geometry' object the type of which is not 'GeometryCollection'
allOf:
- $ref: '#/components/schemas/Geometry'
- type: object
properties:
type:
type: string
enum:
- Point
- MultiPoint
- LineString
- MultiLineString
- Polygon
- MultiPolygon
required:
- type
discriminator:
propertyName: type
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3'
Feature:
description: GeoJSon 'Feature' object
allOf:
- $ref: '#/components/schemas/GeoJsonObject'
- type: object
required:
- geometry
- properties
properties:
geometry:
allOf:
- nullable: true
- $ref: '#/components/schemas/Geometry'
properties:
type: object
nullable: true
id:
oneOf:
- type: number
- type: string
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.2'
FeatureCollection:
description: GeoJSon 'FeatureCollection' object
allOf:
- $ref: '#/components/schemas/GeoJsonObject'
- type: object
required:
- features
properties:
features:
type: array
items:
$ref: '#/components/schemas/Feature'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.3'
Position:
description: |
GeoJSon fundamental geometry construct. A position is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element. Implementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as "M") or a numerical timestamp, but in most situations a parser will not be able to properly interpret these values. The interpretation and meaning of additional elements is beyond the scope of this specification, and additional elements MAY be ignored by parsers.
type: array
items:
type: number
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.1'
maxItems: 3
minItems: 2
LineStringCoordinates:
description: |
GeoJSon fundamental geometry construct, array of two or more positions.
type: array
items:
$ref: '#/components/schemas/Position'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.4'
minItems: 2
LinearRing:
description: |
A linear ring is a closed LineString with four or more positions. The first and last positions are equivalent, and they MUST contain identical values; their representation SHOULD also be identical. A linear ring is the boundary of a surface or the boundary of a hole in a surface. A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.
type: array
items:
$ref: '#/components/schemas/Position'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.6'
minItems: 4
Point:
description: GeoJSon geometry
allOf:
- $ref: '#/components/schemas/GeometryElement'
- type: object
required:
- type
- coordinates
properties:
type:
type: string
enum:
- Point
coordinates:
$ref: '#/components/schemas/Position'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.2'
MultiPoint:
description: GeoJSon geometry
allOf:
- $ref: '#/components/schemas/GeometryElement'
- type: object
required:
- coordinates
properties:
coordinates:
type: array
items:
$ref: '#/components/schemas/Position'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.3'
LineString:
description: GeoJSon geometry
allOf:
- $ref: '#/components/schemas/GeometryElement'
- type: object
required:
- coordinates
properties:
coordinates:
$ref: '#/components/schemas/LineStringCoordinates'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.4'
MultiLineString:
description: GeoJSon geometry
allOf:
- $ref: '#/components/schemas/GeometryElement'
- type: object
required:
- coordinates
properties:
coordinates:
type: array
items:
$ref: '#/components/schemas/LineStringCoordinates'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.5'
Polygon:
description: GeoJSon geometry
allOf:
- $ref: '#/components/schemas/GeometryElement'
- type: object
required:
- coordinates
properties:
coordinates:
type: array
items:
$ref: '#/components/schemas/LinearRing'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.6'
MultiPolygon:
description: GeoJSon geometry
allOf:
- $ref: '#/components/schemas/GeometryElement'
- type: object
required:
- coordinates
properties:
coordinates:
type: array
items:
type: array
items:
$ref: '#/components/schemas/LinearRing'
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.7'
GeometryCollection:
description: |
GeoJSon geometry collection GeometryCollections composed of a single part or a number of parts of a single type SHOULD be avoided when that single part or a single object of multipart type (MultiPoint, MultiLineString, or MultiPolygon) could be used instead.
type: object
allOf:
- $ref: '#/components/schemas/Geometry'
- type: object
required:
- geometries
properties:
geometries:
type: array
items:
$ref: '#/components/schemas/GeometryElement'
minItems: 0
externalDocs:
url: 'https://tools.ietf.org/html/rfc7946#section-3.1.8'
Props:
description: Data for the info-card table
type: object
Expand Down
4 changes: 2 additions & 2 deletions map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If you really need a tileset and can't meet these requirements, shoot us a messa
Generating `europe` takes 3h10m on a modern laptop with 32GB RAM and an SSD. The following commands are optimised for
this.

From the root of the repository, run either (depending on your waiting tolerance and avaliable RAM):
From the root of the repository, run either (depending on your waiting tolerance and available RAM):

- <details><summary>[~minutes] Only <b>Germany</b> with approx 64GB of RAM</summary>

Expand Down Expand Up @@ -110,7 +110,7 @@ docker run -it --rm -p 8888:8888 maputnik/editor
> After exporting the edited style don't forget to revert the change to the vector url 😉
| Step 1 | Step 2 |
| ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| ![Where in Maputnik to click to import a style](/resources/documentation/maputnik-import1.png) | ![Where in Maputnik to click then to import a style](/resources/documentation/maputnik-import2.png) |

### Fonts + Sprites
Expand Down
Loading

0 comments on commit ec0e473

Please sign in to comment.