update
This commit is contained in:
@@ -9,3 +9,4 @@ scylla = "0.12"
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
anyhow = "1.0"
|
||||
memmap2 = "0.9"
|
||||
dotenv = "0.15"
|
||||
|
||||
@@ -124,6 +124,9 @@ fn should_include(tags: &HashMap<String, String>, zoom: u32) -> bool {
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
// Load .env file if present
|
||||
dotenv::dotenv().ok();
|
||||
|
||||
// Connect to ScyllaDB
|
||||
let uri = std::env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
|
||||
println!("Connecting to ScyllaDB at {}...", uri);
|
||||
@@ -160,7 +163,9 @@ async fn main() -> Result<()> {
|
||||
let insert_railways = session.prepare("INSERT INTO map_data.railways (zoom, tile_x, tile_y, id, tags, points) VALUES (?, ?, ?, ?, ?, ?)").await?;
|
||||
println!("Statements prepared.");
|
||||
|
||||
let path = std::env::var("OSM_PBF_PATH").unwrap_or_else(|_| "europe-latest.osm.pbf".to_string());
|
||||
let path = std::env::var("OSM_PBF_PATH")
|
||||
.or_else(|_| std::env::var("HOST_PBF_PATH"))
|
||||
.unwrap_or_else(|_| "europe-latest.osm.pbf".to_string());
|
||||
println!("Reading {}...", path);
|
||||
let reader = ElementReader::from_path(path)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user