Skip to content

Commit 0c7fb35

Browse files
author
Stephanie Reeder
committed
update code in sample file to work with new query struture
1 parent 595f411 commit 0c7fb35

File tree

3 files changed

+183
-157
lines changed

3 files changed

+183
-157
lines changed

Examples/Sample.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
#createconnection (dbtype, servername, dbname, username, password)
2424
#session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')
2525
#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")
26+
# session_factory= dbconnection.createConnection('mssql', "(local)", "LBRODM2", "ODM", "odm")
27+
session_factory= dbconnection.createConnection('mssql', "arroyoodm2", "LBRODM2", "ODM", "odm")
2728

2829

2930

@@ -70,7 +71,7 @@
7071

7172
# Now get the SamplingFeature object for a SamplingFeature code
7273
try:
73-
sf = read.getSamplingFeatureByCode('USU-LBR-Mendon')
74+
sf = read.getSamplingFeatures(code='USU-LBR-Mendon')
7475
print sf
7576
print "\n-------- Information about an individual SamplingFeature ---------"
7677
print "The following are some of the attributes of a SamplingFeature retrieved using getSamplingFeatureByCode(): \n"

odm2api/ODM2/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ def shape(self):
575575
_FeatureGeometry = self.FeatureGeometry
576576
geomshape = None
577577
if _FeatureGeometry is not None:
578+
print _FeatureGeometry
579+
print _FeatureGeometry.geom_wkb
578580
if is_hex(_FeatureGeometry.geom_wkb):
579581
# to parse wkb hex string directly
580582
geomshape = wkb.loads(_FeatureGeometry.geom_wkb, hex=True)

0 commit comments

Comments
 (0)