({ bounds, name, resolution, source })
| 164 | } |
| 165 | |
| 166 | async 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 | |
| 182 | async function createOceanLayer({ bounds, name, resolution, source }) { |
| 183 | const outputFilePath = `${outputDirGeojson}/${name}_${resolution}m/ocean.geojson`; |
no test coverage detected
searching dependent graphs…