Implemented a Google Maps prototype that provides the shortest route in terms of distance

Overview

City-Navigation-AI

Implemented a Google Maps prototype that provides the shortest route in terms of distance, the fastest route, the route with the fewest turns, and a scenic route that avoids roads when provided a source and destination. The algorithms used were DFS, BFS, A*, and Iterative Depth First Search.

Approach to Road trip!

Abstraction:

Set of Valid states: Set of all probable segments which has routes in road-segments file.

Successor Function: Set of all possible segments has route from city1 which consists of parameters such as distance,speedlimit,city1,city2,highwayname
After generating all the successor routes we calculate the heuristic_score and cost_function for specified cost_attribute.

Cost Function: We have four cost functions such as:
  1. Segments:The cost for this is uniform 1 since we have only one edge from city1 to city2.
  2. Distance: The cost for this is the distance between city1 and city2 which is specified in road-segments file.
  3. Time: The cost for this is the time taken to travel from city1 to city2 which is evaluated by distance divided by speed_limit provided in road-segmensts file.
  4. Delivery: The cost for this is the time taken to deliver a product from city1 to city2. This will be evaluated by following conditions.
    • If the speed_limit is above 50 then there is 5% chance of falling out of the truck and the product gets damaged. So, while using this the probability of mistake is calculated as tanh(distance/1000)
    • So the time taken would incrase by two times because he has to go back to start city and pick the product.
    • If the speed_limit is less than 50 then there is no extra time_taken to deliver the product.

Goal State: Reaching end city on shortest possible cost function which will be specified by the user.

Initial State: Initial state is the start city provided by the user.

Heuristic Functions: Finding distance using latitude and longitude from current city to destination city which are provided in city-gps file. For some of the cities, langitudes and longitudes are missing so for the city which is missing we are considering the heuristic score of the previous city and adding to to the current path distance which will be used as current city's heuristic score.

Description of Algorithm:

Implemented using A* algorithm with an heuristic and specified cost function.
  1. Intially by using pandas module loading all the data from specified files to get road-segments and gps details and converting them to lists for better accessing. As mentioned, including the bidirectional condition as well.
  2. Calculating the time taken for all segments and mistakes for delivery cost function and adding to the list.
  3. Adding the start city into the frontier(fringe)
  4. Maintaing explored routes which is empty at the initial point.
  5. Looping till the frontier is not empty:
    1. Pop the latest city using heappop method in heapq module which gives the minheap board which has less f_score.
    2. Checking whether the board popped is the destination city. If yes, the return and print the segments, distance travelled, time taken and delivery.
    3. Otherwise, add this segment to explored list
    4. Generate all the successors segments for this current_city.
      1. For each successor route, calculates the F_score which is the sum of heuristic score and cost function based on cost_attribute.
      2. If the successor route is not in explored and not in frontier, then heappush the board into frontier with f_score of travelled route.

Construct and use map tile grids in different projection.

Morecantile +-------------+-------------+ ymax | | | | x: 0 | x: 1 | | y: 0 | y: 0

Development Seed 67 Dec 23, 2022
gjf: A tool for fixing invalid GeoJSON objects

gjf: A tool for fixing invalid GeoJSON objects The goal of this tool is to make it as easy as possible to fix invalid GeoJSON objects through Python o

Yazeed Almuqwishi 91 Dec 06, 2022
Platform for building statistical models of cities and regions

UrbanSim UrbanSim is a platform for building statistical models of cities and regions. These models help forecast long-range patterns in real estate d

Urban Data Science Toolkit 419 Dec 30, 2022
LicenseLocation - License Location With Python

LicenseLocation Hi,everyone! ❀ 🧑 πŸ’› πŸ’š πŸ’™ πŸ’œ This is my first project! βœ” Actual

The Bin 1 Jan 25, 2022
Minimum Bounding Box of Geospatial data

BBOX Problem definition: The spatial data users often are required to obtain the coordinates of the minimum bounding box of vector and raster data in

Ali Khosravi Kazazi 1 Sep 08, 2022
Streamlit Component for rendering Folium maps

streamlit-folium This Streamlit Component is a work-in-progress to determine what functionality is desirable for a Folium and Streamlit integration. C

Randy Zwitch 224 Dec 30, 2022
Build, deploy and extract satellite public constellations with one command line.

SatExtractor Build, deploy and extract satellite public constellations with one command line. Table of Contents About The Project Getting Started Stru

Frontier Development Lab 70 Nov 18, 2022
A GUI widget for Linux to show current time in different timezones.

A GUI widget to show current time in different timezones (under development). To use this widget: Run scripts/startup.py Select a country. A list of t

B.Jothin kumar 11 Nov 10, 2022
Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Ayush Mishra 3 May 06, 2022
Python renderer for OpenStreetMap with custom icons intended to display as many map features as possible

Map Machine project consists of Python OpenStreetMap renderer: SVG map generation, SVG and PNG tile generation, RΓΆntgen icon set: unique CC-BY 4.0 map

Sergey Vartanov 0 Dec 18, 2022
A Python tool to display geolocation information in the traceroute.

IP2Trace Python IP2Trace Python is a Python tool allowing user to get IP address information such as country, region, city, latitude, longitude, zip c

IP2Location 22 Jan 08, 2023
Automated download of LANDSAT data from USGS website

LANDSAT-Download It seems USGS has changed the structure of its data, and so far, I have not been able to find the direct links to the products? Help

Olivier Hagolle 197 Dec 30, 2022
pure-Python (Numpy optional) 3D coordinate conversions for geospace ecef enu eci

Python 3-D coordinate conversions Pure Python (no prerequistes beyond Python itself) 3-D geographic coordinate conversions and geodesy. API similar to

Geospace code 292 Dec 29, 2022
WhiteboxTools Python Frontend

whitebox-python Important Note This repository is related to the WhiteboxTools Python Frontend only. You can report issues to this repo if you have pr

Qiusheng Wu 304 Dec 15, 2022
Python interface to PROJ (cartographic projections and coordinate transformations library)

pyproj Python interface to PROJ (cartographic projections and coordinate transformations library). Documentation Stable: http://pyproj4.github.io/pypr

832 Dec 31, 2022
Open GeoJSON data on geojson.io

geojsonio.py Open GeoJSON data on geojson.io from Python. geojsonio.py also contains a command line utility that is a Python port of geojsonio-cli. Us

Jacob Wasserman 114 Dec 21, 2022
GebPy is a Python-based, open source tool for the generation of geological data of minerals, rocks and complete lithological sequences.

GebPy is a Python-based, open source tool for the generation of geological data of minerals, rocks and complete lithological sequences. The data can be generated randomly or with respect to user-defi

Maximilian Beeskow 16 Nov 29, 2022
Tile Map Service and OGC Tiles API for QGIS Server

Tiles API Add tiles API to QGIS Server Tiles Map Service API OGC Tiles API Tile Map Service API - TMS The TMS API provides these URLs: /tms/? to get i

3Liz 6 Dec 01, 2021
Python bindings to libpostal for fast international address parsing/normalization

pypostal These are the official Python bindings to https://github.com/openvenues/libpostal, a fast statistical parser/normalizer for street addresses

openvenues 651 Dec 16, 2022
This app displays interesting statistical weather records and trends which can be used in climate related research including study of global warming.

This app displays interesting statistical weather records and trends which can be used in climate related research including study of global warming.

0 Dec 27, 2021