use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class JTSFunctions method logoBuffer.
public static Geometry logoBuffer(final Geometry g, final double distance) {
final Geometry lines = logoLines(g);
final BufferParameters bufParams = new BufferParameters();
bufParams.setEndCapStyle(LineCap.SQUARE);
return lines.buffer(distance, bufParams);
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class GeometryFactoryExpTest method readGoodCheckCoordinate.
private void readGoodCheckCoordinate(final String wkt, final double x, final double y) throws IOException, ParseException {
final Geometry g = this.geometryFactory.geometry(wkt);
final Point pt = g.getPoint();
assertEquals(pt.getX(), x, 0.0001);
assertEquals(pt.getY(), y, 0.0001);
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class GeometryFactoryWktTest method testReadPolygon.
public void testReadPolygon() throws Exception {
final Geometry geometry = this.geometryFactory.geometry("POLYGON((10 10,10 20,20 20,20 15,10 10))");
final String ewkt = geometry.toEwkt();
assertEquals("POLYGON((10 10,20 15,20 20,10 20,10 10))", ewkt);
assertEquals("POLYGON EMPTY", this.geometryFactory.geometry("POLYGON EMPTY").toEwkt());
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class WKBReaderTest method checkWKBGeometry.
private void checkWKBGeometry(final String wkbHex, final String expectedWKT) throws ParseException {
final WKBReader wkbReader = new WKBReader(this.geometryFactory);
final byte[] wkb = WKBReader.hexToBytes(wkbHex);
final Geometry g2 = wkbReader.read(wkb);
final Geometry expected = this.geometryFactory.geometry(expectedWKT);
final boolean isEqual = expected.equals(2, g2);
assertTrue(isEqual);
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class PredicateShortCircuitTest method doPredicates.
public void doPredicates(final String[] wkt) throws Exception {
final Geometry a = this.geometryFactory.geometry(wkt[0]);
final Geometry b = this.geometryFactory.geometry(wkt[1]);
doPredicates(a, b);
doPredicates(b, a);
}
Aggregations