The GeoJson structure breaks if the ring start label occurs several times

Comparing With Matplotlib

In [1]:
import numpy as np
import geopandas as gp
from lets_plot import *
from lets_plot.geo_data import *
The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).
In [2]:
def dump_plot(plot, display=None):
    import json

    try:
        import clipboard
    except:
        clipboard = None
        
    from lets_plot._type_utils import standardize_dict
    
    plot_dict = standardize_dict(plot.as_dict())
    plot_json = json.dumps(plot_dict, indent=2)
    
    if clipboard:
        clipboard.copy('')
        clipboard.copy(str(plot_json))
    else:
        if display is None:
            display = True
    
    if display:
        print(plot_json)

    return plot

LetsPlot.setup_html()
In [3]:
d = gp.read_file("""
{"type":"MultiPolygon","coordinates":
    [
      [
        [
          [0,0], [0, 20], [5, 5], [0, 0], [5, 5], [20, 0], [0, 0]
        ]
      ],
      [
        [
          [10, 10],[10, 20],[20, 20], [20, 10]
        ]
      ]
    ]
}""")

dump_plot(ggplot() + geom_polygon(map=d, color='black', size=1) + coord_fixed())
Out[3]:
In [4]:
d.plot(edgecolor="black")
Out[4]:
<Axes: >
In [5]:
d = gp.read_file("""
{"type":"MultiLineString","coordinates":
    [      
        [
          [0,0], [0,0], [0, 5], [5, 5], [5, 0], [0, 0]
        ]
      ,      
        [
          [10, 10],[10, 20],[20, 20],[20, 10], [10,10]
        ]      
    ]
}""")

d.plot()
Out[5]:
<Axes: >
In [6]:
d = gp.read_file("""
{"type":"MultiPolygon","coordinates":
    [
      [
        [
          [10,5], [0, 10], [5, 5], [5, 0], [0, 5], [0, 5], [0, 0]
        ]
      ],
      [
        [
          [10, 10],[10, 20],[20, 20], [20, 10]
        ]
      ]
    ]
}""")

dump_plot(ggplot() + geom_polygon(map=d, color='black', size=1) + coord_fixed())
Out[6]:
In [7]:
d.plot(edgecolor="black")
Out[7]:
<Axes: >
In [8]:
d = gp.read_file("""
{"type":"MultiPolygon","coordinates":
    [
      [
        [
          [0, 0], [0, 20], [0, 20], [5, 5], [20, 0], [0, 0],  [5, 5], [0, 3], [0, 0]
        ]
      ],
      [
        [
          [10, 10],[10, 20],[20, 20],[20, 10], [10, 10]
        ]
      ]
    ]
}""")

dump_plot(ggplot() + geom_polygon(map=d, color='black', size=1) + coord_fixed())
Out[8]:
In [9]:
d.plot(edgecolor="black")
Out[9]:
<Axes: >
In [10]:
d = gp.read_file("""
{"type":"MultiPolygon","coordinates":
    [
      [
        [
          [0, 0], [0, 0], [0, 0], [0, 20], [0, 20], [5, 5], [20, 0], [0, 0], [0, 0], [0, 0], [5, 5], [0, 3], [0, 0]
        ]
      ],
      [
        [
          [10, 10],[10, 20],[20, 20],[20, 20],[20, 20],[20, 20],[20, 10], [10, 10], [10, 10], [10, 10], [10, 10]
        ]
      ]
    ]
}""")

dump_plot(ggplot() + geom_polygon(map=d, color='black', size=1) + coord_fixed())
Out[10]:
In [11]:
d.plot(edgecolor="black")
Out[11]:
<Axes: >
In [12]:
d = gp.read_file("""
{"type":"MultiPolygon","coordinates":
    [
      [
        [
          [0,0], [0, 20], [5, 5], [5, 5], [20, 0], [0, 0]
        ]
      ],
      [
        [
          [10, 10],[10, 20],[20, 20],[20, 10], [10,15]
        ]
      ]
    ]
}""")

dump_plot(ggplot() + geom_polygon(map=d, color='black', size=1) + coord_fixed())
Out[12]:
In [13]:
d.plot(edgecolor="black")
Out[13]:
<Axes: >
In [14]:
d = gp.read_file("""
{"type":"MultiPolygon","coordinates":
    [
      [
        [
          [0,0], [0, 20], [5, 5], [20, 0], [0, 20], [0, 0], [5, 5]
        ]
      ],
      [
        [
          [10, 10],[10, 20],[20, 20],[20, 10]
        ]
      ]
    ]
}""")

dump_plot(ggplot() + geom_polygon(map=d, color='black', size=1) + coord_fixed())
Out[14]:
In [15]:
d.plot(edgecolor="black")
Out[15]:
<Axes: >