Coder Social home page Coder Social logo

bike-omaha's Introduction

bike-omaha

Android app for viewing bike paths/routes in omaha. Hoping to make travel by bicycle less painful for Omaha residents.

Rough Outline

Design

Full screen map as main app screen Minimal or nonexistent top bar Rounded bottom sheet peeking out at bottom with drag handle/expand button (drag handle possibly not viable with phone swipe navigation) Bottom sheet contains toggles for turning individual routes on/off

Data

Data hosted on my github pages site in a raw json file JSON file will contain GPS data in GeoJSON format.

Other Resources

There are a few GeoJSON kotlin libraries available, here's a one that has semi-active development https://github.com/chris-hatton/geojson-kotlin

Google Maps SDK for Android supports loading GeoJSON directly

Service Documentation

bradpatras.github.io/bike-omaha/v1/trails.json

This is the file that the app consumes.

This raw json file will contain all the trails, each in a json object. A trail object will have three values, a title, an identifier, and a GeoJSON feature collection json object.

{
    "trails": [
        {
            "title": "West Papio Trail", // String
            "identifier": 1, // Int
            "geoJSON": {}, // GeoJSON 'FeatureCollection' object (massive)
        },
    ]
}

'Back End'

I played with different ideas for generating the trails.json file but settled with a script that will take in FeatureCollection json files, and combine them with a more eye-friendly metadata json file. One thing i'm trying to avoid is ever having to manually edit the FeatureCollection files. The GeoJSON data will all be generated by either a converter from KML, or from a graphical mapping tool that generates GeoJSON directly, like geojson.io. The only manual data entry that I plan on doing is adding a new metadata entry when I add a new trail and then pasting in a geojson file into the directory.

Here's what the metadata file looks like

{
    "trails": [
        {
            "title": "West Papio Trail",
            "identifier": 1,
            "filename": "west-papio.json"
        },
        {
            "title": "Keystore Trail",
            "identifier": 2,
            "filename": "keystone.json"
        }
    ]
}

The combination is done using a swift CLI located in the services directory. It's a swift package app so before you can run it you need to navigate to services dir, then run swift build. That will place an executable in the .build/debug folder, or you could also just run swift run service-builder. More info on the service builder here

Dev Notes

  • GeoJsonFeature 'properties' json object contain styling to be used when laying out the feature on the map (stroke width, stroke color). Currently these properties are required by the app to be present and they are not documented anywhere and were originally created by the kml exporter on the google MyMaps GUI. I don't want to be locked in to using the MyMaps GUI in the future for creating new trails so I should figure out a way of adding the properties to the features some other way. Possibly as part of the service-builder build action. At the very least I need to add some validation to the service-builder script to ensure that the features all contain a valid properties object.

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.