Example #1
0
def convex_hull_polys(in_fc, gdb, name, kind):
    """Determine the convex hulls on a shape basis"""
    SR = getSR(in_fc)
    kind, k = shape_K(in_fc)
    tmp, IFT = fc_geometry(in_fc, SR=SR, IFT_rec=False)
    info = "convex hulls to polygons"
    g = Geo(tmp, IFT, k, info)                   # create the geo array
    ch_out = g.convex_hulls(by_part=False, threshold=50)
    ch_out = Update_Geo(ch_out, K=k, id_too=None, Info=info)
    # ---- produce the geometry
    p = kind.upper()
    geometry_fc(ch_out, ch_out.IFT, p_type=p, gdb=gdb, fname=name, sr=SR)
    return "{} completed".format("Convex Hulls")
Example #2
0
def convex_hull_polys(in_fc, out_fc, kind):
    """Determine the convex hulls on a shape basis"""
    result = check_path(out_fc)
    if result[0] is None:
        tweet(result[1])
        return result[1]
    gdb, name = result
    # ---- done checks
    SR = getSR(in_fc)
    tmp, IFT, IFT_2 = fc_geometry(in_fc, SR)
    SR = getSR(in_fc)
    info = "convex hulls to polygons"
    g = Geo(tmp, IFT=IFT, Kind=kind, Info=info)  # create the geo array
    ch_out = g.convex_hulls(by_part=False, threshold=50)
    ch_out = Update_Geo(ch_out, K=kind, id_too=None, Info=info)
    #
    # ---- produce the geometry
    p = "POLYGON"
    if kind == 1:
        p = "POLYLINE"
    geometry_fc(ch_out, ch_out.IFT, p_type=p, gdb=gdb, fname=name, sr=SR)
    return "{} completed".format(out_fc)