Code Monkey home page Code Monkey logo

orbitron's People

Contributors

dependabot[bot] avatar jboarman avatar jgsato avatar lcirvin avatar proofconstruction avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

orbitron's Issues

Add support for IP-to-Lat/Long geocoding service

Add support for ipstack.com's geocoding services so that a user can request records near an IP address input.

/nearest/{count}/{sourceType}/to/{location}[/within/{distance}/{units}]

Note that we will have to discern the data type of the location parameter as being either an IP address or Lat/Long or Postal Code.

Alternate IP-lookup services could be added later: https://resolve.rs/ip/geolocation.html (We can take requests or look at google search popularity or SEO link popularity checkers to assess top services to support)

Add `_distance` measure to response data

It would be helpful to consumers if the data returned by Orbitron includes a distance measure. Since every query requires a given data point (whether it be a specific lat/long or zip centroid), then we should be able to calculate a distance between the input and each row of the output.

At some point, we may need to respond with varying units (miles vs km), or provide code for helper functions that convert between units, or allow parameters to be passed that dictate units to include in the response. However, the current project only supports miles at the moment. For this issue, perhaps we just add the units to the response, like _distance: "1.5 mi"? (The underscore is added here to avoid clashing with the source's data model.)

Add built-in support for pagination

To get the initial set of 100 pharmacies, we could use the following request:

/nearest/100/pharmacies/to/75001  (1st page)

For this issue, we could add support for getting the next 100 with the following:

/nearest/100/pharmacies/to/75001/skipping/100  (2nd page)
/nearest/100/pharmacies/to/75001/skipping/200  (3rd page)

APIs today often offer continuation tokens that consider changes in the underlying data. As it is now, the underlying data is expected to remain reasonably static. So the benefits of a more complicated approach are not yet warranted and remains to be something that can be added at a later time when needed.

As the REST API gets more elaborate, we may want to handle all parsing of the query path ourselves instead of relying on FastAPI routes.

Add support for sending in lat/log measures to request

Currently, we can query for N records within X miles of a postalCode.

However, it would be helpful to request matches nearest a lat/long so that a browser's location API can be used to source the end-users location center.

Using a Lat/Long Center

/nearest/{count}/{sourceType}/to/{latitude}/{longitude}/within/{miles}
or
/nearest/{count}/{sourceType}/to/{latitude_longitude}/within/{miles}

The format of the lat/long could either be as separate parameters or perhaps it needs to be in a single parameter formatted like (32.947560, -96.839760) if the route parser can't disambiguate between other route paths.

Add Dockerfile

It'd be nice to have a container definition to build and deploy.

Add address geocoding support to API

Allow USPS addresses to be used as input to the API via the location parameter:

/nearest/{count}/{sourceType}/to/{location}[/within/{distance}/{units}]

This will require live support for Geocodio's API. Other Address-to-LL APIs worth looking at are PositionStack and Geocodeapi.

https://www.geocod.io/pricing/
https://positionstack.com/product
https://geocodeapi.com/#pricingSection

The data import script could feasibly be updated to include geocoding using the same service.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.