コード例 #1
0
def main():
    lat, lon, radius = -66.10165712, 136.51515176, 55.957758952975269
    filename = 'Torres-Strait.png'
    land = earth.ReadShapes('shapes/ne_10m_land')
    klass = crs.AzimuthalEquidistant
    proj, land_projected = earth.Project(lat, lon, land, klass)
    circle = earth.Circle(lat, lon, radius, proj)

    pyplot.figure(figsize=(6, 6))
    ax = pyplot.axes(projection=proj)
    ax.set_extent([123, 153, -32, 0])
    land_feature = feature.ShapelyFeature(land_projected,
                                          proj,
                                          edgecolor='none',
                                          facecolor='black')
    circle_feature = feature.ShapelyFeature([circle],
                                            proj,
                                            linewidth=1,
                                            edgecolor='blue',
                                            facecolor='none')
    intersection_feature = feature.ShapelyFeature(
        [g.intersection(circle) for g in land_projected],
        proj,
        linewidth=1,
        edgecolor='yellow',
        facecolor='none')
    ax.add_feature(land_feature)
    ax.add_feature(circle_feature)
    ax.add_feature(intersection_feature)
    ax.gridlines(edgecolor='#bbbbbb', linestyle='-', linewidth=0.5)
    pyplot.savefig(filename, bbox_inches='tight', pad_inches=0.2)
コード例 #2
0
def main():
  land = earth.ReadShapes('shapes/ne_10m_land')
  with open('small_circle_10m.txt', 'w') as log:
    for lat0, lat1, lon0, lon1, lat_step in [
        (-61, -63, 110, 113, 0.1),
        (-64.3, -66.7, 135.0, 140.2, 0.1),
        (-9, -22, -140, -155, 0.5)]:
      earth.EvaluateForMeshPoints(
          LargestCircleThroughOcean2,
          lat0, lat1, lon0, lon1,
          lat_step, land, log)
コード例 #3
0
def main():
  land = earth.ReadShapes('shapes/ne_10m_land')
  with open('great_circle_10m_a.txt', 'w') as log:
    for lat0, lat1, lon0, lon1 in [
        (4, 8, -108, -118), (23, 25, 78, 81), (51, 64, 45, 50),
        (49, 53, -3, -6), (42, 45, 153, 157), (76, 79, 98, 103),
        (0, 7, -151, -161)]:
      earth.EvaluateForMeshPoints(
          earth.GreatCircleLandFraction,
          lat0, lat1, lon0, lon1,
          0.5, land, log)
      print >>log
コード例 #4
0
def main():
    lat, lon, radius = 50, 20, 90
    lands = earth.ReadShapes('shapes/ne_110m_land')
    proj, lands_projected = earth.Project(lat, lon, lands)
    pyplot.figure(figsize=(6, 6))
    ax = pyplot.axes(projection=proj)
    lands_feature = feature.ShapelyFeature(lands_projected,
                                           proj,
                                           edgecolor='none',
                                           facecolor='black')
    ax.add_feature(lands_feature)
    ax.gridlines(edgecolor='#bbbbbb', linestyle='-', linewidth=1)
    pyplot.savefig('Centre-in-Krakow.png', bbox_inches='tight')
コード例 #5
0
def main():
    land = earth.ReadShapes('shapes/ne_10m_land')
    with open('great_circle_10m_b.txt', 'w') as log:
        for lat0, lat1, lon0, lon1 in [(3.7, 6.2, -112.5, -116.5),
                                       (23.5, 24.5, 78.5, 80.5),
                                       (56.5, 59, 46, 49),
                                       (50.5, 51.5, -3.5, -6.5),
                                       (43, 44.5, 153.5, 155.5),
                                       (76.5, 78.5, 98, 101),
                                       (3.2, 5.2, -153, -156)]:
            earth.EvaluateForMeshPoints(earth.GreatCircleLandFraction, lat0,
                                        lat1, lon0, lon1, 0.1, land, log)
            print >> log
コード例 #6
0
ファイル: optimize.py プロジェクト: MarcinCiura/slicing-earth
def main():
    land = earth.ReadShapes('shapes/ne_10m_land')
    for x0 in [(5.2, -114.45), (24.1, 79.17), (57.5, 46.75), (50.7, -4.76),
               (44.1, 154.79), (77.4, 100.5)]:
        print optimize.minimize(LandFraction,
                                x0=x0,
                                args=(land, ),
                                method=METHOD)
    print optimize.minimize(NegativeLandFraction,
                            x0=(3.4, -154.14),
                            args=(land, ),
                            method=METHOD)
    for x0 in [(-65.9, 136.73), (-15.0, -149.64)]:
        print optimize.minimize(NegativeCircleRadius,
                                x0=x0,
                                args=(land, ),
                                method=METHOD)
コード例 #7
0
def main():
    land = earth.ReadShapes('shapes/ne_110m_land')
    with open('small_circle_110m.txt', 'w') as log:
        earth.EvaluateForMeshPoints(earth.LargestCircleThroughOcean, -90, 90,
                                    -180, +180, 1., land, log)