forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
6122d2a42c
commit
a2bcfead15
22 changed files with 448 additions and 86 deletions
|
@ -13,7 +13,6 @@ import StaticFeatureSource, {
|
|||
} from "../FeatureSource/Sources/StaticFeatureSource"
|
||||
import { MapProperties } from "../../Models/MapProperties"
|
||||
import { Orientation } from "../../Sensors/Orientation"
|
||||
|
||||
;("use strict")
|
||||
/**
|
||||
* The geolocation-handler takes a map-location and a geolocation state.
|
||||
|
|
|
@ -14,7 +14,6 @@ import {
|
|||
} from "geojson"
|
||||
import { Tiles } from "../Models/TileRange"
|
||||
import { Utils } from "../Utils"
|
||||
|
||||
;("use strict")
|
||||
|
||||
export class GeoOperations {
|
||||
|
|
|
@ -5,7 +5,6 @@ import { BBox } from "../BBox"
|
|||
import osmtogeojson from "osmtogeojson"
|
||||
import { FeatureCollection, Geometry } from "geojson"
|
||||
import { OsmTags } from "../../Models/OsmFeature"
|
||||
|
||||
;("use strict")
|
||||
/**
|
||||
* Interfaces overpass to get all the latest data
|
||||
|
|
|
@ -32,7 +32,9 @@
|
|||
}[]
|
||||
> = allHistories.mapD((histories) => HistoryUtils.fullHistoryDiff(histories, usernames))
|
||||
|
||||
const trs = shared_questions.tagRenderings.map((tr) => new TagRenderingConfig(<TagRenderingConfigJson>tr))
|
||||
const trs = shared_questions.tagRenderings.map(
|
||||
(tr) => new TagRenderingConfig(<TagRenderingConfigJson>tr)
|
||||
)
|
||||
|
||||
function detectQuestion(key: string): TagRenderingConfig {
|
||||
return trs.find((tr) => tr.freeform?.key === key)
|
||||
|
@ -69,7 +71,7 @@
|
|||
keyCounts.forEach((values: Map<string, OsmObject[]>, key: string) => {
|
||||
const keyTotal: { value: string; features: Feature[] }[] = []
|
||||
values.forEach((count, value) => {
|
||||
keyTotal.push({ value, features: count.map(step => step.asGeoJson()) })
|
||||
keyTotal.push({ value, features: count.map((step) => step.asGeoJson()) })
|
||||
})
|
||||
let countForKey: Feature[] = []
|
||||
for (const { features } of keyTotal) {
|
||||
|
@ -78,10 +80,14 @@
|
|||
keyTotal.sort((a, b) => b.features.length - a.features.length)
|
||||
const tr = detectQuestion(key)
|
||||
perKey.push({
|
||||
count: countForKey.length, tr, key, values: keyTotal.map(({ value, features }) => ({
|
||||
count: countForKey.length,
|
||||
tr,
|
||||
key,
|
||||
values: keyTotal.map(({ value, features }) => ({
|
||||
value,
|
||||
count: features.length
|
||||
})), features: countForKey
|
||||
count: features.length,
|
||||
})),
|
||||
features: countForKey,
|
||||
})
|
||||
})
|
||||
perKey.sort((a, b) => b.count - a.count)
|
||||
|
@ -118,14 +124,13 @@
|
|||
{/each}
|
||||
</ul>
|
||||
{#if diff.tr}
|
||||
<div class="w-48 h-48">
|
||||
|
||||
<div class="h-48 w-48">
|
||||
<ToSvelte
|
||||
construct={new TagRenderingChart(diff.features, diff.tr, {
|
||||
groupToOtherCutoff: 0,
|
||||
chartType: "pie",
|
||||
sort: true,
|
||||
})}
|
||||
groupToOtherCutoff: 0,
|
||||
chartType: "pie",
|
||||
sort: true,
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
{:else}
|
||||
|
|
|
@ -44,37 +44,37 @@ export class HistoryUtils {
|
|||
.filter((ch) => ch.oldValue !== ch.value)
|
||||
}
|
||||
|
||||
public static fullHistoryDiff(histories: OsmObject[][], onlyShowUsername?: Set<string>): {
|
||||
key: string;
|
||||
value?: string;
|
||||
oldValue?: string;
|
||||
public static fullHistoryDiff(
|
||||
histories: OsmObject[][],
|
||||
onlyShowUsername?: Set<string>
|
||||
): {
|
||||
key: string
|
||||
value?: string
|
||||
oldValue?: string
|
||||
step: OsmObject
|
||||
}[] {
|
||||
|
||||
const allDiffs: {
|
||||
key: string;
|
||||
value?: string;
|
||||
oldValue?: string;
|
||||
key: string
|
||||
value?: string
|
||||
oldValue?: string
|
||||
step: OsmObject
|
||||
}[] = []
|
||||
for (const history of histories) {
|
||||
const filtered = history.filter(
|
||||
(step) =>
|
||||
!onlyShowUsername ||
|
||||
onlyShowUsername?.has(step.tags["_last_edit:contributor"])
|
||||
!onlyShowUsername || onlyShowUsername?.has(step.tags["_last_edit:contributor"])
|
||||
)
|
||||
for (const step of filtered) {
|
||||
const diff: {
|
||||
key: string;
|
||||
value?: string;
|
||||
oldValue?: string;
|
||||
key: string
|
||||
value?: string
|
||||
oldValue?: string
|
||||
step: OsmObject
|
||||
}[] = HistoryUtils.tagHistoryDiff(step, history)
|
||||
allDiffs.push(...diff)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return allDiffs
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
}
|
||||
})
|
||||
|
||||
|
||||
let state = {
|
||||
mapProperties: maplibremap,
|
||||
searchState: {
|
||||
|
@ -175,10 +174,9 @@
|
|||
}
|
||||
map.data.flyTo({
|
||||
zoom: 14,
|
||||
center: [suggestion.lon, suggestion.lat]
|
||||
center: [suggestion.lon, suggestion.lat],
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="flex h-screen w-full flex-col">
|
||||
|
|
|
@ -55,9 +55,12 @@
|
|||
{#if $allowFilters}
|
||||
<FilterResults {state} />
|
||||
{/if}
|
||||
<GeocodeResults {state} on:select={(select) => {
|
||||
state.searchState.applyGeocodeResult(select.detail)
|
||||
}}>
|
||||
<GeocodeResults
|
||||
{state}
|
||||
on:select={(select) => {
|
||||
state.searchState.applyGeocodeResult(select.detail)
|
||||
}}
|
||||
>
|
||||
<svelte:fragment slot="if-no-results">
|
||||
{#if $recentlySeen?.length > 0}
|
||||
<SidebarUnit>
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import { FixedUiElement } from "./Base/FixedUiElement"
|
||||
import BaseUIElement from "./BaseUIElement"
|
||||
import { default as FeatureTitle } from "./Popup/Title.svelte"
|
||||
import { RenderingSpecification, SpecialVisualization, SpecialVisualizationState } from "./SpecialVisualization"
|
||||
import {
|
||||
RenderingSpecification,
|
||||
SpecialVisualization,
|
||||
SpecialVisualizationState,
|
||||
} from "./SpecialVisualization"
|
||||
import { HistogramViz } from "./Popup/HistogramViz"
|
||||
import { UploadToOsmViz } from "./Popup/UploadToOsmViz"
|
||||
import { MultiApplyViz } from "./Popup/MultiApplyViz"
|
||||
|
@ -36,11 +40,8 @@ import { UISpecialVisualisations } from "./SpecialVisualisations/UISpecialVisual
|
|||
import { SettingsVisualisations } from "./SpecialVisualisations/SettingsVisualisations"
|
||||
import { ReviewSpecialVisualisations } from "./SpecialVisualisations/ReviewSpecialVisualisations"
|
||||
import { DataImportSpecialVisualisations } from "./SpecialVisualisations/DataImportSpecialVisualisations"
|
||||
import TagrenderingManipulationSpecialVisualisations
|
||||
from "./SpecialVisualisations/TagrenderingManipulationSpecialVisualisations"
|
||||
import {
|
||||
WebAndCommunicationSpecialVisualisations
|
||||
} from "./SpecialVisualisations/WebAndCommunicationSpecialVisualisations"
|
||||
import TagrenderingManipulationSpecialVisualisations from "./SpecialVisualisations/TagrenderingManipulationSpecialVisualisations"
|
||||
import { WebAndCommunicationSpecialVisualisations } from "./SpecialVisualisations/WebAndCommunicationSpecialVisualisations"
|
||||
import ClearGPSHistory from "./BigComponents/ClearGPSHistory.svelte"
|
||||
import AllFeaturesStatistics from "./Statistics/AllFeaturesStatistics.svelte"
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"contributors": [
|
||||
{
|
||||
"commits": 9515,
|
||||
"commits": 9531,
|
||||
"contributor": "Pieter Vander Vennet"
|
||||
},
|
||||
{
|
||||
"commits": 546,
|
||||
"commits": 557,
|
||||
"contributor": "Robin van der Linde"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -682,9 +682,9 @@
|
|||
"vi"
|
||||
],
|
||||
"VU": [
|
||||
"fr",
|
||||
"en",
|
||||
"bi"
|
||||
"bi",
|
||||
"fr"
|
||||
],
|
||||
"WS": [
|
||||
"en",
|
||||
|
|
|
@ -11133,6 +11133,10 @@
|
|||
"if": "value=memorial",
|
||||
"then": "memorial - Layer showing memorial plaques, based upon a unofficial theme. Can be expanded to have multiple types of memorials later on"
|
||||
},
|
||||
{
|
||||
"if": "value=mobility_hub",
|
||||
"then": "mobility_hub - Mobility hubs are places where different kinds of transit meet, making it easy to switch between them. These places are usually part of a larger network or system."
|
||||
},
|
||||
{
|
||||
"if": "value=mountain_rescue",
|
||||
"then": "mountain_rescue - A building where first aid responders store material and might be on watch"
|
||||
|
|
|
@ -1012,6 +1012,10 @@
|
|||
"if": "value=memorial",
|
||||
"then": "<b>memorial</b> (builtin) - Layer showing memorial plaques, based upon a unofficial theme. Can be expanded to have multiple types of memorials later on"
|
||||
},
|
||||
{
|
||||
"if": "value=mobility_hub",
|
||||
"then": "<b>mobility_hub</b> (builtin) - Mobility hubs are places where different kinds of transit meet, making it easy to switch between them. These places are usually part of a larger network or system."
|
||||
},
|
||||
{
|
||||
"if": "value=mountain_rescue",
|
||||
"then": "<b>mountain_rescue</b> (builtin) - A building where first aid responders store material and might be on watch"
|
||||
|
@ -13777,6 +13781,10 @@
|
|||
"if": "value=memorial",
|
||||
"then": "memorial - Layer showing memorial plaques, based upon a unofficial theme. Can be expanded to have multiple types of memorials later on"
|
||||
},
|
||||
{
|
||||
"if": "value=mobility_hub",
|
||||
"then": "mobility_hub - Mobility hubs are places where different kinds of transit meet, making it easy to switch between them. These places are usually part of a larger network or system."
|
||||
},
|
||||
{
|
||||
"if": "value=mountain_rescue",
|
||||
"then": "mountain_rescue - A building where first aid responders store material and might be on watch"
|
||||
|
@ -35578,6 +35586,10 @@
|
|||
"if": "value=memorial",
|
||||
"then": "memorial - Layer showing memorial plaques, based upon a unofficial theme. Can be expanded to have multiple types of memorials later on"
|
||||
},
|
||||
{
|
||||
"if": "value=mobility_hub",
|
||||
"then": "mobility_hub - Mobility hubs are places where different kinds of transit meet, making it easy to switch between them. These places are usually part of a larger network or system."
|
||||
},
|
||||
{
|
||||
"if": "value=mountain_rescue",
|
||||
"then": "mountain_rescue - A building where first aid responders store material and might be on watch"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue