Exemplo n.º 1
0
print "Get all SamplingFeatures: ", cs.getAllSamplingFeature()
print "Get  SamplingFeatures by code: ",cs.getSamplingFeatureByCode(u'logan_river_outlet')



#shows that you can manipulate geometries within the code
#I can get back a union of two geometries( currently the Same Geometry),
#and convert from a string to Geometry type if it is in WKT

#Code that is being run
#Geom = self._session.query(Samplingfeature).first()
#TestGeom = "POINT (30 10)"
#GeomText = self._session.query(func.ST_Union(Geom.FeatureGeometry,func.ST_GeomFromText(TestGeom)).ST_AsText()).first()


print "\n\n------------GeometryTest--------- \n",
print cs.getGeometryTest()


# you can drill down into the code and get object linked by foreign keys
print "\n\n------------Foreign Key sample--------- \n",
#
result = cs.getAllResult()[0]
print "FeatureAction: ", result.FeatureActionObj
print "Action: ", result.FeatureActionObj.ActionObj
print "Action Attribute: ", result.FeatureActionObj.ActionObj.ActionTypeCV

samplingfeature = cs.getAllSamplingFeature()[0]
#print samplingfeature.

Exemplo n.º 2
0

print "\n\n------------GeometryTest--------- \n",
TestGeom = "POINT (30 10)"
print "Static Test Geometry:", TestGeom
print core_read.getGeometryTest(TestGeom)


geomsf = core_read.getSamplingFeatureByGeometry("POINT(111.781944 41.743333)")
print "Get Sampling Feature by Geometry: ", geomsf


# you can drill down into the code and get object linked by foreign keys
print "\n\n------------Foreign Key sample--------- \n",
#
result = core_read.getAllResult()[0]
print "FeatureAction: ", result.FeatureActionObj
print "Action: ", result.FeatureActionObj.ActionObj
print "Action Attribute: ", result.FeatureActionObj.ActionObj.ActionTypeCV

TSResult = result_read.getTimeSeriesResultsByResultId(result.ResultID)
print "TSResult: ", TSResult
TSValues = result_read.getTimeSeriesValuesByResultId(result.ResultID)
print "Values: ", TSValues
# print dir(result)


from ODM2.LikeODM1.services import SeriesService

#### LIKE ODM1 ####
conn2 = dbconnection.createConnection("mssql", "arroyo.uwrl.usu.edu", "TestODM2", "ODM", "odm")
Exemplo n.º 3
0
#Code that is being run:
#Geom = self._session.query(Samplingfeature).first()
#GeomText = self._session.query(func.ST_Union(Geom.FeatureGeometry,func.ST_GeomFromText(TestGeom)).ST_AsText()).first()

print "\n\n------------GeometryTest--------- \n",
TestGeom = "POINT (30 10)"
print "Static Test Geometry:", TestGeom
print core_read.getGeometryTest(TestGeom)

geomsf = core_read.getSamplingFeatureByGeometry('POINT(111.781944 41.743333)')
print "Get Sampling Feature by Geometry: ", geomsf

# you can drill down into the code and get object linked by foreign keys
print "\n\n------------Foreign Key sample--------- \n",
#
result = core_read.getAllResult()[0]
print "FeatureAction: ", result.FeatureActionObj
print "Action: ", result.FeatureActionObj.ActionObj
print "Action Attribute: ", result.FeatureActionObj.ActionObj.ActionTypeCV

TSResult = result_read.getTimeSeriesResultsByResultId(result.ResultID)
print "TSResult: ", TSResult
TSValues = result_read.getTimeSeriesValuesByResultId(result.ResultID)
print "Values: ", TSValues
#print dir(result)

from ODM2.LikeODM1.services import SeriesService
#### LIKE ODM1 ####
conn2 = dbconnection.createConnection('mssql', 'arroyo.uwrl.usu.edu',
                                      'TestODM2', 'ODM', 'odm')
odm1service = SeriesService(conn2)