Git Product home page Git Product logo

Comments (2)

jakecoppinger avatar jakecoppinger commented on June 13, 2024 1

Ah yes, that is correct. The lane attributes information is fetched when viewing details about an intersection and makes one OSM API request for that intersection.

I think making an extra request for every pin would be an unacceptable number of extra requests to the OSM API - I'm already uncomfortable with the number it current makes to get node positions.

Possibly in the short term we should only focus on filtering on cycle time? I'm thinking something like:

  • two textboxes, one a min and one a max cycle time to show on the map
  • a custom component with two sliders, allowing to set an interval (min/max).

Long term it probably makes sense to either:

  • pre-fetch all the data, make all the requests to the OSM API and statically render the site and data
  • set up a backend to cache requests for nodes

For simplicity's sake and for keeping the website responsive to new submissions I'm inclined to keep it live generated as long as possible! Open to suggestions though.

from better-intersections.

Uzaif-Sheikh avatar Uzaif-Sheikh commented on June 13, 2024

Hi Jake, Hope moving isn't proving to be too stressful 🏠. To filter points using lanes I believe that we have to get the OsmWayKeys tags for each intersection and I have checked the openstreetmap API, it seems there is no api to fetch multiple ways. So, I was thinking of fetching the ways for each intersection at the beginning.

export interface IntersectionStats {
  osmId: string;
  lat: number,
  lon: number,
  reports: TrafficLightReport[];
  tags: Record<string, string>;
  way: Way;  /**  Here we add a way field in the IntersectionStats interface /
}

But I feel like it's a bit inefficient to send a fetch req for every single point, but I can't think of any other way?

from better-intersections.

Related Issues (20)

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.