Code Monkey home page Code Monkey logo

overscape-server's Introduction

Overscape

Overscape is a replacement for some of the backend services for the Microsoft Soundscape iOS app.

It serves map data by sending queries to a public or privately-hosted Overpass server. Since it doesn't store its own data, it should be simpler to deploy and run than the server code provided by Microsoft.

Using with Soundscape app in a simulator

  1. In this repository, run the server:
    1. To use a public Overpass server as the data source, run:
    $ docker build -t overscape .
    $ docker run -it --rm -p 8080:8080 overscape
    
    1. Alternatively, to create a local Overpass container with a small dataset (Washington, DC):
    $ docker-compose up --build
    
    1. To confirm the server is up and serving JSON data, use a browser to visit a tile URL like http://localhost:8080/tiles/16/18745/25070.json
  2. In the Soundscape repository, in source code file apps/ios/GuideDogs/Code/Data/Services/Helpers/ServiceModel.swift at line 36, set the productionServicesHostName value to http://localhost:8080.
  3. Open apps/ios/GuideDogs.xcworkspace in Xcode, and run the iOS simulator.
    1. To trigger queries to our local server, set "Location" (under the "Feature" menu) to a value that simulates moving, like "City Run."
    2. You may also need to install a text-to-speech voice in the iOS settings.

Running the original Soundscape server

You can also run the original Soundscape server code as provided by Microsoft. Unlike Overscape, the Microsoft version involves loading and hosting of bulk OpenStreetMap data in a PostGIS database. See the docker-compose file for details on spinning up the necessary services.

Overscape also supports using a PostGIS server as a backend -- simply pass the argument --backend-url postgres://user:password@host:port/db when launching the server.

Running tests

pip install -r requirements_test.txt
cd app && pytest --asyncio-mode=auto tests.py

overscape-server's People

Contributors

oliver2213 avatar rdmurray avatar steinbro avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

steinbro

overscape-server's Issues

change to use aiohttp for client connections so that it is all async

I did try to create a pull request, but it seems like the permissions for openscape-community don't allow it.

I have switched to aiohttp instead of requests, because requests is blocking and I think it was the cause of a lot of the errors that I previously saw. The branch is at RDMurray/overscape-server

Unfortunately it breaks tests for now. This is the branch currently running on soundscape.mur.org.uk

Exception coming from Sentry integration

@Oliver2213 noticed this in our logs:

ERROR:aiohttp.server:Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/sentry_sdk/integrations/aiohttp.py", line 129, in sentry_app_handle
    transaction.set_http_status(response.status)
AttributeError: 'NoneType' object has no attribute 'status'

According to getsentry/sentry-python#951, this may be a bug with Sentry's aiohttp integration, but it's not clear what the fix or workaround is.

Does this failure in Sentry mean that a lot of our successful responses are actually being reported as failures? Hopefully it's not actually causing failed responses to users?

Support multiple Overpass server simultaneously

We're currently limited to forwarding all requests to a single (albeit configurable) Overpass server. We should have a pool acrosswhich to load balance, perhaps specifying the region of the world for which each can be used. I'm imagining a future where the world's data is distributed among a set of modest servers hosted by different individuals/organizations.

Support PostGIS server backend

This sort of defeats the purpose of Overscape, but now that it's instrumented with Sentry probes, there's some value in supporting non-Overpass backends, namely to use a PostGIS server as a drop-in replacement and to compare the performance/error rate. @Oliver2213 am I correct this would be helpful? I think it wouldn't take much work from me.

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.