MCPcopy Create free account
hub / github.com/plotly/plotly.js / createCoastlinesLayer

Function createCoastlinesLayer

topojson/bin/process_geodata.mjs:166–180  ·  view source on GitHub ↗
({ bounds, name, resolution, source })

Source from the content-addressed store, hash-verified

164}
165
166async function createCoastlinesLayer({ bounds, name, resolution, source }) {
167 const inputFilePath = `${outputDirGeojson}/${unFilename}_${resolution}m/${source}.geojson`;
168 const outputFilePath = `${outputDirGeojson}/${name}_${resolution}m/coastlines.geojson`;
169 const commands = [
170 inputFilePath,
171 '-dissolve2',
172 '-lines',
173 bounds.length ? `-clip bbox=${bounds.join(',')}` : '',
174 // Erase world border to avoid unpleasant lines through polygons crossing the border.
175 '-clip bbox=-179.99999,-89.99999,179.99999,89.99999',
176 `-o ${outputFilePath}`
177 ].join(' ');
178 await mapshaper.runCommands(commands);
179 clampToAntimeridian(outputFilePath);
180}
181
182async function createOceanLayer({ bounds, name, resolution, source }) {
183 const outputFilePath = `${outputDirGeojson}/${name}_${resolution}m/ocean.geojson`;

Callers 1

Calls 1

clampToAntimeridianFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…