@Test public void testPolygon() throws EdmPrimitiveTypeException { ODataWKTWriter writer = new ODataWKTWriter(); GeometryFactory factory = new GeometryFactory(); Polygon polygon = factory .createPolygon( factory.createLinearRing(new Coordinate[] { new Coordinate(0, 0), new Coordinate(3, 0), new Coordinate(3, 3), new Coordinate(0, 3), new Coordinate(0, 0) }), new LinearRing[] { factory.createLinearRing( new Coordinate[] { new Coordinate(1, 1), new Coordinate(2, 1), new Coordinate(2, 2), new Coordinate(1, 2), new Coordinate(1, 1) }) }); assertEquals("Polygon((1.0 1.0,2.0 1.0,2.0 2.0,1.0 2.0,1.0 1.0)," + "(0.0 0.0,3.0 0.0,3.0 3.0,0.0 3.0,0.0 0.0))", writer.write(polygon)); String uriValue = ODataTypeManager.geometryToODataValueString(polygon, true); org.apache.olingo.commons.api.edm.geo.Polygon olingoPolygon = (org.apache.olingo.commons.api.edm.geo.Polygon) EdmGeometryPolygon.getInstance().valueOfString(uriValue, null, null, null, null, null, EdmGeometryPolygon.getInstance().getDefaultType()); assertEquals(0, olingoPolygon.getExterior().iterator().next().getX(), 0); assertEquals(1, olingoPolygon.getInterior(0).iterator().next().getX(), 0); }
public String write(Geometry geometry) { Writer sw = new StringWriter(); try { write(geometry, sw); } catch (IOException ex) { Assert.shouldNeverReachHere(); } return sw.toString(); }
ODataWKTWriter { public String write(Geometry geometry) { Writer sw = new StringWriter(); try { write(geometry, sw); } catch (IOException ex) { Assert.shouldNeverReachHere(); } return sw.toString(); } }
ODataWKTWriter { public String write(Geometry geometry) { Writer sw = new StringWriter(); try { write(geometry, sw); } catch (IOException ex) { Assert.shouldNeverReachHere(); } return sw.toString(); } ODataWKTWriter();  ODataWKTWriter(int outputDimension); }
ODataWKTWriter { public String write(Geometry geometry) { Writer sw = new StringWriter(); try { write(geometry, sw); } catch (IOException ex) { Assert.shouldNeverReachHere(); } return sw.toString(); } ODataWKTWriter();  ODataWKTWriter(int outputDimension); String write(Geometry geometry); void write(Geometry geometry, Writer writer); }
ODataWKTWriter { public String write(Geometry geometry) { Writer sw = new StringWriter(); try { write(geometry, sw); } catch (IOException ex) { Assert.shouldNeverReachHere(); } return sw.toString(); } ODataWKTWriter();  ODataWKTWriter(int outputDimension); String write(Geometry geometry); void write(Geometry geometry, Writer writer);  }