Esempio n. 1
0
# The following query shows that you can manipulate geometries within the code
# I can get back a union of two geometries
# and convert from a string to Geometry type if it is in WKT

# 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
Esempio n. 2
0
print "Get  SamplingFeatures by code: ", sf

#The following query shows that you can manipulate geometries within the code
#I can get back a union of two geometries
#and convert from a string to Geometry type if it is in WKT

#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)