Skip to content

Instantly share code, notes, and snippets.

View pedrocamargo's full-sized avatar
💭
OpenSourcy

Pedro Camargo pedrocamargo

💭
OpenSourcy
View GitHub Profile
@pedrocamargo
pedrocamargo / Assigning from tnpm to reproduce error.ipynb
Last active April 14, 2020 08:13
Reproducing AequilibraE issue #124
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pedrocamargo
pedrocamargo / TSP with AequilibraE.ipynb
Created March 30, 2020 08:04
Using AequilibraE and Google OR-Tools to compute the TSP
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pedrocamargo
pedrocamargo / tnpm_parsing.py
Last active March 31, 2020 13:00
Parsing Networks in the TNPM format for consumption in AequilibraE
import aequilibrae
import os
import sys
import numpy as np
import pandas as pd
import openmatrix as omx
from aequilibrae.matrix import AequilibraeMatrix
data_folder = 'path/to/the/anaheim/folder'
@pedrocamargo
pedrocamargo / compassbearing.py
Created April 17, 2017 07:48 — forked from jeromer/compassbearing.py
compass bearing between two points in Python
def calculate_initial_compass_bearing(pointA, pointB):
"""
Calculates the bearing between two points.
The formulae used is the following:
θ = atan2(sin(Δlong).cos(lat2),
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong))
:Parameters:
- `pointA: The tuple representing the latitude/longitude for the