0

I have recently created polygons in QGIS and now utilize the GeoJSON files in a Leaflet application. However, it seems whenever the borders of polygons align, it appears as if their shared border is double (or even triple) the thickness.

See the image below for an example:

Leaflet image Is there any way to circumvent this, either during the polygon creation in QGIS, or any fixes to be made in Leaflet?

I am still learning GIS & Leaflet.

4
  • 3
    It's not about thickness, but about transparency. Your borders color has transparency, and when borders overlap, border is darker. Solution is either to make border color without transparency, or convert GeoJSON to TopoJSON, see for example github.com/topojson/topojson
    – TomazicM
    Aug 15 at 13:04
  • Does Leaflet not only display GeoJSON? In the example provided, it seems you have to convert the TopoJSON back to GeoJSON to get it to display and in that case does it not destroy the purpose of conversion in the first place if you end up with the same GeoJSON? Aug 30 at 17:51
  • topojson library has a whole range of methods for various conversions, you just take the right one for your use. For example topojson.feature converts TopoJSON to regular GeoJSON features, but topojson.mesh converts TopoJSON to collection of GeoJSON lines which do not overlap.
    – TomazicM
    Aug 30 at 18:07
  • So it is not possible to convert to GeoJSON features with lines that do not overlap? Thank you for your comment Aug 30 at 23:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.