Skip to content

Instantly share code, notes, and snippets.

@theocalmes
Created August 9, 2016 20:31
Show Gist options
  • Save theocalmes/b924c59273103796edfd449c82429e1d to your computer and use it in GitHub Desktop.
Save theocalmes/b924c59273103796edfd449c82429e1d to your computer and use it in GitHub Desktop.
CB Backend API Draft

API Calls

I would like to propose two main API calls for the new features. The first is a SHALLOW general gemometry based GET for all points of intrest. The second is a DEEP GET for a single point of intrest.

Rectangle Call

GET Paramters:

{
    minLatitude: Double
    minLongitude: Double
    maxLatitude: Double
    maxLongitude: Double
}

This call will return a shallow set of points and polygons. Here is an example:

{
  points: [ (Array)
        {
            latitude: Double    
            longitude: Double
            title: String
            id: Int (unique)
            description: String (short description of the event, maybe even truncated)
            type: String (alert type)
            source: String (nc4, nixle... etc)
        },
        {...}
        {...}
    ]
  incident_zones: [ (Array)
                {
                    polyine: String (https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
                    title: String
                    id: Int (unique)
                    description: String (short description of the event, maybe even truncated)
                    start_date: Date
                    end_date: Date
                }
            ]
}

Deep Call

GET Parameters:

{
    id: Int
}

This would just take the id from the Rectangle call and return all the info on the object:

{
    FULL detail
}
@allenpeng0705
Copy link

For the first call, the min and max lat/lng was used to get one rectangle area?
Is it ok for us to use {lat:, Lng:, radius:, count:} for this call ?
(lat, lng) was the current location or the pin's location. "radius" was the scope which we want to get messages.
"count" was the number of feeds we hope to get?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment