Esempio n. 1
0
sf = SFread(conn)
dq =DQread(conn)
anno = Annoread(conn)
eq = EQread(conn)
pr = PRread(conn)
ep = EPread(conn)
ei = EIread(conn)
la = LAread(conn)
r = Rread(conn)
cv = CVread(conn)
s = Sread(conn)
#print "Get Geometry Test 1: ",cs.getGeometryTest()
print "Get all equipment: " ,eq.getAllEquipment()
print "Get all dataquality: " ,dq.getAllDataQuality()
print "Get all variable: " ,cs.getAllVariables()
print "Get all People: " ,cs.getAllPersons()#[0].PersonFirstName

print "Get all sites: " , sf.getAllSites()
print "Get all SamplingFEatures: ", cs.getAllSamplingFeatures()
print "Get  SamplingFEatures by code: ",cs.getSamplingFeatureByCode("USU-LBR-Mendon")




#print "GeometryTest2: ",cs.getGeometryTest()




#factory = cs._session_factory.getSession()
#print factory.query(Samplingfeature).all()
Esempio n. 2
0
# create connection to the database
conn = dbconnection.createConnection("mssql", "(local)", "TestODM2", "ODM", "odm")
# conn = dbconnection.createConnection('postgresql', 'castro-server.bluezone.usu.edu', 'ODM2', 'postgres', 'postgres')

# create a connection for each of the schemas. Currently the schemas each of a different
# connection but it will be changed to all the services sharing a connection
core_read = CSread(conn)
core = CoreServices(conn)
result_read = Rread(conn)
sampfeat_read = SFread(conn)


# run some basic sample queries.
vars = core.read.getAllVariables()
print "Get all variable: ", vars
people = core_read.getAllPersons()
print "Get all People: ", people

sfs = core_read.getAllSamplingFeatures()
print "Get all SamplingFeatures: ", sfs
temp = sfs[0]
print temp.SamplingFeatureCode
val = core.read.getSamplingFeatureByCode(temp.SamplingFeatureCode)
sf = core_read.getSamplingFeatureByCode(u"logan_river_outlet")
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
Esempio n. 3
0
#create connection to the database
conn = dbconnection.createConnection('mssql', '(local)', 'TestODM2', 'ODM',
                                     'odm')
#conn = dbconnection.createConnection('postgresql', 'castro-server.bluezone.usu.edu', 'ODM2', 'postgres', 'postgres')

#create a connection for each of the schemas. Currently the schemas each of a different
#connection but it will be changed to all the services sharing a connection
core_read = CSread(conn)
core = CoreServices(conn)
result_read = Rread(conn)
sampfeat_read = SFread(conn)

#run some basic sample queries.
vars = core.read.getAllVariables()
print "Get all variable: ", vars
people = core_read.getAllPersons()
print "Get all People: ", people

sfs = core_read.getAllSamplingFeatures()
print "Get all SamplingFeatures: ", sfs
temp = sfs[0]
print temp.SamplingFeatureCode
val = core.read.getSamplingFeatureByCode(temp.SamplingFeatureCode)
sf = core_read.getSamplingFeatureByCode(u'logan_river_outlet')
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: