Skip to content

Commit

Permalink
Remove the duplicated feature updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentao-Kuang committed Apr 25, 2024
1 parent 766f92b commit f2757bd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/cli/src/cli/config/config.diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,16 @@ export async function diffVectorUpdate(
const newCollectionPath = new URL('collection.json', layer[Epsg.Google.code]);
const newCollection = await fsa.readJson<StacCollection>(newCollectionPath);
if (newCollection == null) throw new Error(`Failed to get target collection json from ${newCollectionPath}.`);
const ldsLayers = newCollection.links.filter((f) => f.rel === 'lds:layer') as StacLinkLds[];

// Prepare new lds layers as map
const ldsLayers = new Map<string, StacLinkLds>();
for (const item of newCollection.links) {
if (item.rel === 'lds:layer') ldsLayers.set((item as StacLinkLds)['lds:id'], item as StacLinkLds);
}

Check failure on line 122 in packages/cli/src/cli/config/config.diff.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Delete `·`

Check failure on line 122 in packages/cli/src/cli/config/config.diff.ts

View workflow job for this annotation

GitHub Actions / build-containers

Delete `·`

Check failure on line 122 in packages/cli/src/cli/config/config.diff.ts

View workflow job for this annotation

GitHub Actions / build-deploy

Delete `·`

// Log all the new inserts for new tileset
if (existingTileSet == null) {
for (const l of ldsLayers) {
for (const l of ldsLayers.values()) {
const change = getVectorChanges(l, undefined);
if (change != null) changes.push(change);
}
Expand All @@ -142,7 +147,7 @@ export async function diffVectorUpdate(
}

// Find layer updates
for (const l of ldsLayers) {
for (const l of ldsLayers.values()) {
const existingLayer = existingLdsLayers.get(l['lds:id']);
const change = getVectorChanges(l, existingLayer);
if (change != null) changes.push(change);
Expand Down

0 comments on commit f2757bd

Please sign in to comment.