matkoniecz / lunar_assembler

SVG maps from OpenStreetMap data. Available at https://mapsaregreat.com/osm_to_svg_in_browser/
GNU Affero General Public License v3.0
41 stars 5 forks source link

Support merging areas in map style #29

Closed matkoniecz closed 3 years ago

matkoniecz commented 3 years ago

For example, allow buildings to be merged into one object what will hide lines between touching buildings (or area:highway areas)

screen13

matkoniecz commented 3 years ago

http://turfjs.org/docs/#dissolve (fails for multipolygons)

matkoniecz commented 3 years ago

https://github.com/mfogel/polygon-clipping is the recommnded for areas

    <script src="polygon-clipping.umd.js"></script>

    <script>
      const poly1 = [[[10,0],[12,0],[10,2],[10,0]]]
      const poly2 = [[[-1,0],[1,0],[0,1],[-1,0]]]

      //alert(polygonClipping.union       (poly1, poly2 /* , poly3, ... */))
      //alert(polygonClipping.intersection(poly1, poly2 /* , poly3, ... */))
      //alert(polygonClipping.xor         (poly1, poly2 /* , poly3, ... */))
      //alert(polygonClipping.difference  (poly1, poly2 /* , poly3, ... */))
    </script>

from #22