Ejemplo n.º 1
0
 def test_centroid(self):
     r = session.query(Road).filter(Road.road_name=='Graeme Ave').one()
     l = session.query(Lake).filter(Lake.lake_name=='Lake Blue').one()
     ok_(not session.scalar(functions.wkt(r.road_geom.centroid)))
     eq_(session.scalar(functions.wkt(l.lake_geom.centroid)), 'POINT (-88.921453826951719 43.019149768468026)')
     ok_(session.query(Spot).filter(Spot.spot_location.centroid == WKTSpatialElement('POINT(-88.5945861592357 42.9480095987261)')).first() is None)
     ok_(session.scalar(functions.wkt(functions.centroid('MULTIPOINT ( -1 0, -1 2, -1 3, -1 4, -1 7, 0 1, 0 3, 1 1, 2 0, 6 0, 7 8, 9 8, 10 6 )'))) is None)
Ejemplo n.º 2
0
 def test_centroid(self):
     r = session.query(Road).filter(Road.road_name=='Graeme Ave').one()
     l = session.query(Lake).filter(Lake.lake_name=='Lake Blue').one()
     eq_(session.scalar(functions.wkt(r.road_geom.centroid)), u'POINT(-88.5889975373709 42.941769988935)')
     eq_(session.scalar(functions.wkt(l.lake_geom.centroid)), u'POINT(-88.9214538261088 43.0191497691548)')
     ok_(session.query(Spot).filter(Spot.spot_location.centroid == WKTSpatialElement('POINT(-88.5945861592357 42.9480095987261)')).first() is not None)
     eq_(session.scalar(functions.wkt(functions.centroid('MULTIPOINT ( -1 0, -1 2, -1 3, -1 4, -1 7, 0 1, 0 3, 1 1, 2 0, 6 0, 7 8, 9 8, 10 6 )'))),
         u'POINT(2.30769230769231 3.30769230769231)')
Ejemplo n.º 3
0
 def test_centroid(self):
     r = session.query(Road).filter(Road.road_name=='Graeme Ave').one()
     l = session.query(Lake).filter(Lake.lake_name=='Lake Blue').one()
     eq_(session.scalar(functions.wkt(r.road_geom.centroid)), 'POINT(-88.5889975373709 42.941769988935)')
     eq_(session.scalar(functions.wkt(l.lake_geom.centroid)), 'POINT(-88.9214538261088 43.0191497691548)')
     ok_(session.query(Spot).filter(Spot.spot_location.centroid == WKTSpatialElement('POINT(-88.5945861592357 42.9480095987261)')).first() is not None)
     eq_(session.scalar(functions.wkt(functions.centroid('MULTIPOINT ( -1 0, -1 2, -1 3, -1 4, -1 7, 0 1, 0 3, 1 1, 2 0, 6 0, 7 8, 9 8, 10 6 )'))),
         'POINT(2.30769230769231 3.30769230769231)')
Ejemplo n.º 4
0
 def test_centroid(self):
     r = session.query(Road).filter(Road.road_name=='Graeme Ave').one()
     l = session.query(Lake).filter(Lake.lake_name=='Lake Blue').one()
     # Oracle does not support centroid for LineString
     eq_(session.scalar(functions.wkt(r.road_geom.centroid)), None)
     eq_(session.scalar(functions.wkt(l.lake_geom.centroid)), u'POINT (-88.9213649409212 43.0190392609092)')
     ok_(session.query(Spot).filter(functions.wkt(Spot.spot_location.centroid) == 'POINT (-88.5945861592357 42.9480095987261)').first() is not None)
     eq_(session.scalar(functions.wkt(functions.centroid('MULTIPOINT((-1 0), (-1 2), (-1 3), (-1 4), (-1 7), (0 1), (0 3), (1 1), (2 0), (6 0), (7 8), (9 8), (10 6) )', diminfo_))),
         u'POINT (2.30460703912783 3.31788085910597)')
Ejemplo n.º 5
0
 def test_centroid(self):
     r = session.query(Road).filter(Road.road_name == 'Graeme Ave').one()
     l = session.query(Lake).filter(Lake.lake_name == 'Lake Blue').one()
     ok_(not session.scalar(functions.wkt(r.road_geom.centroid)))
     eq_(session.scalar(functions.wkt(l.lake_geom.centroid)),
         u'POINT (-88.921453826951719 43.019149768468026)')
     ok_(
         session.query(Spot).
         filter(Spot.spot_location.centroid == WKTSpatialElement(
             'POINT(-88.5945861592357 42.9480095987261)')).first() is None)
     ok_(
         session.scalar(
             functions.wkt(
                 functions.centroid(
                     'MULTIPOINT ( -1 0, -1 2, -1 3, -1 4, -1 7, 0 1, 0 3, 1 1, 2 0, 6 0, 7 8, 9 8, 10 6 )'
                 ))) is None)