Good day, I am currently checking a piece of arcpy code. Where a point is
shifted within a set distance to protect the privacy of said point. Please
see the code below, and please advise me or correct the code where it is
needed

# Step 11 - SELECT By Attributes -> where FID == FID_1, export to new
Feature Class
#
------------------------------------------------------------------------------------------------------------------
# Make a layer from the feature class
arcpy.MakeFeatureLayer_management(in_features="RDiff_AreaIntersect_Dissolve",
out_layer="lyr_eaten",
where_clause="",
workspace="",
field_info= "OBJECTID OBJECTID VISIBLE NONE", "Shape Shape VISIBLE NONE",
"ORIG_FID ORIG_FID VISIBLE NONE", "FIRST_Join_Count FIRST_Join_Count
VISIBLE NONE"
FIRST_OBJECTID_1 (VISIBLE NONE;FIRST_gps_latitu FIRST_gps_latitu VISIBLE
NONE;
FIRST_gps_longit; FIRST_gps_longit VISIBLE NONE;FIRST_OBJECTID
FIRST_OBJECTID VISIBLE NONE;
FIRST_R1 FIRST_R1 VISIBLE NONE;FIRST_ORIG_FID FIRST_ORIG_FID VISIBLE
NONE;Shape_Length Shape_Length VISIBLE NONE;
Shape_Area Shape_Area VISIBLE NONE)

# SELECT by attribute
arcpy.SelectLayerByAttribute_management(in_layer_or_view="lyr_eaten",
selection_type="NEW_SELECTION",
where_clause="FID_RDiffBuffer = ORIG_FID")

# Write the selected features to a new featureclass
arcpy.CopyFeatures_management(in_features="lyr_eaten",out_feature_class="C:/Users/Claudinho/Desktop/2016/
GIS_702/COPC_DATA/Altered_Data_sets/702.gdb/DonutFile", config_keyword="",
spatial_grid_1="0",
spatial_grid_2="0", spatial_grid_3="0")

#
------------------------------------------------------------------------------------------------------------------
# Step 12 - CreateRandomPoint constrained by DonutFile
#
------------------------------------------------------------------------------------------------------------------
arcpy.CreateRandomPoints_management(out_path="C:/Users/Claudinho/Desktop/2016/GIS_702/COPC_DATA/
Altered_Data_sets/702.gdb", out_name="RandomFile",
constraining_feature_class="DonutFile",
constraining_extent="0 0 250 250", number_of_points_or_field="1",
minimum_allowed_distance="0 Meters",
create_multipoint_output="POINT", multipoint_size="0")

# JOIN RandomFile (CID) to DonutFile (OBJECTID)
arcpy.JoinField_management(in_data="RandomFile", in_field="CID",
join_table="DonutFile", join_field="OBJECTID",
fields="")

# DELETE unnecessary fields in RandomFile
arcpy.DeleteField_management(in_table="RandomFile",
drop_field="FIRST_OBJECTID_1;FIRST_FID_RDiffBuffer;
FIRST_gps_latitu;FIRST_gps_longit;")


Regards
Adam
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to