def plotthebitch(lines: list):
    """
    ha ha chart go brrrr 
    """
    i = 121
    for item in lines:
        ax = fig.add_subplot(i)
        plot_coords(ax, item)
        plot_bounds(ax, item)
        plot_line_issimple(ax, item, alpha=0.7)
        i += 1
    pyplot.show()
示例#2
0
def RunThis(point,top,bottom,left,right,edges,ax):
    
    for line in edges.geometry:
        plot_bounds(ax, line)
        plot_line_issimple(ax, line, alpha=1,linewidth=12)
    pyplot.savefig("plot_map",bbox_inches='tight',facecolor='black',pad_inches=0,transperent = True)    
    response =  CheckStreet(point,edges,ax)
    answer = ('say '+response)
    system(answer)
    print response
    x,y=second_shortest_line.xy
    pyplot.plot(x,y,color = "red",zorder=3)
    pyplot.plot(point.x,point.y,color = "red", marker='o',zorder = 3)
    pyplot.savefig("plot_map",bbox_inches='tight',facecolor='black')
示例#3
0
def SayName():
    
    pyplot.close()
    pyplot.clf
    fig2,axe = pyplot.subplots(nrows=1, ncols=2)
    custom_drive = ('["area"!~"yes"]["highway"!~"cycleway|footway|path|pedestrian|steps|track|corridor|'
                        'proposed|construction|bridleway|abandoned|platform|raceway|service"]'
                        '["motor_vehicle"!~"no"]["motorcar"!~"no"]{}'
                        '["service"!~"parking|parking_aisle|driveway|private|emergency_access"]').format(ox.settings.default_access)
    G_new = ox.graph_from_bbox(top, bottom,right, left, network_type= "drive")
    G_projected_new = ox.project_graph(G_new)
    ox.plot_graph(G_projected_new,save = True,filename = "maps_new", show = False,
                  node_color='#FFFFFF',node_edgecolor='#FFFFFF',edge_color='#777777',bgcolor = "#000000",
                  node_zorder=3,dpi=200, edge_linewidth=8,use_geom=True)
    ox.simplify.clean_intersections(G_new,tolerance=100)
    nodes, edges2 = ox.graph_to_gdfs(G_new)
##    for element in edges2:
##        print element
    fig2,axe = pyplot.subplots(nrows=1, ncols=2)
    #axe.axis ('OFF')
    print type(axe)
    #print edges.geom
    for line in edges2.geometry:
        plot_bounds(ax, line)
        plot_line_issimple(ax, line, alpha=1,linewidth=1)
    pyplot.savefig("plot_map",bbox_inches='tight',facecolor='black',pad_inches=0,transperent = True)
    speech =""
    print "checking for this"
    print point.x
    print point.y
    print edges2['name'][1]
    CheckStreet(point,edges2,axe )
    x,y=second_shortest_line.xy
    pyplot.plot(x,y,color = "red",zorder=3)
    pyplot.plot(point.x,point.y,color = "red", marker='o',zorder = 3)
    pyplot.savefig("plot_map",bbox_inches='tight',facecolor='black')
示例#4
0
            y,
            color=v_color(ob),
            alpha=0.7,
            linewidth=3,
            solid_capstyle='round',
            zorder=2)


fig = pyplot.figure(1, figsize=SIZE, dpi=90)

# 1: simple line
ax = fig.add_subplot(121)
line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])

plot_coords(ax, line)
plot_bounds(ax, line)
plot_line_issimple(ax, line, alpha=0.7)

ax.set_title('a) simple')

set_limits(ax, -1, 4, -1, 3)

#2: complex line
ax = fig.add_subplot(122)
line2 = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (-1, 1), (1, 0)])

plot_coords(ax, line2)
plot_bounds(ax, line2)
plot_line_issimple(ax, line2, alpha=0.7)

ax.set_title('b) complex')
示例#5
0
    ax.plot(x, y, "o", color="#000000", zorder=1)


def plot_line(ax, ob):
    x, y = ob.xy
    ax.plot(x, y, color=v_color(ob), alpha=0.7, linewidth=3, solid_capstyle="round", zorder=2)


fig = pyplot.figure(1, figsize=SIZE, dpi=90)

# 1: simple line
ax = fig.add_subplot(121)
line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])

plot_coords(ax, line)
plot_bounds(ax, line)
plot_line_issimple(ax, line, alpha=0.7)

ax.set_title("a) simple")

set_limits(ax, -1, 4, -1, 3)

# 2: complex line
ax = fig.add_subplot(122)
line2 = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (-1, 1), (1, 0)])

plot_coords(ax, line2)
plot_bounds(ax, line2)
plot_line_issimple(ax, line2, alpha=0.7)

ax.set_title("b) complex")
示例#6
0
        _plot_coords(ax, line, zorder=1)

def plot_lines(ax, ob):
    color = color_issimple(ob)
    for line in ob:
        plot_line(ax, line, color=color, alpha=0.7, zorder=2)

fig = pyplot.figure(1, figsize=SIZE, dpi=90)

# 1: disconnected multilinestring
ax = fig.add_subplot(121)

mline1 = MultiLineString([((0, 0), (1, 1)), ((0, 2),  (1, 1.5), (1.5, 1), (2, 0))])

plot_coords(ax, mline1)
plot_bounds(ax, mline1)
plot_lines(ax, mline1)

ax.set_title('a) simple')

set_limits(ax, -1, 3, -1, 3)

#2: invalid self-touching ring
ax = fig.add_subplot(122)

mline2 = MultiLineString([((0, 0), (1, 1), (1.5, 1)), ((0, 2), (1, 1.5), (1.5, 1), (2, 0))])

plot_coords(ax, mline2)
plot_bounds(ax, mline2)
plot_lines(ax, mline2)
示例#7
0
def plot_lines(ax, ob):
    color = color_issimple(ob)
    for line in ob:
        plot_line(ax, line, color=color, alpha=0.7, zorder=2)


fig = pyplot.figure(1, figsize=SIZE, dpi=90)

# 1: disconnected multilinestring
ax = fig.add_subplot(121)

mline1 = MultiLineString([((0, 0), (1, 1)),
                          ((0, 2), (1, 1.5), (1.5, 1), (2, 0))])

plot_coords(ax, mline1)
plot_bounds(ax, mline1)
plot_lines(ax, mline1)

ax.set_title('a) simple')

set_limits(ax, -1, 3, -1, 3)

#2: invalid self-touching ring
ax = fig.add_subplot(122)

mline2 = MultiLineString([((0, 0), (1, 1), (1.5, 1)),
                          ((0, 2), (1, 1.5), (1.5, 1), (2, 0))])

plot_coords(ax, mline2)
plot_bounds(ax, mline2)
plot_lines(ax, mline2)