![]() ![]() The base geometry is within the comparison geometry if the base geometry is the intersection of the geometries and the intersection of their interiors is not empty. Within is the opposite operator of contains. Indicates if the base geometry is within the comparison geometry. The two geometries being unioned must be the same shape type. For example, a point touches a polyline only if the point is coincident with one of the polyline end points.Ĭonstructs the geometry that is the set-theoretic union of the input geometries. Geometries is not empty, but the intersection of their interiors isĮmpty. Two geometries touch when the intersection of the Indicates if the boundaries of the geometries intersect. The two input geometries must be the same shape type. ![]() The geometry that is the union of two geometries minus the instersection of those geometries. Returns a new point based on in_point snapped to this geometry. Similar to Polyline.positionAlongLine but will return a polyline segment between two points on the polyline instead of a single point. Returns a Polyline between start and end measures. Geometry containing only the regions of overlap between theįor faster results, test if the two geometries are disjoint before calling intersect. The intersection of two geometries of the same shape type is a Different dimension values can be used to The getPart method is equivalent to indexing an object that is, obj.getPart(0) is equivalent to obj.Ĭonstructs a geometry that is the geometric intersection of If an index is not specified, an Array object containing an Array of Point objects for each geometry part is returned. Returns an Array object of Point objects for a particular part of the geometry if an index is specified. Returns the length of the feature using a measurement method. Returns the area of the feature using a measurement method. This is a 2D comparison only M and Z values are ignored.Ĭreates a new simplified geometry using a specified maximum offset Indicates if the base and comparison geometries are of the same shape type and define the If the geometries intersect, the minimum distance is 0.īoth geometries must have the same projection. ![]() The distance is in the units of the geometry's spatial reference. ![]() Returns the minimum distance between two geometries. Geometries intersect if disjoint returns False. Indicates if the base and comparison geometries share no points in common. The following illustration shows the results when the red polygon is the source geometry. If a geometry is not cut, the left geometry will be empty ( None).Ĭonstructs the geometry that is composed only of the region unique to theīase geometry but not part of the other geometry. Parts of the target polyline that do not intersect the cutting polyline are returned as part of the right of result for that input polyline. This classification is based on the orientation of the cutter line. Each piece is classified as left of or right of the cutter. When a polyline or polygon is cut, it is split where it intersects the cutter polyline. Splits this geometry into a part left of the cutting polyline, and a part right of it. The interior of the polygon which is not equivalent to the entire They share a polyline or a point (for vertical line) in common on Two polylines cross if they share only points in common, at least Indicates if the two geometries intersect in a geometry of a lesser Only True relationships are shown in this illustration.Ĭonstructs the geometry that is the minimal bounding polygon such that all outer Indicates if the base geometry contains the comparison geometry. Change the calculation in this line if geom.Returns a tuple of angle and distance to a point or polygon.Ĭonstructs a polygon at a specified distance from the geometry.Ĭonstructs the intersection of the geometry and the specified extent. # Calculate area in hectares and update SUP_HA fieldĪrea_ha = geom.area / 10000 # 1 hectare is equal to 10000 square meters. With arcpy.da.UpdateCursor(shapefile, ) as cur:Īrcpy.AddField_management(shapefile, "SUP_HA", "DOUBLE", 10, 2, "", "refcode", "NULLABLE", "REQUIRED") import arcpyĪrcpy.AddField_management(shapefile, "CODE", "TEXT", 10, "", "", "refcode", "NULLABLE", "REQUIRED") In the code below, I have assumed that your shapefile is in meters. as to exactly how you calculate the area into hectares will depend on the units the shapefile is currently in. The with statement will automatically close your cursor when the code exits the code block, freeing up the resources used by the cursor. First off, I would reccomend using a with statement when implementing your cursors. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |