当前位置: 首页>>代码示例>>Python>>正文


Python arcpy.Array方法代码示例

本文整理汇总了Python中arcpy.Array方法的典型用法代码示例。如果您正苦于以下问题:Python arcpy.Array方法的具体用法?Python arcpy.Array怎么用?Python arcpy.Array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在arcpy的用法示例。


在下文中一共展示了arcpy.Array方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: vertical

# 需要导入模块: import arcpy [as 别名]
# 或者: from arcpy import Array [as 别名]
def vertical(TLX, TRX, TLY, TRY, BLX, BRX, BLY, BRY, divisions):

    count = 1.0
    while count < divisions:
        a         = float(TLX*((divisions-count)/divisions) + TRX*(count/divisions)) + float(overflow)
        b         = float(TLY*((divisions-count)/divisions) + TRY*(count/divisions)) + float(overflow)

        c         = float(BLX*((divisions-count)/divisions) + BRX*(count/divisions)) - float(overflow)
        d         = float(BLY*((divisions-count)/divisions) + BRY*(count/divisions)) - float(overflow)

        T2B       = arcpy.Array([arcpy.Point(a, b), arcpy.Point(c, d)])
        T2B_line  = arcpy.Polyline(T2B)

        insert_cursor.insertRow((T2B_line,))

        count += 1.0 
开发者ID:inkenbrandt,项目名称:ArcPy,代码行数:18,代码来源:CreateCustomGrid.py

示例2: horizontal

# 需要导入模块: import arcpy [as 别名]
# 或者: from arcpy import Array [as 别名]
def horizontal(TLX, TRX, TLY, TRY, BLX, BRX, BLY, BRY, divisions):

    count = 1.0
    while count < divisions:
        a         = float(TLX*((divisions-count)/divisions) + BLX*(count/divisions)) - float(overflow)
        b         = float(TLY*((divisions-count)/divisions) + BLY*(count/divisions)) - float(overflow)

        c         = float(TRX*((divisions-count)/divisions) + BRX*(count/divisions)) + float(overflow)
        d         = float(TRY*((divisions-count)/divisions) + BRY*(count/divisions)) + float(overflow)

        L2R       = arcpy.Array([arcpy.Point(a, b), arcpy.Point(c, d)])
        L2R_line  = arcpy.Polyline(L2R)

        insert_cursor.insertRow((L2R_line,))

        count += 1.0 
开发者ID:inkenbrandt,项目名称:ArcPy,代码行数:18,代码来源:CreateCustomGrid.py

示例3: make_poly_from_extent

# 需要导入模块: import arcpy [as 别名]
# 或者: from arcpy import Array [as 别名]
def make_poly_from_extent(ext, sr):
    """Make an arcpy polygon object from an input extent object.,Returns
    a polygon geometry object.

    Required:
    ext -- extent object
    sr -- spatial reference

    Example
    >>> ext = arcpy.Describe(fc).extent
    >>> sr = 4326  #WKID for WGS 84
    >>> poly = make_poly_from_extent(ext, sr)
    >>> arcpy.CopyFeatures_management(poly, r'C:\Temp\Project_boundary.shp')
    """
    array = arcpy.Array()
    array.add(ext.lowerLeft)
    array.add(ext.lowerRight)
    array.add(ext.upperRight)
    array.add(ext.upperLeft)
    array.add(ext.lowerLeft)
    return arcpy.Polygon(array, sr) 
开发者ID:NERC-CEH,项目名称:arcapi,代码行数:23,代码来源:arcapi.py

示例4: execute

# 需要导入模块: import arcpy [as 别名]
# 或者: from arcpy import Array [as 别名]
def execute(in_datasets, out_fc):
    # use gcs as output sr since all extents will fit in it
    out_sr = arcpy.SpatialReference("WGS 1984")

    in_datasets = in_datasets.split(";")

    arcpy.CreateFeatureclass_management(os.path.dirname(out_fc),
                                        os.path.basename(out_fc),
                                        "POLYGON",
                                        spatial_reference=out_sr)

    arcpy.AddField_management(out_fc, "dataset", "TEXT", 400)

    # add each dataset's extent & the dataset's name to the output
    with arcpy.da.InsertCursor(out_fc, ("SHAPE@", "dataset")) as cur:

        for i in in_datasets:
            d = arcpy.Describe(i)
            ex = d.Extent
            pts = arcpy.Array([arcpy.Point(ex.XMin, ex.YMin),
                              arcpy.Point(ex.XMin, ex.YMax),
                              arcpy.Point(ex.XMax, ex.YMax),
                              arcpy.Point(ex.XMax, ex.YMin),
                              arcpy.Point(ex.XMin, ex.YMin),])

            geom = arcpy.Polygon(pts,  d.SpatialReference)

            if d.SpatialReference != out_sr:
                geom = geom.projectAs(out_sr)
            cur.insertRow([geom, d.CatalogPath]) 
开发者ID:arcpy,项目名称:sample-gp-tools,代码行数:32,代码来源:datasetExtentToFeatures.py

示例5: qq

# 需要导入模块: import arcpy [as 别名]
# 或者: from arcpy import Array [as 别名]
def qq(TLX, TRX, TLY, TRY, BLX, BRX, BLY, BRY, divisions):

    count = 1.0
    while count < divisions:
        a         = float(TLX*((divisions-count)/divisions) + TRX*(count/divisions)) + float(overflow)
        b         = float(TLY*((divisions-count)/divisions) + TRY*(count/divisions)) + float(overflow)

        c         = float(BLX*((divisions-count)/divisions) + BRX*(count/divisions)) - float(overflow)
        d         = float(BLY*((divisions-count)/divisions) + BRY*(count/divisions)) - float(overflow)

        e         = float(TLX*((divisions-count)/divisions) + BLX*(count/divisions)) - float(overflow)
        f         = float(TLY*((divisions-count)/divisions) + BLY*(count/divisions)) - float(overflow)

        g         = float(TRX*((divisions-count)/divisions) + BRX*(count/divisions)) + float(overflow)
        h         = float(TRY*((divisions-count)/divisions) + BRY*(count/divisions)) + float(overflow)

        T2B       = arcpy.Array([arcpy.Point(a, b), arcpy.Point(c, d)])
        L2R       = arcpy.Array([arcpy.Point(e, f), arcpy.Point(g, h)])

        T2B_line  = arcpy.Polyline(T2B)
        L2R_line  = arcpy.Polyline(L2R)

        insert_cursor.insertRow((T2B_line,))
        insert_cursor.insertRow((L2R_line,))

        count += 1.0 
开发者ID:inkenbrandt,项目名称:ArcPy,代码行数:28,代码来源:CreateQQSections.py

示例6: q

# 需要导入模块: import arcpy [as 别名]
# 或者: from arcpy import Array [as 别名]
def q(TLX, TRX, TLY, TRY, BLX, BRX, BLY, BRY, divisions):

    count = 1.0
    while count < divisions:
        a         = float(TLX*((divisions-count)/divisions) + TRX*(count/divisions)) + float(overflow)
        b         = float(TLY*((divisions-count)/divisions) + TRY*(count/divisions)) + float(overflow)

        c         = float(BLX*((divisions-count)/divisions) + BRX*(count/divisions)) - float(overflow)
        d         = float(BLY*((divisions-count)/divisions) + BRY*(count/divisions)) - float(overflow)

        e         = float(TLX*((divisions-count)/divisions) + BLX*(count/divisions)) - float(overflow)
        f         = float(TLY*((divisions-count)/divisions) + BLY*(count/divisions)) - float(overflow)

        g         = float(TRX*((divisions-count)/divisions) + BRX*(count/divisions)) + float(overflow)
        h         = float(TRY*((divisions-count)/divisions) + BRY*(count/divisions)) + float(overflow)

        T2B       = arcpy.Array([arcpy.Point(a, b), arcpy.Point(c, d)])
        L2R       = arcpy.Array([arcpy.Point(e, f), arcpy.Point(g, h)])

        T2B_line  = arcpy.Polyline(T2B)
        L2R_line  = arcpy.Polyline(L2R)

        insert_cursor.insertRow((T2B_line,))
        insert_cursor.insertRow((L2R_line,))

        count += 1.0 
开发者ID:inkenbrandt,项目名称:ArcPy,代码行数:28,代码来源:CreateQSections.py

示例7: asShape

# 需要导入模块: import arcpy [as 别名]
# 或者: from arcpy import Array [as 别名]
def asShape(self):
        """Returns JSON as arcpy.Geometry() object."""
        if self.geometryType != ESRI_ENVELOPE:
            return arcpy.AsShape(self.json, True)
        else:
            ar = arcpy.Array([
                arcpy.Point(self.json[XMIN], self.json[YMAX]),
                arcpy.Point(self.json[XMAX], self.json[YMAX]),
                arcpy.Point(self.json[XMAX], self.json[YMIN]),
                arcpy.Point(self.json[XMIN], self.json[YMIN])
            ])
            return arcpy.Polygon(ar, arcpy.SpatialReference(self.spatialReference)) 
开发者ID:Bolton-and-Menk-GIS,项目名称:restapi,代码行数:14,代码来源:arc_restapi.py


注:本文中的arcpy.Array方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。