mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 22:48:10 +02:00
Update to osm-community-index v2.0.0
This commit is contained in:
+19
-28
@@ -12,8 +12,8 @@ export { dataTerritoryLanguages } from './territory-languages.json';
|
||||
export { en as dataEn } from '../dist/locales/en.json';
|
||||
|
||||
import {
|
||||
features as ociFeatures,
|
||||
resources as ociResources
|
||||
features as ociCustomFeatures,
|
||||
resources as ociResources
|
||||
} from 'osm-community-index';
|
||||
|
||||
import { dataImagery } from './imagery.json';
|
||||
@@ -22,36 +22,27 @@ import { defaults } from './presets/defaults.json';
|
||||
import { categories } from './presets/categories.json';
|
||||
import { fields } from './presets/fields.json';
|
||||
|
||||
import { geoArea as d3_geoArea } from 'd3-geo';
|
||||
import LocationConflation from '@ideditor/location-conflation';
|
||||
import whichPolygon from 'which-polygon';
|
||||
|
||||
|
||||
// index the osm-community-index
|
||||
var ociFeatureCollection = Object.values(ociFeatures).map(function(feature) {
|
||||
// workaround for which-polygon: only supports `properties`, not `id`
|
||||
// https://github.com/mapbox/which-polygon/pull/6
|
||||
feature.properties = {
|
||||
id: feature.id,
|
||||
area: d3_geoArea(feature) // also precompute areas
|
||||
};
|
||||
return feature;
|
||||
});
|
||||
const loco = new LocationConflation({ type: 'FeatureCollection', features: ociCustomFeatures });
|
||||
const ociFeatures = Object.values(ociResources)
|
||||
.map(resource => loco.resolveLocationSet(resource.locationSet));
|
||||
|
||||
|
||||
export var data = {
|
||||
community: {
|
||||
features: ociFeatures,
|
||||
resources: ociResources,
|
||||
query: whichPolygon({
|
||||
type: 'FeatureCollection',
|
||||
features: ociFeatureCollection
|
||||
})
|
||||
},
|
||||
imagery: dataImagery, //legacy
|
||||
presets: {
|
||||
presets: presets,
|
||||
defaults: defaults,
|
||||
categories: categories,
|
||||
fields: fields
|
||||
}
|
||||
export let data = {
|
||||
community: {
|
||||
features: ociFeatures,
|
||||
resources: ociResources,
|
||||
query: whichPolygon({ type: 'FeatureCollection', features: ociFeatures })
|
||||
},
|
||||
imagery: dataImagery, //legacy
|
||||
presets: {
|
||||
presets: presets,
|
||||
defaults: defaults,
|
||||
categories: categories,
|
||||
fields: fields
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
+1382
-1194
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -35,6 +35,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ideditor/country-coder": "^3.0.1",
|
||||
"@ideditor/location-conflation": "~0.2.0",
|
||||
"@mapbox/sexagesimal": "1.2.0",
|
||||
"@mapbox/togeojson": "0.16.0",
|
||||
"@mapbox/vector-tile": "^1.3.1",
|
||||
@@ -86,7 +87,7 @@
|
||||
"name-suggestion-index": "3.6.0",
|
||||
"npm-run-all": "^4.0.0",
|
||||
"object-inspect": "0.4.0",
|
||||
"osm-community-index": "1.0.0",
|
||||
"osm-community-index": "2.0.0",
|
||||
"phantomjs-prebuilt": "~2.1.11",
|
||||
"request": "^2.88.0",
|
||||
"rollup": "~1.27.2",
|
||||
|
||||
Reference in New Issue
Block a user