We are publishing a geoprocessing service that will split a large amount of features in a file geodatabase. The script uses the arcpy.defense.SplitFeatures() method, a ResourceSrf layer or a user passed in shapefile grid to split the features, so any features that fall within the grid or ResourceSrf should be split by the grid/ResourceSrf cell size.

The issue we are facing is that some features are split, while others are not, particularly polygon features, the Physiography surfaces are giving trouble as well as some line features. I am wondering if there is any reason why features would not split when called by this method? Of course the documentation for this method is sparse at best. Below is the code that splits the features.

def splitter(gdb_to_split, use_alt_surface):

gdb_exchange_folder = os.path.join(r'F:\Exchange\Rework_Temp', gdb_to_split[:-4])
gdb_to_split = os.path.join(gdb_exchange_folder, gdb_to_split)
gdb_to_split_tds = os.path.join(gdb_to_split, 'TDS')

if use_alt_surface:
    gdb_resource_srf = os.path.join(gdb_exchange_folder, 'clip_shape.shp')
    gdb_resource_srf = os.path.join(gdb_to_split, 'TDS', 'ResourceSrf')

physio_srf = os.path.join(gdb_to_split_tds, 'PhysiographySrf')

target_features = r''
arcpy.env.workspace = gdb_to_split_tds
fcl = arcpy.ListFeatureClasses()
for fclass in fcl:
    desc = arcpy.Describe(fclass)
    if desc.shapeType in ('Polygon', 'Polyline') and desc.name not in ('ResourceSrf', 'MetadataSrf', 'PhysiographySrf'):
        target_features += os.path.join(gdb_to_split_tds, fclass) + ';'
target_features = target_features[:-1]

arcpy.management.MakeFeatureLayer(gdb_resource_srf, "split_shape")
arcpy.management.SelectLayerByLocation("split_shape", "ARE_IDENTICAL_TO", gdb_resource_srf)

arcpy.defense.SplitFeatures("split_shape", target_features)

  • 1
    Welcome to GIS SE. "Best" questions are often problematic in our Focused question/Best answer model, since they tend to be opinion-based, and seek a number of responses to obtain a true answer. You could increase the focus by specifying an exact polygon which fails to split and seeking a solution to that. – Vince Sep 20 '19 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.