This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from xml.dom import minidom | |
proj_dir = "/Users/zia/Documents/journals/My_WriteUp/Terrain_Routing_New/osm_data_downloaded/singaporeMalaysia/numberOfNodesPerRoad" | |
rel_file_path = "osm.osm"; | |
abs_file_path = os.path.join(proj_dir, rel_file_path) | |
result_rel_file_path = "numberOfNodesPerRoad.csv" | |
result_abs_file_path = os.path.join(proj_dir, result_rel_file_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import osgeo.ogr | |
shapefile = osgeo.ogr.Open("/Users/zia/Documents/journals/My_WriteUp/pgr_TPP_5Algos/data/citySelection/majorCountriesCityShapefile/selectedworldcityshapes.shp") | |
layer = shapefile.GetLayer(0) | |
f = open("/Users/zia/Documents/journals/My_WriteUp/pgr_TPP_5Algos/data/citySelection/testCode/osmCityDownloadLinks.txt", 'w') | |
for i in range(layer.GetFeatureCount()): | |
feature = layer.GetFeature(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"======== Custom Mapping ======== | |
"general mapping | |
nmap <C-Tab> :tabnext<CR> | |
nmap <C-S-Tab> :tabprevious<CR> | |
map <C-S-Tab> :tabprevious<CR> | |
map <C-Tab> :tabnext<CR> | |
imap <C-S-Tab> <ESC> : tabprevious<CR> | |
imap <C-Tab> <ESC> : tabnext<CR> | |
noremap <F7> :set expandtab!<CR> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The following should be OK | |
select pgr_labelGraph('ways'); | |
select pgr_labelGraph('Ways'); | |
select pgr_labelGraph('ways', 'id'); | |
select pgr_labelGraph('ways', 'id', 'source'); | |
select pgr_labelGraph('ways', 'id', 'source', 'target'); | |
select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph'); | |
select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<100'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<StyledLayerDescriptor version="1.0.0" | |
xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" | |
xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" | |
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<NamedLayer> | |
<Name>point_bank</Name> | |
<UserStyle> | |
<Title>bank point style</Title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Trim terminal path: | |
PS1='\u:\W\$ ' | |
OR | |
PS1='\W\$ ' | |
2. Go to previous directory: | |
cd - | |
3. Kill Port process and free it: | |
sudo lsof -i :3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, time, datetime, sys | |
##### Usage: | |
# python script.py A B C D E F | |
# A = X start | |
# B = X end | |
# C = Y start | |
# D = Y end | |
# E = traffic Dir parent path | |
# F = wgetList1.txt, i.e. wget List file name. This will keep on updating in each while loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Download OSM File from rectangle drag</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grequests, requests, time | |
then = time.time() | |
urls = [ | |
'https://api.ohsome.org/v0.9/elements/geometry?bboxes=8.625%2C49.3711%2C8.7334%2C49.4397&properties=tags&showMetadata=false&time=2014-01-01%2C2017-01-01&types=way', | |
'https://api.ohsome.org/v0.9/elements/geometry?bboxes=8.625%2C49.3711%2C8.7334%2C49.4397&properties=tags&showMetadata=false&time=2014-01-01%2C2017-01-01&types=way', | |
'https://api.ohsome.org/v0.9/elements/geometry?bboxes=8.625%2C49.3711%2C8.7334%2C49.4397&properties=tags&showMetadata=false&time=2014-01-01%2C2017-01-01&types=way' | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Docker | |
- Kill/Stop all containers - | |
docker kill $(docker ps -q) | |
- Delete all containers - | |
docker rm $(docker ps -a -q) | |
- Delete all images - | |
docker rmi $(docker images -q) |