Skip to content

Commit

Permalink
Jkrdev (#124)
Browse files Browse the repository at this point in the history
* fix bbox parsing error for ci in parse_ext

* oxi png own bin/crate

* main!

* moved metadata stuff around more

* alrighty oxipng removed from main utiles cli'

* update async-sqlite! GO FOWLSTACK
  • Loading branch information
jessekrubin authored Jul 25, 2024
1 parent e552752 commit 7117683
Show file tree
Hide file tree
Showing 48 changed files with 472 additions and 222 deletions.
19 changes: 6 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ f.cjs
herm.*
*.db
*.db-journal
*.db-wal
*.sqlite-wal
*.mbtiles-wal


##################
Expand Down Expand Up @@ -127,8 +130,6 @@ bower_components
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
Expand All @@ -140,24 +141,15 @@ jspm_packages/
# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Zip files
*.zip

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# OS X temporary files
.DS_Store

# Rush temporary files
common/deploy/
common/temp/
Expand Down Expand Up @@ -187,8 +179,8 @@ third-party/

deployment.tar.gz
target/
.hypothesis/
file.py
.hypothesis/
file.py
*.so

# testing data
Expand All @@ -198,3 +190,4 @@ crates/**/*.mbtiles
crates/**/*.pmtiles
crates/**/*.sqlite
crates/**/*.utiles

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## TODO

- Docs/readme update
- Write/copy from planetiler/tippecanoe fails bc distinction between supported write schema and what is a recognized schema(s)
- Move `utiles-oxipng` to own crate/bin


## Unreleased/Future
Expand Down
24 changes: 20 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
resolver = "2"
members = [
"crates/utiles",
"crates/utiles-core",
"crates/utiles-core", "crates/utiles-oxipng",
"utiles-pyo3",
]

[workspace.package]
version = "0.7.0-alpha.2"
version = "0.7.0-alpha.3"
authors = [
"Jesse Rubin <[email protected]>",
"Dan Costello <[email protected]>",
Expand All @@ -20,11 +20,13 @@ repository = "https://github.com/jessekrubin/utiles"

[workspace.dependencies]
anyhow = "1.0.75"
# GIT DEP
async-sqlite = { version = "0.3.0", features = ["bundled", "functions", "trace"] }
async-sqlite = { version = "0.3.1", features = ["bundled", "functions", "trace"] }
clap = { version = "4.5.8", features = ["derive", "color", "wrap_help"] }
fast_hilbert = "2.0.0"
futures = "0.3.29"
geo-types = "0.7.9"
geojson = "0.24.1"
indicatif = "0.17.8"
indoc = "2.0.5"
pyo3 = "0.22.0"
pyo3-build-config = "0.22.0"
Expand All @@ -37,6 +39,7 @@ strum_macros = "0.26.3"
thiserror = "1.0.63"
tilejson = "0.4.1"
tokio = { version = "1.38.1", features = ["full"] }
tokio-stream = "0.1.15"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.17", features = ["serde", "serde_json", "env-filter"] }
xxhash-rust = { version = "0.8.10", features = ["xxh32", "xxh64", "xxh3", "const_xxh32", "const_xxh64", "const_xxh3"] }
Expand Down
1 change: 1 addition & 0 deletions crates/utiles-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ fast_hilbert.workspace = true
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
log = "0.4.22"
10 changes: 6 additions & 4 deletions crates/utiles-core/src/parsing.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! Parsing util(e)ities
use serde_json::Value;

use crate::bbox::BBox;
use crate::errors::UtilesCoreResult;
use crate::UtilesCoreError;
use serde_json::Value;

/// Parse a string into a `BBox`
///
Expand Down Expand Up @@ -162,7 +161,10 @@ pub fn parse_bbox(string: &str) -> UtilesCoreResult<BBox> {
pub fn parse_bbox_ext(string: &str) -> UtilesCoreResult<BBox> {
// match 'world' or 'planet'
// match string/lower
let str_lower = string.to_lowercase();
let str_lower = string
.trim()
.trim_matches(|c| c == '\'' || c == '"')
.to_lowercase();
let r = match str_lower.as_str() {
"world" | "planet" | "all" | "*" => Ok(BBox::new(-180.0, -90.0, 180.0, 90.0)),
"n" | "north" => Ok(BBox::new(-180.0, 0.0, 180.0, 90.0)),
Expand All @@ -173,7 +175,7 @@ pub fn parse_bbox_ext(string: &str) -> UtilesCoreResult<BBox> {
"nw" | "northwest" => Ok(BBox::new(-180.0, 0.0, 0.0, 90.0)),
"se" | "southeast" => Ok(BBox::new(0.0, -90.0, 180.0, 0.0)),
"sw" | "southwest" => Ok(BBox::new(-180.0, -90.0, 0.0, 0.0)),
_ => parse_bbox(string),
_ => parse_bbox(&str_lower),
};
r
}
Expand Down
22 changes: 22 additions & 0 deletions crates/utiles-oxipng/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "utiles-oxipng"
version.workspace = true
authors.workspace = true
documentation.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
publish = false

[dependencies]
anyhow.workspace = true
utiles = { path = "../utiles" }
tokio = { workspace = true, features = ["fs"] }
clap = { workspace = true, features = ["derive", "color", "wrap_help"] }
indicatif.workspace = true
oxipng = { version = "9.1.2", features = [] }
tracing.workspace = true
tokio-stream.workspace = true
futures.workspace = true
size.workspace = true
4 changes: 4 additions & 0 deletions crates/utiles-oxipng/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# `utiles-oxipng`

Exe/bin/thingy/apparatus that optimizes pngs using `oxipng` within a db that is
"mbtiles-like" (AKA: it can be queried as if it were `*.mbtiles`)
Loading

0 comments on commit 7117683

Please sign in to comment.