Changeset 1033


Ignore:
Timestamp:
08/29/12 08:57:50 (5 years ago)
Author:
jjr8
Message:

Working on enhancements to the CreatePointsAlongLines? tool for bbest.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MGET/Branches/Jason/PythonPackage/src/GeoEco/SpatialAnalysis/Points.py

    r1032 r1033  
    469469                destFields.append(elapsedField) 
    470470 
     471            # If the caller requested a vertex feature class as well, 
     472            # create it, using the one above as a template. 
     473 
     474            if outputVertexFeatureClass: 
     475                Logger.Info(_(u'Creating output feature class %(output)s.') % {u'output': outputVertexFeatureClass}) 
     476                gp.CreateFeatureClass_management(os.path.dirname(outputVertexFeatureClass), os.path.basename(outputVertexFeatureClass), u'POINT', outputFeatureClass, u'DISABLED', u'DISABLED', outputTable.GetSpatialReference('ArcGIS')) 
     477                outputVertexTable = ArcGISTable(outputVertexFeatureClass) 
     478 
    471479            # If the caller requested that the remaining distance on a 
    472480            # track should be distributed evenly among all points, 
     
    554562 
    555563            insertCursor = outputTable.OpenInsertCursor() 
     564            vertexInsertCursor = None 
    556565            try: 
     566                if outputVertexFeatureClass: 
     567                    vertexInsertCursor = outputVertexTable.OpenInsertCursor() 
     568                     
    557569                gotLine = False 
    558570                trackID = None 
     
    864876                    del selectCursor 
    865877            finally: 
     878                if vertexInsertCursor is not None: 
     879                    del vertexInsertCursor 
    866880                del insertCursor 
    867881        except: 
     
    26502664 
    26512665AddArgumentMetadata(ArcGISPoints.CreatePointsAlongLines, u'outputVertexFeatureClass', 
    2652     typeMetadata=ArcGISFeatureClassTypeMetadata(deleteIfParameterIsTrue=u'overwriteExisting', createParentDirectories=True, mustBeDifferentThanArguments=[u'inputLines, outputFeatureClass']), 
     2666    typeMetadata=ArcGISFeatureClassTypeMetadata(canBeNone=True, deleteIfParameterIsTrue=u'overwriteExisting', createParentDirectories=True, mustBeDifferentThanArguments=[u'inputLines, outputFeatureClass']), 
    26532667    description=_( 
    26542668u"""Optional output feature point class to create and populate with 
Note: See TracChangeset for help on using the changeset viewer.