Skip to content

Commit

Permalink
refactor: Remove unused stats collection, fix stats templates
Browse files Browse the repository at this point in the history
  • Loading branch information
emi420 committed Jan 29, 2025
1 parent 22c20f1 commit ab65795
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/post_processing/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def post_process_line(self, line: str):
fn(line_object)

return json.dumps(line_object)

def get_categories_config(self, category_name):
config = CATEGORIES_CONFIG.get(category_name)
return config if config else CATEGORIES_CONFIG["default"]
Expand All @@ -62,9 +62,6 @@ def custom(
self.geoJSONStats.config.area = category_config["area"]

if self.options["include_stats"]:
if category_tag:
self.geoJSONStats.config.keys.append(category_tag)
self.geoJSONStats.config.value_keys.append(category_tag)

path_input = os.path.join(export_format_path, f"{export_filename}.geojson")
path_output = os.path.join(
Expand Down
4 changes: 2 additions & 2 deletions src/post_processing/stats_building_tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
</head>
<body>
<div id="root">
<h2>{title}</h2>
<h2>${title}</h2>
<div class="container">
<div class="box featured">
<h3>${key_building_area}</h3>
<h3>${area}</h3>
<h4>Km2 of buildings</h4>
</div>
<div class="box">
Expand Down
4 changes: 2 additions & 2 deletions src/post_processing/stats_highway_tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@
</head>
<body>
<div id="root">
<h2>{title}</h2>
<h2>${title}</h2>
<div class="container">
<div class="box featured">
<h3>${key_highway_length}</h3>
<h3>${length}</h3>
<h4>Km of roads</h4>
</div>
<div class="box">
Expand Down
2 changes: 1 addition & 1 deletion src/post_processing/stats_railway_tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
</head>
<body>
<div id="root">
<h2>{title}</h2>
<h2>${title}</h2>
<div class="container">
<div class="box featured">
<h3>${key_railway_length}</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/post_processing/stats_waterway_tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
</head>
<body>
<div id="root">
<h2>{title}</h2>
<h2>${title}</h2>
<div class="container">
<div class="box featured">
<h3>${key_waterway_length}</h3>
Expand Down

0 comments on commit ab65795

Please sign in to comment.