mapbox / geojson-vt

Slice GeoJSON into vector tiles on the fly in the browser
ISC License
1.89k stars 270 forks source link

How to remove redundant vertical and horizontal lines #158

Closed nhtlquan closed 2 years ago

nhtlquan commented 2 years ago

I using this lib for my project. Draw geoJson to map. Type of geoJson: MultiPolygon, file: https://drive.google.com/file/d/1SnhqjMAbmWozhuhfVM0GjQHPNwq2ziWn/view?usp=sharing But has redundant vertical and horizontal lines. How to remove it! Thank

image

mourner commented 2 years ago

There's no way to remove those. They are artifacts of the polygon clipping algorithm. Basically you're supposed to use a certain buffer around a tile, and then clip each tile to its extent (we do that with WebGL stencil buffer in GL JS, but if you're drawing with something else like SVG, it also supports clipping masks).