use of org.teiid.core.types.ClobType in project teiid by teiid.
the class TestGeometry method testForce2d.
@Test
public void testForce2d() throws Exception {
Expression ex = TestFunctionResolving.getExpression("st_astext(st_force_2d(ST_GEOMFROMTEXT('LINESTRING(0 0, 1 3)')))");
assertEquals("LINESTRING (0 0, 1 3)", ClobType.getString((ClobType) Evaluator.evaluate(ex)));
}
use of org.teiid.core.types.ClobType in project teiid by teiid.
the class TestGeometry method testEnvelope.
@Test
public void testEnvelope() throws Exception {
Expression ex = TestFunctionResolving.getExpression("ST_AsText(ST_Envelope(ST_GEOMFROMTEXT('LINESTRING(0 0, 1 3)')))");
ClobType c = (ClobType) Evaluator.evaluate(ex);
assertEquals("POLYGON ((0 0, 0 3, 1 3, 1 0, 0 0))", ClobType.getString(c));
}
use of org.teiid.core.types.ClobType in project teiid by teiid.
the class TestGeometry method testStartPoint.
@Test
public void testStartPoint() throws Exception {
Expression ex = TestFunctionResolving.getExpression("ST_AsText(st_startpoint(ST_GEOMFROMTEXT('LINESTRING(0 0, 1 3)'))))");
assertEquals("POINT (0 0)", ClobType.getString((ClobType) Evaluator.evaluate(ex)));
}
use of org.teiid.core.types.ClobType in project teiid by teiid.
the class TestGeometry method testPointOnSurface.
@Test
public void testPointOnSurface() throws Exception {
Expression ex = TestFunctionResolving.getExpression("ST_AsText(ST_PointOnSurface(ST_GeomFromText('POLYGON ((67 13, 67 18, 59 18, 59 13, 67 13))')));");
ClobType pointOnSurface = (ClobType) Evaluator.evaluate(ex);
assertEquals("POINT (63 15.5)", ClobType.getString(pointOnSurface));
ex = TestFunctionResolving.getExpression("ST_AsText(ST_PointOnSurface(ST_GeomFromText('POLYGON ((50 0, 50 10, 10 10, 10 50, 50 50, 50 60, 0 60, 0 0, 50 0))')));");
pointOnSurface = (ClobType) Evaluator.evaluate(ex);
assertEquals("POINT (5 30)", ClobType.getString(pointOnSurface));
}
use of org.teiid.core.types.ClobType in project teiid by teiid.
the class TestGeometry method testEwktWithSRID.
@Test
public void testEwktWithSRID() throws Exception {
Expression ex = TestFunctionResolving.getExpression("st_asewkt(ST_GeomFromEwkt('SRID=4326;POINT(0 0)')))");
Evaluator.evaluate(ex);
// whitespace
ex = TestFunctionResolving.getExpression("st_asewkt(ST_GeomFromEwkt(' SRID=4326;POINT(0 0)')))");
Evaluator.evaluate(ex);
// mixed case
ex = TestFunctionResolving.getExpression("st_asewkt(ST_GeomFromEwkt('SrID=4326;POINT(0 0)')))");
assertEquals("SRID=4326;POINT (0 0)", ClobType.getString((ClobType) Evaluator.evaluate(ex)));
}
Aggregations