Exemplo n.º 1
0
# Now get the SamplingFeature object for a SamplingFeature code
sf = core_read.getSamplingFeatureByCode('USU-LBR-Mendon')
print "\n-------- Information about an individual SamplingFeature ---------"
print(
    "The following are some of the attributes of a SamplingFeature retrieved using getSamplingFeatureByCode(): \n"
    + "SamplingFeatureCode: " + sf.SamplingFeatureCode + "\n" +
    "SamplingFeatureName: " + sf.SamplingFeatureName + "\n" +
    "SamplingFeatureDescription: " + sf.SamplingFeatureDescription + "\n" +
    "SamplingFeatureGeotypeCV: " + sf.SamplingFeatureGeotypeCV + "\n"
    "SamplingFeatureGeometry: " + sf.FeatureGeometry + "\n" + "Elevation_m: " +
    str(sf.Elevation_m))

# Drill down and get objects linked by foreign keys
print "\n------------ Foreign Key Example --------- \n",
# Call getResults, but return only the first result
firstResult = core_read.getResults()[0]
print "The FeatureAction object for the Result is: ", firstResult.FeatureActionObj
print "The Action object for the Result is: ", firstResult.FeatureActionObj.ActionObj
print(
    "\nThe following are some of the attributes for the Action that created the Result: \n"
    + "ActionTypeCV: " + firstResult.FeatureActionObj.ActionObj.ActionTypeCV +
    "\n" + "ActionDescription: " +
    firstResult.FeatureActionObj.ActionObj.ActionDescription + "\n" +
    "BeginDateTime: " +
    str(firstResult.FeatureActionObj.ActionObj.BeginDateTime) + "\n" +
    "EndDateTime: " + str(firstResult.FeatureActionObj.ActionObj.EndDateTime) +
    "\n" + "MethodName: " +
    firstResult.FeatureActionObj.ActionObj.MethodObj.MethodName + "\n" +
    "MethodDescription: " +
    firstResult.FeatureActionObj.ActionObj.MethodObj.MethodDescription)
Exemplo n.º 2
0
# Now get the SamplingFeature object for a SamplingFeature code
sf = core_read.getSamplingFeatureByCode('USU-LBR-Mendon')
print "\n-------- Information about an individual SamplingFeature ---------"
print ("The following are some of the attributes of a SamplingFeature retrieved using getSamplingFeatureByCode(): \n" +
       "SamplingFeatureCode: " + sf.SamplingFeatureCode + "\n" +
       "SamplingFeatureName: " + sf.SamplingFeatureName + "\n" +
       "SamplingFeatureDescription: " + sf.SamplingFeatureDescription + "\n" +
       "SamplingFeatureGeotypeCV: " + sf.SamplingFeatureGeotypeCV + "\n"
       "SamplingFeatureGeometry: " + sf.FeatureGeometry + "\n" +
       "Elevation_m: " + str(sf.Elevation_m))


# Drill down and get objects linked by foreign keys
print "\n------------ Foreign Key Example --------- \n",
# Call getResults, but return only the first result
firstResult = core_read.getResults()[0]
print "The FeatureAction object for the Result is: ", firstResult.FeatureActionObj
print "The Action object for the Result is: ", firstResult.FeatureActionObj.ActionObj
print ("\nThe following are some of the attributes for the Action that created the Result: \n" +
       "ActionTypeCV: " + firstResult.FeatureActionObj.ActionObj.ActionTypeCV + "\n" +
       "ActionDescription: " + firstResult.FeatureActionObj.ActionObj.ActionDescription + "\n" +
       "BeginDateTime: " + str(firstResult.FeatureActionObj.ActionObj.BeginDateTime) + "\n" +
       "EndDateTime: " + str(firstResult.FeatureActionObj.ActionObj.EndDateTime) + "\n" +
       "MethodName: " + firstResult.FeatureActionObj.ActionObj.MethodObj.MethodName + "\n" +
       "MethodDescription: " + firstResult.FeatureActionObj.ActionObj.MethodObj.MethodDescription)


# Now get a particular Result using a ResultID
print "\n------- Example of Retrieving Attributes of a Time Series Result -------"
tsResult = result_read.getTimeSeriesResultByResultId(19)
print ("The following are some of the attributes for the TimeSeriesResult retrieved using getTimeSeriesResultByResultID(): \n" +