Changeset 1028


Ignore:
Timestamp:
08/28/12 17:48:30 (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

    r1027 r1028  
    347347            # Perform additional validation. 
    348348 
     349            if startTimeField is not None and endTimeField is not None and startTimeField.lower() == endTimeField.lower(): 
     350                raise ValueError(_(u'The Start Time Field and End Time Field parameters must be different.')) 
     351 
    349352            temporalInterval = unit in [u'days', u'hours', u'minutes', u'seconds'] 
    350353            if temporalInterval: 
     
    354357                    raise ValueError(_(u'A value must be provided for the End Time Field parameter when the Interval Unit is %(unit)s.') % {u'unit': unit}) 
    355358 
    356                 if trackIDField is not None and trackIDField.lower() == u'pointtime': 
    357                     raise ValueError(_(u'If a temporal Interval Unit is specified (i.e. days, hours, minutes, or seconds) the Track ID Field may not be named PointTime.')) 
    358                 if orderByField is not None and orderByField.lower() == u'pointtime': 
    359                     raise ValueError(_(u'If a temporal Interval Unit is specified (i.e. days, hours, minutes, or seconds) the Order By Field may not be named PointTime.')) 
    360                 if startTimeField.lower() == u'pointtime': 
    361                     raise ValueError(_(u'If a temporal Interval Unit is specified (i.e. days, hours, minutes, or seconds) the Start Time Field may not be named PointTime.')) 
    362                 if endTimeField.lower() == u'pointtime': 
    363                     raise ValueError(_(u'If a temporal Interval Unit is specified (i.e. days, hours, minutes, or seconds) the End Time Field may not be named PointTime.')) 
    364                 if fieldsToCopy is not None and u'pointtime' in [f.lower() for f in fieldsToCopy]: 
    365                     raise ValueError(_(u'If a temporal Interval Unit is specified (i.e. days, hours, minutes, or seconds) the Fields To Copy parameter may not contain a field named PointTime.')) 
     359            if startTimeField is None or endTimeField is None: 
     360                startTimeField = None 
     361                endTimeField = None 
     362                pointTimeField = None 
     363                elapsedField = None 
     364 
     365            if fieldsToCopy is not None: 
     366                fieldsToCopy2 = [f.lower() for f in fieldsToCopy] 
     367                if distanceField is not None and distanceField.lower() in fieldsToCopy2: 
     368                    raise ValueError(_(u'The Distance Travelled Field To Create may not be named %(name)s because that is a field of the input lines that you requested be copied to the points. Please specify a different name for the Distance Travelled Field To Create.') % {u'name': distanceField}) 
     369                if pointTimeField is not None and pointTimeField.lower() in fieldsToCopy2: 
     370                    raise ValueError(_(u'The Time Field To Create may not be named %(name)s because that is a field of the input lines that you requested be copied to the points. Please specify a different name for the Time Field To Create.') % {u'name': pointTimeField}) 
     371                if elapsedField is not None and elapsedField.lower() in fieldsToCopy2: 
     372                    raise ValueError(_(u'The Elapsed Time Field To Create may not be named %(name)s because that is a field of the input lines that you requested be copied to the points. Please specify a different name for the Elapsed Time Field To Create.') % {u'name': elapsedField}) 
     373                 
     374            if distanceField is not None: 
     375                if pointTimeField is not None and pointTimeField.lower() == distanceField.lower(): 
     376                    raise ValueError(_(u'The Distance Travelled Field To Create field and the Time Field To Create field may not have the same name.')) 
     377                if elapsedField is not None and elapsedField.lower() == distanceField.lower(): 
     378                    raise ValueError(_(u'The Distance Travelled Field To Create field and the Elapsed Time Field To Create field may not have the same name.')) 
     379                 
     380            if pointTimeField is not None and elapsedField is not None and elapsedField.lower() == pointTimeField.lower(): 
     381                    raise ValueError(_(u'The Time Field To Create field and the Elapsed Time Field To Create field may not have the same name.')) 
    366382 
    367383            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISTable 
Note: See TracChangeset for help on using the changeset viewer.