Coder Social home page Coder Social logo

junlindu / bear-map Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 86.37 MB

๐Ÿ—บ๏ธ Bear Map is a mapping web application project similar to Google maps, which covers the region of Berkeley, California. The map utilizes real-world mapping data from OpenStreetMap and various generic data structures to perform image rastering, graph building, routing, and auto-completion etc..

Java 73.09% HTML 7.20% JavaScript 12.95% CSS 6.76%
java openstreetmap data-structures astar-algorithm pathfinding sparkjava jquey

bear-map's People

Contributors

junlindu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

harsharisha9731

bear-map's Issues

Retrieval Tree Optimization

The Retrieval tree can be optimized by:

  1. Having each node storing a value and the best value of its substring, so that the tree will not have to loop through all of its children, but instead look for children in the order of "best".
  2. using a priority queue to implement the feature.

Retrieval Tree NullPointer Exception

Null Pointer Exception is thrown when provided string has no match in the tree

private List<String> keysWithPrefixRecursive (Node node, List<String> list, String prefix) {
if (node.mapToChildren.isEmpty() && node.endNode) {
list.add(prefix + node.getLetter());
return list;
} else if (node.endNode) {
list.add(prefix + node.getLetter());
}
for (Map.Entry<Character, Node> entry : node.mapToChildren.entrySet()) {
list = keysWithPrefixRecursive(entry.getValue(), list, prefix + node.getLetter());
}
return list;
}

changePriority exception thrown running dijkstra

https://github.com/JunlinDu/bear-map-project/blob/ecd77f35b5acb998c2cb602e971a1aa70972bef3/src/main/java/Router/ArrayHeapMinPQ.java#L167-L177
changePriority is not working properly as the call to test41to46() and test66to55() in TestRouterTiny will throw following exceptions:

java.util.NoSuchElementException
at Router.ArrayHeapMinPQ.changePriority(ArrayHeapMinPQ.java:169)
at Router.Router.relaxEdgeFrom(Router.java:76)
at Router.Router.shortestPath(Router.java:59)
at TestRouterTiny.test41to46(TestRouterTiny.java:50)

java.util.NoSuchElementException
at Router.ArrayHeapMinPQ.changePriority(ArrayHeapMinPQ.java:169)
at Router.Router.relaxEdgeFrom(Router.java:76)
at Router.Router.shortestPath(Router.java:59)
at TestRouterTiny.test66to55(TestRouterTiny.java:61)

Update The issue is believed to be linked with sink() in ArrayMinPQ().
Note sink() has never been tested before

https://github.com/JunlinDu/bear-map-project/blob/ecd77f35b5acb998c2cb602e971a1aa70972bef3/src/main/java/Router/ArrayHeapMinPQ.java#L104-L115

Necessity of Inner Class Edge

https://github.com/JunlinDu/bear-map-project/blob/45bc72643116e303de00cf04ef219725a69e036c/src/main/java/GraphBuilder/GraphDB.java#L55-L74

Inner-class Edge might not be required, since distance() calculates the distance between two nodes. However, the removal of the Edge class might require refactoring in GraphBuildingHandler and GraphDB.
The justification for keeping this class might be an improvement in performance in runtime, which also requires refactoring of GraphDB class.
This is to be determined after path searching implementation is done.

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.