Skip to content

Commit

Permalink
Set flowchart location from environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsdukai committed Apr 5, 2023
1 parent 0a2d63e commit 55f4cc1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ For instance turn on the debug messages.
```shell
RUST_LOG=debug tyler ...
```
### Resources directory

Tyler need two geoflow flowchart files in order to export glTF files.
These files are located in the `resources/geof` directory and they are picked up automatically when the docker image is used.
However, it is also possible to provide their location with the environment variable `TYLER_RESOURCES_DIR`, pointing to the `geof` directory.
For example `export TYLER_RESOURCES_DIR=/some_path/geof`.

### Exporting 3D Tiles

Expand Down
13 changes: 9 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mod parser;
mod proj;
mod spatial_structs;

use std::env;
use std::fs;
use std::fs::File;
use std::io::Write;
Expand Down Expand Up @@ -90,13 +91,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
popen_error.to_string()
)
}
SubprocessConfig {
output_extension: "glb".to_string(),
exe,
script: PathBuf::from(env!("CARGO_MANIFEST_DIR"))
let geof_flowchart_path = match env::var("TYLER_RESOURCES_DIR") {
Ok(var) => PathBuf::from(var).join("geof").join("createGLB.json"),
Err(_) => PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("resources")
.join("geof")
.join("createGLB.json"),
};
SubprocessConfig {
output_extension: "glb".to_string(),
exe,
script: geof_flowchart_path,
}
}
Formats::CityJSON => {
Expand Down

0 comments on commit 55f4cc1

Please sign in to comment.