如何使用 matplotlib/python 绘制地理数据

2024-04-02

我正在尝试使用不同的库在 python 上绘制多边形,但这些库都不适合我。 我试过vincent https://github.com/wrobstory/vincent ,Shapely https://pypi.python.org/pypi/Shapely,..现在是 matplotlib。 我不想使用类似的软件qgis http://www.qgis.org/en/site/

我用了这个例子:http://geographika.co.uk/visualising-geojson-in-15-分钟 http://geographika.co.uk/visualising-geojson-in-15-minutes

EDIT:原始博客文章存档:https://web.archive.org/web/20160310165846/http://geographika.co.uk/visualising-geojson-in-15-minutes https://web.archive.org/web/20160310165846/http://geographika.co.uk/visualising-geojson-in-15-minutes

from matplotlib import pyplot
from descartes import PolygonPatch
import math
import urllib2
import simplejson

data = []
with open('file.json') as f:
    for line in f:
        data.append(json.loads(line))


def plotFeature(coordlist, myplot):
    #create a polygon geojson-like feature
    poly = {"type": "Polygon", "coordinates": coordlist}
    patch = PolygonPatch(poly, fc='#6699cc', ec='#6699cc', alpha=0.5, zorder=2)
    #plot it on the graph
    myplot.add_patch(patch)


for coordlist in data['features'][0]['geometry']['coordinates']:
    plotFeature(coordlist, myplot)

fig = pyplot.figure(1, figsize=(10, 4), dpi=180)
ax = fig.add_subplot(121)
ax.savefig('myplot.png')

外部文件“file.json”

var states = [{
    "type": "Feature",
    "properties": {"party": "Republican"},
    "geometry":

{
    "type": "Polygon",
    "coordinates": [
        [
            [
                -84.32281494140625,
                34.9895035675793
            ],
            [
                -84.29122924804688,
                35.21981940793435
            ],
            [
                -84.24041748046875,
                35.25459097465022
            ],
            [
                -84.22531127929688,
                35.266925688950074
            ],
            [
                -84.20745849609375,
                35.26580442886754
            ],
            [
                -84.19921875,
                35.24674063355999
            ],
            [
                -84.16213989257812,
                35.24113278166642
            ],
            [
                -84.12368774414062,
                35.24898366572645
            ],
            [
                -84.09072875976562,
                35.24898366572645
            ],
            [
                -84.08798217773438,
                35.264683153268116
            ],
            [
                -84.04266357421875,
                35.27701633139884
            ],
            [
                -84.03030395507812,
                35.291589484566124
            ],
            [
                -84.0234375,
                35.306160014550784
            ],
            [
                -84.03305053710936,
                35.32745068492882
            ],
            [
                -84.03579711914062,
                35.34313496028189
            ],
            [
                -84.03579711914062,
                35.348735749472546
            ],
            [
                -84.01657104492188,
                35.35545618392078
            ],
            [
                -84.01107788085938,
                35.37337460834958
            ],
            [
                -84.00970458984374,
                35.39128905521763
            ],
            [
                -84.01931762695312,
                35.41479572901859
            ],
            [
                -84.00283813476562,
                35.429344044107154
            ],
            [
                -83.93692016601562,
                35.47409160773029
            ],
            [
                -83.91220092773438,
                35.47632833265728
            ],
            [
                -83.88885498046875,
                35.504282143299655
            ],
            [
                -83.88473510742186,
                35.516578738902936
            ],
            [
                -83.8751220703125,
                35.52104976129943
            ],
            [
                -83.85314941406249,
                35.52104976129943
            ],
            [
                -83.82843017578125,
                35.52104976129943
            ],
            [
                -83.8092041015625,
                35.53446133418443
            ],
            [
                -83.80233764648438,
                35.54116627999813
            ],
            [
                -83.76800537109374,
                35.56239491058853
            ],
            [
                -83.7432861328125,
                35.56239491058853
            ],
            [
                -83.71994018554688,
                35.56239491058853
            ],
            [
                -83.67050170898438,
                35.569097520776054
            ],
            [
                -83.6334228515625,
                35.570214567965984
            ],
            [
                -83.61007690429688,
                35.576916524038616
            ],
            [
                -83.59634399414061,
                35.574682600980914
            ],
            [
                -83.5894775390625,
                35.55904339525896
            ],
            [
                -83.55239868164062,
                35.56574628576276
            ],
            [
                -83.49746704101562,
                35.563512051219696
            ],
            [
                -83.47000122070312,
                35.586968406786475
            ],
            [
                -83.4466552734375,
                35.60818490437746
            ],
            [
                -83.37936401367188,
                35.63609277863135
            ],
            [
                -83.35739135742188,
                35.65618041632016
            ],
            [
                -83.32305908203124,
                35.66622234103479
            ],
            [
                -83.3148193359375,
                35.65394870599763
            ],
            [
                -83.29971313476561,
                35.660643649881614
            ],
            [
                -83.28598022460938,
                35.67180064238771
            ],
            [
                -83.26126098632811,
                35.6907639509368
            ],
            [
                -83.25714111328125,
                35.69968630125201
            ],
            [
                -83.25576782226562,
                35.715298012125295
            ],
            [
                -83.23516845703125,
                35.72310272092263
            ],
            [
                -83.19808959960936,
                35.72756221127198
            ],
            [
                -83.16238403320312,
                35.753199435570316
            ],
            [
                -83.15826416015625,
                35.76322914549896
            ],
            [
                -83.10333251953125,
                35.76991491635478
            ],
            [
                -83.08685302734375,
                35.7843988251953
            ],
            [
                -83.0511474609375,
                35.787740890986576
            ],
            [
                -83.01681518554688,
                35.78328477203738
            ],
            [
                -83.001708984375,
                35.77882840327371
            ],
            [
                -82.96737670898438,
                35.793310688351724
            ],
            [
                -82.94540405273438,
                35.820040281161
            ],
            [
                -82.9193115234375,
                35.85121343450061
            ],
            [
                -82.9083251953125,
                35.86902116501695
            ],
            [
                -82.90557861328125,
                35.87792352995116
            ],
            [
                -82.91244506835938,
                35.92353244718235
            ],
            [
                -82.88360595703125,
                35.94688293218141
            ],
            [
                -82.85614013671875,
                35.951329861522666
            ],
            [
                -82.8424072265625,
                35.94243575255426
            ],
            [
                -82.825927734375,
                35.92464453144099
            ],
            [
                -82.80670166015625,
                35.927980690382704
            ],
            [
                -82.80532836914062,
                35.94243575255426
            ],
            [
                -82.77923583984375,
                35.97356075349624
            ],
            [
                -82.78060913085938,
                35.99245209055831
            ],
            [
                -82.76138305664062,
                36.00356252895066
            ],
            [
                -82.69546508789062,
                36.04465753921525
            ],
            [
                -82.64465332031249,
                36.060201412392914
            ],
            [
                -82.61306762695312,
                36.060201412392914
            ],
            [
                -82.60620117187499,
                36.033552893400376
            ],
            [
                -82.60620117187499,
                35.991340960635405
            ],
            [
                -82.60620117187499,
                35.97911749857497
            ],
            [
                -82.5787353515625,
                35.96133453736691
            ],
            [
                -82.5677490234375,
                35.951329861522666
            ],
            [
                -82.53067016601562,
                35.97244935753683
            ],
            [
                -82.46475219726562,
                36.006895355244666
            ],
            [
                -82.41668701171875,
                36.070192281208456
            ],
            [
                -82.37960815429686,
                36.10126686921446
            ],
            [
                -82.35488891601562,
                36.117908916563685
            ],
            [
                -82.34115600585936,
                36.113471382052175
            ],
            [
                -82.29583740234375,
                36.13343831245866
            ],
            [
                -82.26287841796874,
                36.13565654678543
            ],
            [
                -82.23403930664062,
                36.13565654678543
            ],
            [
                -82.2216796875,
                36.154509006695
            ],
            [
                -82.20382690429688,
                36.15561783381855
            ],
            [
                -82.19009399414062,
                36.144528857027744
            ],
            [
                -82.15438842773438,
                36.15007354140755
            ],
            [
                -82.14065551757812,
                36.134547437460064
            ],
            [
                -82.1337890625,
                36.116799556445024
            ],
            [
                -82.12142944335938,
                36.10570509327921
            ],
            [
                -82.08984375,
                36.10792411128649
            ],
            [
                -82.05276489257811,
                36.12678323326429
            ],
            [
                -82.03628540039062,
                36.12900165569652
            ],
            [
                -81.91268920898438,
                36.29409768373033
            ],
            [
                -81.89071655273438,
                36.30959215409138
            ],
            [
                -81.86325073242188,
                36.33504067209607
            ],
            [
                -81.83029174804688,
                36.34499652561904
            ],
            [
                -81.80145263671875,
                36.35605709240176
            ],
            [
                -81.77947998046874,
                36.34610265300638
            ],
            [
                -81.76162719726562,
                36.33835943134047
            ],
            [
                -81.73690795898438,
                36.33835943134047
            ],
            [
                -81.71905517578125,
                36.33835943134047
            ],
            [
                -81.70669555664062,
                36.33504067209607
            ],
            [
                -81.70669555664062,
                36.342784223707234
            ],
            [
                -81.72317504882812,
                36.357163062654365
            ],
            [
                -81.73278808593749,
                36.379279167407965
            ],
            [
                -81.73690795898438,
                36.40028364332352
            ],
            [
                -81.73690795898438,
                36.41354670392876
            ],
            [
                -81.72454833984374,
                36.423492513472326
            ],
            [
                -81.71768188476562,
                36.445589751779174
            ],
            [
                -81.69845581054688,
                36.47541104282962
            ],
            [
                -81.69845581054688,
                36.51073994146672
            ],
            [
                -81.705322265625,
                36.53060536411363
            ],
            [
                -81.69158935546875,
                36.55929085774001
            ],
            [
                -81.68060302734375,
                36.56480607840351
            ],
            [
                -81.68197631835938,
                36.58686302344181
            ],
            [
                -81.04202270507812,
                36.56370306576917
            ],
            [
                -80.74264526367186,
                36.561496993252575
            ],
            [
                -79.89120483398438,
                36.54053616262899
            ],
            [
                -78.68408203124999,
                36.53943280355122
            ],
            [
                -77.88345336914062,
                36.54053616262899
            ],
            [
                -76.91665649414062,
                36.54163950596125
            ],
            [
                -76.91665649414062,
                36.55046568575947
            ],
            [
                -76.31103515625,
                36.551568887374
            ],
            [
                -75.79605102539062,
                36.54936246839778
            ],
            [
                -75.6298828125,
                36.07574221562703
            ],
            [
                -75.4925537109375,
                35.82226734114509
            ],
            [
                -75.3936767578125,
                35.639441068973916
            ],
            [
                -75.41015624999999,
                35.43829554739668
            ],
            [
                -75.43212890625,
                35.263561862152095
            ],
            [
                -75.487060546875,
                35.18727767598896
            ],
            [
                -75.5914306640625,
                35.17380831799959
            ],
            [
                -75.9210205078125,
                35.04798673426734
            ],
            [
                -76.17919921875,
                34.867904962568744
            ],
            [
                -76.41540527343749,
                34.62868797377061
            ],
            [
                -76.4593505859375,
                34.57442951865274
            ],
            [
                -76.53076171875,
                34.53371242139567
            ],
            [
                -76.5911865234375,
                34.551811369170494
            ],
            [
                -76.651611328125,
                34.615126683462194
            ],
            [
                -76.761474609375,
                34.63320791137959
            ],
            [
                -77.069091796875,
                34.59704151614417
            ],
            [
                -77.376708984375,
                34.45674800347809
            ],
            [
                -77.5909423828125,
                34.3207552752374
            ],
            [
                -77.8326416015625,
                33.97980872872457
            ],
            [
                -77.9150390625,
                33.80197351806589
            ],
            [
                -77.9754638671875,
                33.73804486328907
            ],
            [
                -78.11279296875,
                33.8521697014074
            ],
            [
                -78.2830810546875,
                33.8521697014074
            ],
            [
                -78.4808349609375,
                33.815666308702774
            ],
            [
                -79.6728515625,
                34.8047829195724
            ],
            [
                -80.782470703125,
                34.836349990763864
            ],
            [
                -80.782470703125,
                34.91746688928252
            ],
            [
                -80.9307861328125,
                35.092945313732635
            ],
            [
                -81.0516357421875,
                35.02999636902566
            ],
            [
                -81.0516357421875,
                35.05248370662468
            ],
            [
                -81.0516357421875,
                35.137879119634185
            ],
            [
                -82.3150634765625,
                35.19625600786368
            ],
            [
                -82.3590087890625,
                35.19625600786368
            ],
            [
                -82.40295410156249,
                35.22318504970181
            ],
            [
                -82.4688720703125,
                35.16931803601131
            ],
            [
                -82.6885986328125,
                35.1154153142536
            ],
            [
                -82.781982421875,
                35.06147690849717
            ],
            [
                -83.1060791015625,
                35.003003395276714
            ],
            [
                -83.616943359375,
                34.99850370014629
            ],
            [
                -84.05639648437499,
                34.985003130171066
            ],
            [
                -84.22119140625,
                34.985003130171066
            ],
            [
                -84.32281494140625,
                34.9895035675793
            ]
        ],
        [
            [
                -75.69030761718749,
                35.74205383068037
            ],
            [
                -75.5914306640625,
                35.74205383068037
            ],
            [
                -75.5419921875,
                35.585851593232356
            ],
            [
                -75.56396484375,
                35.32633026307483
            ],
            [
                -75.69030761718749,
                35.285984736065735
            ],
            [
                -75.970458984375,
                35.16482750605027
            ],
            [
                -76.2066650390625,
                34.994003757575776
            ],
            [
                -76.300048828125,
                35.02999636902566
            ],
            [
                -76.409912109375,
                35.07946034047981
            ],
            [
                -76.5252685546875,
                35.10642805736423
            ],
            [
                -76.4208984375,
                35.25907654252574
            ],
            [
                -76.3385009765625,
                35.294952147406576
            ],
            [
                -76.0858154296875,
                35.29943548054543
            ],
            [
                -75.948486328125,
                35.44277092585766
            ],
            [
                -75.8660888671875,
                35.53669637839501
            ],
            [
                -75.772705078125,
                35.567980458012094
            ],
            [
                -75.706787109375,
                35.634976650677295
            ],
            [
                -75.706787109375,
                35.74205383068037
            ],
            [
                -75.69030761718749,
                35.74205383068037
            ]
        ]
    ]
} } ] 

但似乎并没有成功。我需要在背景上绘制这些坐标和地图。有什么例子、推荐教程、解决这个问题的建议吗?


我试图尽可能地坚持你的代码。这是解决方案:

from matplotlib import pyplot
from descartes import PolygonPatch
import simplejson

def configurePlot():
    # set up the mapplotlib
    fig = pyplot.figure(1, figsize=(10, 4), dpi=180)
    ax = fig.add_subplot(121)
    return fig, ax


def setPlotExtent(ax, data):
    # get feature extents (a property of the cloudmade geojson)
    # note this was previously bbox
    minx = data['bounds'][0][0]
    maxx = data['bounds'][1][0]
    miny = data['bounds'][0][1]
    maxy = data['bounds'][1][1]

    # set the graph axes to the feature extents
    ax.set_xlim(minx, maxx)
    ax.set_ylim(miny, maxy)


def plotFeature(coordinates, myplot):
    poly = {"type": "Polygon", "coordinates": coordinates}
    patch = PolygonPatch(poly, fc='#6699cc', ec='#6699cc', alpha=0.5, zorder=2)
    # plot it on the graph
    myplot.add_patch(patch)


# turn the geojson into a python object
with open(r"file2.json") as f:
    pydata = simplejson.load(f)
print(pydata)

fig, myplot = configurePlot()
setPlotExtent(myplot, pydata)

plotFeature(pydata['coordinates'], myplot)

# save the plot as an image
pyplot.show()
fig.savefig('myplot.png')

和更正后的 json:

{
    "bounds": [[-85, 33], [-75, 37]],
    "type": "Polygon",
    "coordinates": [
        [
            [
                -84.32281494140625,
                34.9895035675793
            ],
            [
                -84.29122924804688,
                35.21981940793435
            ],
            [
                -84.24041748046875,
                35.25459097465022
            ],
            [
                -84.22531127929688,
                35.266925688950074
            ],
            [
                -84.20745849609375,
                35.26580442886754
            ],
            [
                -84.19921875,
                35.24674063355999
            ],
            [
                -84.16213989257812,
                35.24113278166642
            ],
            [
                -84.12368774414062,
                35.24898366572645
            ],
            [
                -84.09072875976562,
                35.24898366572645
            ],
            [
                -84.08798217773438,
                35.264683153268116
            ],
            [
                -84.04266357421875,
                35.27701633139884
            ],
            [
                -84.03030395507812,
                35.291589484566124
            ],
            [
                -84.0234375,
                35.306160014550784
            ],
            [
                -84.03305053710936,
                35.32745068492882
            ],
            [
                -84.03579711914062,
                35.34313496028189
            ],
            [
                -84.03579711914062,
                35.348735749472546
            ],
            [
                -84.01657104492188,
                35.35545618392078
            ],
            [
                -84.01107788085938,
                35.37337460834958
            ],
            [
                -84.00970458984374,
                35.39128905521763
            ],
            [
                -84.01931762695312,
                35.41479572901859
            ],
            [
                -84.00283813476562,
                35.429344044107154
            ],
            [
                -83.93692016601562,
                35.47409160773029
            ],
            [
                -83.91220092773438,
                35.47632833265728
            ],
            [
                -83.88885498046875,
                35.504282143299655
            ],
            [
                -83.88473510742186,
                35.516578738902936
            ],
            [
                -83.8751220703125,
                35.52104976129943
            ],
            [
                -83.85314941406249,
                35.52104976129943
            ],
            [
                -83.82843017578125,
                35.52104976129943
            ],
            [
                -83.8092041015625,
                35.53446133418443
            ],
            [
                -83.80233764648438,
                35.54116627999813
            ],
            [
                -83.76800537109374,
                35.56239491058853
            ],
            [
                -83.7432861328125,
                35.56239491058853
            ],
            [
                -83.71994018554688,
                35.56239491058853
            ],
            [
                -83.67050170898438,
                35.569097520776054
            ],
            [
                -83.6334228515625,
                35.570214567965984
            ],
            [
                -83.61007690429688,
                35.576916524038616
            ],
            [
                -83.59634399414061,
                35.574682600980914
            ],
            [
                -83.5894775390625,
                35.55904339525896
            ],
            [
                -83.55239868164062,
                35.56574628576276
            ],
            [
                -83.49746704101562,
                35.563512051219696
            ],
            [
                -83.47000122070312,
                35.586968406786475
            ],
            [
                -83.4466552734375,
                35.60818490437746
            ],
            [
                -83.37936401367188,
                35.63609277863135
            ],
            [
                -83.35739135742188,
                35.65618041632016
            ],
            [
                -83.32305908203124,
                35.66622234103479
            ],
            [
                -83.3148193359375,
                35.65394870599763
            ],
            [
                -83.29971313476561,
                35.660643649881614
            ],
            [
                -83.28598022460938,
                35.67180064238771
            ],
            [
                -83.26126098632811,
                35.6907639509368
            ],
            [
                -83.25714111328125,
                35.69968630125201
            ],
            [
                -83.25576782226562,
                35.715298012125295
            ],
            [
                -83.23516845703125,
                35.72310272092263
            ],
            [
                -83.19808959960936,
                35.72756221127198
            ],
            [
                -83.16238403320312,
                35.753199435570316
            ],
            [
                -83.15826416015625,
                35.76322914549896
            ],
            [
                -83.10333251953125,
                35.76991491635478
            ],
            [
                -83.08685302734375,
                35.7843988251953
            ],
            [
                -83.0511474609375,
                35.787740890986576
            ],
            [
                -83.01681518554688,
                35.78328477203738
            ],
            [
                -83.001708984375,
                35.77882840327371
            ],
            [
                -82.96737670898438,
                35.793310688351724
            ],
            [
                -82.94540405273438,
                35.820040281161
            ],
            [
                -82.9193115234375,
                35.85121343450061
            ],
            [
                -82.9083251953125,
                35.86902116501695
            ],
            [
                -82.90557861328125,
                35.87792352995116
            ],
            [
                -82.91244506835938,
                35.92353244718235
            ],
            [
                -82.88360595703125,
                35.94688293218141
            ],
            [
                -82.85614013671875,
                35.951329861522666
            ],
            [
                -82.8424072265625,
                35.94243575255426
            ],
            [
                -82.825927734375,
                35.92464453144099
            ],
            [
                -82.80670166015625,
                35.927980690382704
            ],
            [
                -82.80532836914062,
                35.94243575255426
            ],
            [
                -82.77923583984375,
                35.97356075349624
            ],
            [
                -82.78060913085938,
                35.99245209055831
            ],
            [
                -82.76138305664062,
                36.00356252895066
            ],
            [
                -82.69546508789062,
                36.04465753921525
            ],
            [
                -82.64465332031249,
                36.060201412392914
            ],
            [
                -82.61306762695312,
                36.060201412392914
            ],
            [
                -82.60620117187499,
                36.033552893400376
            ],
            [
                -82.60620117187499,
                35.991340960635405
            ],
            [
                -82.60620117187499,
                35.97911749857497
            ],
            [
                -82.5787353515625,
                35.96133453736691
            ],
            [
                -82.5677490234375,
                35.951329861522666
            ],
            [
                -82.53067016601562,
                35.97244935753683
            ],
            [
                -82.46475219726562,
                36.006895355244666
            ],
            [
                -82.41668701171875,
                36.070192281208456
            ],
            [
                -82.37960815429686,
                36.10126686921446
            ],
            [
                -82.35488891601562,
                36.117908916563685
            ],
            [
                -82.34115600585936,
                36.113471382052175
            ],
            [
                -82.29583740234375,
                36.13343831245866
            ],
            [
                -82.26287841796874,
                36.13565654678543
            ],
            [
                -82.23403930664062,
                36.13565654678543
            ],
            [
                -82.2216796875,
                36.154509006695
            ],
            [
                -82.20382690429688,
                36.15561783381855
            ],
            [
                -82.19009399414062,
                36.144528857027744
            ],
            [
                -82.15438842773438,
                36.15007354140755
            ],
            [
                -82.14065551757812,
                36.134547437460064
            ],
            [
                -82.1337890625,
                36.116799556445024
            ],
            [
                -82.12142944335938,
                36.10570509327921
            ],
            [
                -82.08984375,
                36.10792411128649
            ],
            [
                -82.05276489257811,
                36.12678323326429
            ],
            [
                -82.03628540039062,
                36.12900165569652
            ],
            [
                -81.91268920898438,
                36.29409768373033
            ],
            [
                -81.89071655273438,
                36.30959215409138
            ],
            [
                -81.86325073242188,
                36.33504067209607
            ],
            [
                -81.83029174804688,
                36.34499652561904
            ],
            [
                -81.80145263671875,
                36.35605709240176
            ],
            [
                -81.77947998046874,
                36.34610265300638
            ],
            [
                -81.76162719726562,
                36.33835943134047
            ],
            [
                -81.73690795898438,
                36.33835943134047
            ],
            [
                -81.71905517578125,
                36.33835943134047
            ],
            [
                -81.70669555664062,
                36.33504067209607
            ],
            [
                -81.70669555664062,
                36.342784223707234
            ],
            [
                -81.72317504882812,
                36.357163062654365
            ],
            [
                -81.73278808593749,
                36.379279167407965
            ],
            [
                -81.73690795898438,
                36.40028364332352
            ],
            [
                -81.73690795898438,
                36.41354670392876
            ],
            [
                -81.72454833984374,
                36.423492513472326
            ],
            [
                -81.71768188476562,
                36.445589751779174
            ],
            [
                -81.69845581054688,
                36.47541104282962
            ],
            [
                -81.69845581054688,
                36.51073994146672
            ],
            [
                -81.705322265625,
                36.53060536411363
            ],
            [
                -81.69158935546875,
                36.55929085774001
            ],
            [
                -81.68060302734375,
                36.56480607840351
            ],
            [
                -81.68197631835938,
                36.58686302344181
            ],
            [
                -81.04202270507812,
                36.56370306576917
            ],
            [
                -80.74264526367186,
                36.561496993252575
            ],
            [
                -79.89120483398438,
                36.54053616262899
            ],
            [
                -78.68408203124999,
                36.53943280355122
            ],
            [
                -77.88345336914062,
                36.54053616262899
            ],
            [
                -76.91665649414062,
                36.54163950596125
            ],
            [
                -76.91665649414062,
                36.55046568575947
            ],
            [
                -76.31103515625,
                36.551568887374
            ],
            [
                -75.79605102539062,
                36.54936246839778
            ],
            [
                -75.6298828125,
                36.07574221562703
            ],
            [
                -75.4925537109375,
                35.82226734114509
            ],
            [
                -75.3936767578125,
                35.639441068973916
            ],
            [
                -75.41015624999999,
                35.43829554739668
            ],
            [
                -75.43212890625,
                35.263561862152095
            ],
            [
                -75.487060546875,
                35.18727767598896
            ],
            [
                -75.5914306640625,
                35.17380831799959
            ],
            [
                -75.9210205078125,
                35.04798673426734
            ],
            [
                -76.17919921875,
                34.867904962568744
            ],
            [
                -76.41540527343749,
                34.62868797377061
            ],
            [
                -76.4593505859375,
                34.57442951865274
            ],
            [
                -76.53076171875,
                34.53371242139567
            ],
            [
                -76.5911865234375,
                34.551811369170494
            ],
            [
                -76.651611328125,
                34.615126683462194
            ],
            [
                -76.761474609375,
                34.63320791137959
            ],
            [
                -77.069091796875,
                34.59704151614417
            ],
            [
                -77.376708984375,
                34.45674800347809
            ],
            [
                -77.5909423828125,
                34.3207552752374
            ],
            [
                -77.8326416015625,
                33.97980872872457
            ],
            [
                -77.9150390625,
                33.80197351806589
            ],
            [
                -77.9754638671875,
                33.73804486328907
            ],
            [
                -78.11279296875,
                33.8521697014074
            ],
            [
                -78.2830810546875,
                33.8521697014074
            ],
            [
                -78.4808349609375,
                33.815666308702774
            ],
            [
                -79.6728515625,
                34.8047829195724
            ],
            [
                -80.782470703125,
                34.836349990763864
            ],
            [
                -80.782470703125,
                34.91746688928252
            ],
            [
                -80.9307861328125,
                35.092945313732635
            ],
            [
                -81.0516357421875,
                35.02999636902566
            ],
            [
                -81.0516357421875,
                35.05248370662468
            ],
            [
                -81.0516357421875,
                35.137879119634185
            ],
            [
                -82.3150634765625,
                35.19625600786368
            ],
            [
                -82.3590087890625,
                35.19625600786368
            ],
            [
                -82.40295410156249,
                35.22318504970181
            ],
            [
                -82.4688720703125,
                35.16931803601131
            ],
            [
                -82.6885986328125,
                35.1154153142536
            ],
            [
                -82.781982421875,
                35.06147690849717
            ],
            [
                -83.1060791015625,
                35.003003395276714
            ],
            [
                -83.616943359375,
                34.99850370014629
            ],
            [
                -84.05639648437499,
                34.985003130171066
            ],
            [
                -84.22119140625,
                34.985003130171066
            ],
            [
                -84.32281494140625,
                34.9895035675793
            ]
        ],
        [
            [
                -75.69030761718749,
                35.74205383068037
            ],
            [
                -75.5914306640625,
                35.74205383068037
            ],
            [
                -75.5419921875,
                35.585851593232356
            ],
            [
                -75.56396484375,
                35.32633026307483
            ],
            [
                -75.69030761718749,
                35.285984736065735
            ],
            [
                -75.970458984375,
                35.16482750605027
            ],
            [
                -76.2066650390625,
                34.994003757575776
            ],
            [
                -76.300048828125,
                35.02999636902566
            ],
            [
                -76.409912109375,
                35.07946034047981
            ],
            [
                -76.5252685546875,
                35.10642805736423
            ],
            [
                -76.4208984375,
                35.25907654252574
            ],
            [
                -76.3385009765625,
                35.294952147406576
            ],
            [
                -76.0858154296875,
                35.29943548054543
            ],
            [
                -75.948486328125,
                35.44277092585766
            ],
            [
                -75.8660888671875,
                35.53669637839501
            ],
            [
                -75.772705078125,
                35.567980458012094
            ],
            [
                -75.706787109375,
                35.634976650677295
            ],
            [
                -75.706787109375,
                35.74205383068037
            ],
            [
                -75.69030761718749,
                35.74205383068037
            ]
        ]
    ]
}  
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 matplotlib/python 绘制地理数据 的相关文章

随机推荐

  • 尝试使用 socket.io 时出现错误

    我目前正在使用 socket io swift 客户端 在 Iphone SE 上运行 这是快速代码 let socket SocketIOClient socketURL URL string http example com 4000
  • 更改 CodeBlocks 中的链接器顺序

    我在 DialogBlocks 5 03 中有一个项目 可以使用 mingw32 正常编译 但使用 CodeBlocks 13 12 显示此错误 F wxWidgets 3 0 0 lib gcc lib libwxmsw30u core
  • 如何计算圆上两点之间的弧角?

    给定一个已知圆心和圆上两点 即已知半径 的圆 如何确定圆上两点之间的最小圆弧角度 将中心到两点变成一对向量 然后推过去this http en wikipedia org wiki Vector 28geometry 29 Dot prod
  • 为什么Android Studio 1.0 rc会开始下载Android SDK而不检测是否存在?

    我已经在我的 Archlinux 盒子里安装了 Android Studio 1 0 rc 和 Android SDK 但是当我尝试创建一个新的Android应用程序时 AS会尝试直接从dl ssl google com下载另一组SDK 我
  • 什么情况下不会调用 C++ 析构函数?

    我知道我的析构函数是在堆栈的正常展开和抛出异常时调用的 但不是在调用 exit 时调用 还有其他情况我的析构函数不会被调用吗 SIGINT 或 SIGSEGV 等信号怎么样 我认为对于 SIGSEGV 它们不会被调用 但对于 SIGNINT
  • ld: -bundle 和 -bitcode_bundle 不能一起使用

    我正在建造llvm clang 3 7具有位码支持 fembed bitcode 由于错误 某些模块无法链接 ld bundle 和 bitcode bundle Xcode 设置 ENABLE BITCODE YES 不能一起使用 cla
  • 实际上使用 UIDatePickerModeCountDownTimer 作为计时器

    我只是想制作一个计时器 我想用UIDatePickerModeCountDownTimer的模式UIDatePicker 这样当用户只需在选择器中选择 15 分钟时 他们就会返回到一个屏幕 该屏幕在标签中显示 15 分钟的值 然后他们可以从
  • 具有多表继承的父类上的 Django post_save 信号

    在 Django 中 如果您有使用多表继承的模型 并且您在父类上为 post save 信号定义了一个接收器 那么当保存子类的实例时 是否会调用该接收器函数 借个例子来自另一个问题 https stackoverflow com quest
  • 在 R 中将完整年龄从字符转换为数字

    我有一个数据集 其中人们的完整年龄为 R 中的字符串 例如 10 年 8 个月 23 天 我需要将其转换为有意义的数字变量 我正在考虑将其转换为有多少天人的年龄 这很困难 因为月份有不同的天数 因此 最好的解决方案可能是创建一个双变量 将年
  • 如何检测android中的屏幕覆盖?

    在某些设备中 当屏幕覆盖应用程序正在运行时 单击 VPN 权限确定按钮时不会执行任何操作 所以我想检查屏幕覆盖应用程序是否正在运行 并创建 检测到屏幕覆盖 对话框 有没有办法在android中以编程方式检测屏幕覆盖 示例代码 public
  • CATALINA_OPTS 与 JAVA_OPTS - 有什么区别?

    我试图找出 Apache Tomcat 变量之间的区别 CATALINA OPTS and JAVA OPTS in SO http stackoverflow com并惊讶地发现这里还没有发布问题 答案 所以我想在发现差异后在这里分享 带
  • 在 Haskell 中实现记忆功能

    我对 Haskell 相当陌生 我正在尝试实现一个基本的记忆功能 它使用Data Map存储计算值 我的示例是欧拉项目问题 15 其中涉及计算 20x20 网格中从一个角到另一个角的可能路径数 这是我到目前为止所拥有的 我还没有尝试编译 因
  • 如果未显式提交或回滚,则自动提交事务

    我们使用 Weblogic 服务器 并在连接到 Oracle 10g 时始终将 autoCommit 设置为 false 我想知道 Weblogic 中是否有一个设置 如果未从应用程序代码中显式调用提交或回滚 它将自动提交事务 我听说 We
  • VS2013 Intellisense 不理解 decltype

    是否有补丁 官方或非官方 可以让 IntelliSense 停止报告每次使用decltype作为语法错误 它编译得很好 所以我知道decltype是支持的 但是到处都是红色波浪线会让人分心 而且很难找到actual代码中的错误 每次编译都会
  • 重新排序表列?

    有谁知道使用 jQuery 对表列重新排序的方法吗 我的意思不是排序 我的意思是在表中向左或向右动态移动整个列 我知道优秀的可拖动插件 http www danvk org wp dragtable 但我不需要允许用户移动列的东西 我需要一
  • 网络音频 API 故障/失真问题

    我是网络音频 API 的新手 并制作了一个简单的合成器来了解细节 问题是 在大量声音输入后 我的音频会失真很多 因此 如果我施加大量频率 它就会失真 任何了解 API 的人都可以快速浏览一下我的代码 看看是否存在任何重大错误 遗漏 可以在
  • 将升压套接字存储在向量中[关闭]

    Closed 这个问题需要调试细节 help minimal reproducible example 目前不接受答案 这是代码 我收到以下错误 In member function void socks4Server listener i
  • 在iOS中,如何根据环境(dev、hom、prod)更改启动屏幕图像?

    我有一个带有图像的启动屏幕 到目前为止运行良好 但现在我有 3 个模式 dev hom 和 prod 我想知道如何根据构建时选择的模式更改启动屏幕图像 EDIT 我想到了两种选择 但我不知道哪一种最好 选项 1 创建两个 Storyboar
  • 在 iOS 中将应用程序中的 cookie 设置为 Safari

    在我的应用程序中 我需要实现下一个功能 当用户登录应用程序时 它 应用程序 需要将某些网站的 cookie 或任何其他数据 保存到移动 Safari 目标是当用户下次在 Safari 中打开该网站时不再登录 文档 https develop
  • 如何使用 matplotlib/python 绘制地理数据

    我正在尝试使用不同的库在 python 上绘制多边形 但这些库都不适合我 我试过vincent https github com wrobstory vincent Shapely https pypi python org pypi Sh