|
21 | 21 |
|
22 | 22 | #connect to database |
23 | 23 | #createconnection (dbtype, servername, dbname, username, password) |
24 | | -#session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm') |
25 | | -#session_factory = dbconnection.createConnection('connection type: sqlite|mysql|mssql|postgresql', '/your/path/to/db/goes/here', 2.0) |
26 | | -# session_factory= dbconnection.createConnection('mssql', "(local)", "LBRODM2", "ODM", "odm") |
27 | | -session_factory= dbconnection.createConnection('mssql', "arroyoodm2", "LBRODM2", "ODM", "odm") |
| 24 | +# session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')#mysql |
| 25 | +#session_factory = dbconnection.createConnection('connection type: sqlite|mysql|mssql|postgresql', '/your/path/to/db/goes/here', 2.0)#sqlite |
| 26 | +# session_factory= dbconnection.createConnection('mssql', "(local)", "LBRODM2", "ODM", "odm")#win MSSQL |
| 27 | +session_factory= dbconnection.createConnection('mssql', "arroyoodm2", "", "ODM", "odm")#mac/linux MSSQL |
28 | 28 |
|
29 | 29 |
|
30 | 30 |
|
|
64 | 64 | numSites = len(siteFeatures) |
65 | 65 |
|
66 | 66 | for x in siteFeatures: |
67 | | - print x.SamplingFeatureCode + ": " + x.SamplingFeatureName |
| 67 | + print x.SamplingFeatureCode + ": " + x.SamplingFeatureName + ", " + x.SamplingFeatureTypeCV |
68 | 68 | except Exception as e: |
69 | 69 | print "Unable to demo getSamplingFeaturesByType", e |
70 | 70 |
|
71 | 71 |
|
72 | 72 | # Now get the SamplingFeature object for a SamplingFeature code |
73 | 73 | try: |
74 | | - sf = read.getSamplingFeatures(code='USU-LBR-Mendon') |
| 74 | + sf = read.getSamplingFeatures(code='USU-LBR-Mendon')[0] |
75 | 75 | print sf |
76 | 76 | print "\n-------- Information about an individual SamplingFeature ---------" |
77 | 77 | print "The following are some of the attributes of a SamplingFeature retrieved using getSamplingFeature(code = x): \n" |
78 | 78 | print "SamplingFeatureCode: " + sf.SamplingFeatureCode |
79 | 79 | print "SamplingFeatureName: " + sf.SamplingFeatureName |
80 | 80 | print "SamplingFeatureDescription: %s" % sf.SamplingFeatureDescription |
81 | 81 | print "SamplingFeatureGeotypeCV: %s" % sf.SamplingFeatureGeotypeCV |
82 | | - print "SamplingFeatureGeometry: %s" % sf.FeatureGeometry |
| 82 | + print "SamplingFeatureGeometry: %s" % sf.FeatureGeometryWKT |
83 | 83 | print "Elevation_m: %s" % str(sf.Elevation_m) |
84 | 84 | except Exception as e: |
85 | 85 | print "Unable to demo getSamplingFeatureByCode: ", e |
|
0 commit comments