From 4fb856d6ccc5850ba8ecab01e86885a7b5bec541 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Fri, 9 Aug 2024 15:57:22 -0600 Subject: [PATCH 1/2] fix: If --extract is used, it needs to be passed to split_by_square() --- fmtm_splitter/splitter.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/fmtm_splitter/splitter.py b/fmtm_splitter/splitter.py index bd58e61..3de04a0 100755 --- a/fmtm_splitter/splitter.py +++ b/fmtm_splitter/splitter.py @@ -778,11 +778,22 @@ def main(args_list: list[str] | None = None): raise ValueError(err) if args.meters: - split_by_square( - args.boundary, - meters=args.meters, - outfile=args.outfile, - ) + if args.extract: + file = open(args.extract, "r") + data = geojson.load(file) + file.close() + split_by_square( + args.boundary, + meters=args.meters, + osm_extract=data, + outfile=args.outfile, + ) + else: + split_by_square( + args.boundary, + meters=args.meters, + outfile=args.outfile, + ) elif args.number: split_by_sql( args.boundary, From dc64ad762b742b37fd2b4e87a4b1bd3b18feaf9b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 22:00:19 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- fmtm_splitter/splitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmtm_splitter/splitter.py b/fmtm_splitter/splitter.py index 3de04a0..b1051e8 100755 --- a/fmtm_splitter/splitter.py +++ b/fmtm_splitter/splitter.py @@ -787,7 +787,7 @@ def main(args_list: list[str] | None = None): meters=args.meters, osm_extract=data, outfile=args.outfile, - ) + ) else: split_by_square( args.boundary,