Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 csv | |
import os | |
class Row: | |
def __init__(self, row): | |
self.srv = f"{row['LIGNE']}-{row['TRONCON']}-{row['VOIE']}" | |
self.longitude = float(row['LONGITUDE']) | |
self.latitude = float(row['LATITUDE']) | |
self.pk = float(row['PK']) |
This file contains 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
pub struct Id<T> { | |
id: String, | |
_phantom: std::marker::PhantomData<T>, | |
} | |
use std::collections::HashMap; | |
pub struct Topology { | |
pub metadata: Metadata, | |
pub networks: Vec<Network>, |
This file contains 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 tsplib95 | |
import geojson | |
import pyproj | |
problem = tsplib95.load('communes.tsp') | |
f = open("out_linkern","r") | |
lines = f.readlines()[1:] | |
transformer = pyproj.Transformer.from_crs(2154, 4326, always_xy=True) | |
coordinates = [] |
This file contains 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
# On importe le tracé des communes dans la base postgres | |
# Source des données https://geoservices.ign.fr/adminexpress | |
# -I pour créer un indexe (ça premet de gagner un peu de temps au moment de croiser les données) | |
# -D pour le format dump, pour que ça aille plus vite | |
# -s 2154 pour préciser que les données sont projetée en Lambert 93 (même si par la suite ça n’a pas servi comme précision) | |
shp2pgsql -s 2154 -I -D ADMIN-EXPRESS_3-1__SHP_LAMB93_FXX_2023-03-20/ADMIN-EXPRESS/1_DONNEES_LIVRAISON_2023-03-20/ADE_3-1_SHP_LAMB93_FXX/COMMUNE.shp communes | psql | |
# Idem pour les côtes | |
shp2pgsql -I -D -s 2154 Limite_terre_mer_France_metropolitaine/SHAPE/Limite_terre-mer_France_metropolitaine_fermeturesLIMAR.shp cotes | psql |
This file contains 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
ALTER TABLE ways RENAME COLUMN gid TO id, | |
ALTER TABLE ways ADD COLUMN country text; | |
ALTER TABLE ways RENAME COLUMN maxspeed_forward TO maxspeed; | |
ALTER TABLE ways DROP COLUMN maxspeed_backward; | |
ALTER TABLE ways DROP COLUMN cost_s; | |
ALTER TABLE ways DROP COLUMN reverse_cost_s; | |
ALTER TABLE ways DROP COLUMN one_way; | |
ALTER TABLE ways DROP COLUMN oneway; | |
ALTER TABLE ways DROP COLUMN priority; | |
ALTER TABLE ways DROP COLUMN tag_id; |
This file contains 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
""" | |
This tool is meant to process GTFS files from transport.data.gouv.fr, | |
convert them to the NeTEx format, | |
and upload them as community resources to transport.data.gouv.fr | |
""" | |
import logging | |
import subprocess | |
import tempfile | |
import urllib.request |
This file contains 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
""" | |
This tool is meant to process GTFS files from transport.data.gouv.fr, | |
convert them to the NeTEx format, | |
and upload them as community resources to transport.data.gouv.fr | |
""" | |
import urllib.request | |
import tempfile | |
import subprocess | |
import requests |
This file contains 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 csv | |
import json | |
import os | |
import shutil | |
import subprocess | |
import time | |
import urllib.request | |
tartare = "../tartare-tools/target/release/gtfs2netexfr" | |
url = "https://transport.data.gouv.fr/api/datasets" |
NewerOlder