BloomBus
  • What is BloomBus?
  • Code Repositories & Deployment
  • Publishing
  • Editing Geospatial Features
  • BloomBus-Client
    • Architecture
    • Home.jsx
    • ShuttlesDrawer.jsx
    • StationsDrawer.jsx
  • BloomBus-Tracker
    • Architecture
  • BloomBus-Server
    • Architecture
    • REST API
    • Developing Locally
    • Authentication
  • Future Plans
    • Cloud → Self-hosted
Powered by GitBook
On this page
  • Download Stops GeoJSON
  • Download Loops GeoJSON
  • Upload Stops GeoJSON
  • Upload Loops GeoJSON
  1. BloomBus-Server

REST API

Download Stops GeoJSON

GET https://bloombus.bloomu.edu/api/download/stops/geojson

Retrieves the current state of the GeoJSON representing the geometry of shuttle stops from the Firebase Realtime Database. Since it is not stored in Firebase as proper GeoJSON (features residing within a FeatureCollection) the data is massaged within this service before it is sent to the client.

stops-2019-05-26.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "geometry": {
        "coordinates": [
          -76.449313,
          41.00196
        ],
        "type": "Point"
      },
      "properties": {
        "name": "Corner East/5th",
        "stopKey": "cornerEast5th"
      },
      "type": "Feature"
    },
    ...
  ]
}
{
    "message": "Error retrieving stops GeoJSON."
}

Download Loops GeoJSON

GET https://bloombus.bloomu.edu/api/download/loops/geojson

Retrieves the current state of the GeoJSON representing the geometry of shuttle loops from the Firebase Realtime Database.

loops-2019-05-26.geojson
{
  "crs": {
    "properties": {
      "name": "EPSG:4326"
    },
    "type": "name"
  },
  "features": [
    {
      "geometry": {
        "coordinates": [
          [
            -76.44382211899995,
            41.01081362700006
          ],
          [
            -76.44447165999998,
            41.01080468400005
          ],
          [
            -76.44444118899997,
            41.00983172800005
          ],
          ...
        ],
        "type": "LineString"
      },
      "id": 1,
      "properties": {
        "color": "#33A3F4",
        "key": "campus",
        "name": "Campus Loop",
        "objectID": 1,
        "shapeLength": 0.03144377168231157,
        "stops": [
          "library",
          "nelsonFieldHouse",
          "jka",
          "orangeLot",
          "moa",
          "mpa"
        ]
      },
      "type": "Feature"
    },
    ...
  ],
  "type": "FeatureCollection"
}

Upload Stops GeoJSON

POST https://bloombus.bloomu.edu/api/upload/stops/geojson

Parses GeoJSON representing the geometry of shuttle stops and updates the /stops reference in the Firebase Realtime Database with this GeoJSON. Since the GeoJSON is meant to be stored in the Firebase Realtime Database under the /stops reference as key-value pairs of each stop's key string to a GeoJSON Feature object, the previously valid GeoJSON provided in the uploaded file will be massaged into this format.

Headers

Name
Type
Description

Content-Type

string

multipart/form-data

Request Body

Name
Type
Description

stops-geojson

object

The File object provided by an HTML <input type="file/>.

Upload Loops GeoJSON

POST https://bloombus.bloomu.edu/api/upload/loops/geojson

Parses GeoJSON representing the geometry of shuttle loops and updates the /loops reference in the Firebase Realtime Database with this GeoJSON.

Path Parameters

Name
Type
Description

Content-Type

string

multipart/form-data

Request Body

Name
Type
Description

loops-geojson

object

The File object provided by an HTML <input type="file/>.

PreviousArchitectureNextDeveloping Locally

Last updated 5 years ago