@Test public void testEncodeZM() throws Exception { GeometryFactory gf = new GeometryFactory(); Point pointM = gf.createPoint(new CoordinateXYZM(1, 1, 2, 4)); CoordinateSequence seq = pointM.getCoordinateSequence(); Document doc = encode(seq, GML.pos); checkPosOrdinates(doc, 4); }
public Element encode(Object object, Document document, Element value) throws Exception { CoordinateSequence cs = (CoordinateSequence) object; boolean hasm = cs.hasM(); StringBuffer sb = new StringBuffer(); if (cs.size() >= 1) { int dim = cs.getDimension(); for (int d = 0; d < dim; d++) { double v = cs.getOrdinate(0, d); if (hasm && dim == 3 && d == 2) { formatAndAppend(sb, 0); } if (Double.isNaN(v) && d > 1) { continue; } formatAndAppend(sb, v); } if (dim > 0) { sb.setLength(sb.length() - 1); } } value.appendChild(document.createTextNode(sb.toString())); return value; }
DirectPositionTypeBinding extends AbstractComplexBinding { public Element encode(Object object, Document document, Element value) throws Exception { CoordinateSequence cs = (CoordinateSequence) object; boolean hasm = cs.hasM(); StringBuffer sb = new StringBuffer(); if (cs.size() >= 1) { int dim = cs.getDimension(); for (int d = 0; d < dim; d++) { double v = cs.getOrdinate(0, d); if (hasm && dim == 3 && d == 2) { formatAndAppend(sb, 0); } if (Double.isNaN(v) && d > 1) { continue; } formatAndAppend(sb, v); } if (dim > 0) { sb.setLength(sb.length() - 1); } } value.appendChild(document.createTextNode(sb.toString())); return value; } }
DirectPositionTypeBinding extends AbstractComplexBinding { public Element encode(Object object, Document document, Element value) throws Exception { CoordinateSequence cs = (CoordinateSequence) object; boolean hasm = cs.hasM(); StringBuffer sb = new StringBuffer(); if (cs.size() >= 1) { int dim = cs.getDimension(); for (int d = 0; d < dim; d++) { double v = cs.getOrdinate(0, d); if (hasm && dim == 3 && d == 2) { formatAndAppend(sb, 0); } if (Double.isNaN(v) && d > 1) { continue; } formatAndAppend(sb, v); } if (dim > 0) { sb.setLength(sb.length() - 1); } } value.appendChild(document.createTextNode(sb.toString())); return value; } DirectPositionTypeBinding(GeometryFactory factory);  DirectPositionTypeBinding(GeometryFactory factory, CoordinateFormatter formatter); }
DirectPositionTypeBinding extends AbstractComplexBinding { public Element encode(Object object, Document document, Element value) throws Exception { CoordinateSequence cs = (CoordinateSequence) object; boolean hasm = cs.hasM(); StringBuffer sb = new StringBuffer(); if (cs.size() >= 1) { int dim = cs.getDimension(); for (int d = 0; d < dim; d++) { double v = cs.getOrdinate(0, d); if (hasm && dim == 3 && d == 2) { formatAndAppend(sb, 0); } if (Double.isNaN(v) && d > 1) { continue; } formatAndAppend(sb, v); } if (dim > 0) { sb.setLength(sb.length() - 1); } } value.appendChild(document.createTextNode(sb.toString())); return value; } DirectPositionTypeBinding(GeometryFactory factory);  DirectPositionTypeBinding(GeometryFactory factory, CoordinateFormatter formatter); QName getTarget(); int getExecutionMode(); Class getType(); Object parse(ElementInstance instance, Node node, Object value); Element encode(Object object, Document document, Element value); }
DirectPositionTypeBinding extends AbstractComplexBinding { public Element encode(Object object, Document document, Element value) throws Exception { CoordinateSequence cs = (CoordinateSequence) object; boolean hasm = cs.hasM(); StringBuffer sb = new StringBuffer(); if (cs.size() >= 1) { int dim = cs.getDimension(); for (int d = 0; d < dim; d++) { double v = cs.getOrdinate(0, d); if (hasm && dim == 3 && d == 2) { formatAndAppend(sb, 0); } if (Double.isNaN(v) && d > 1) { continue; } formatAndAppend(sb, v); } if (dim > 0) { sb.setLength(sb.length() - 1); } } value.appendChild(document.createTextNode(sb.toString())); return value; } DirectPositionTypeBinding(GeometryFactory factory);  DirectPositionTypeBinding(GeometryFactory factory, CoordinateFormatter formatter); QName getTarget(); int getExecutionMode(); Class getType(); Object parse(ElementInstance instance, Node node, Object value); Element encode(Object object, Document document, Element value);  }