@Test public void testGetType() { List<Coordinate[]> geoms = null; try { geoms = eVecS1.getType("Noeud_434505"); assertEquals("Node should have only one coordinate", 1, geoms.get(0).length); geoms = null; geoms = eVecS1.getType("Arc_647020"); assertTrue("Arc should have more than one coordinate", geoms.get(0).length > 1); geoms = null; geoms = eVecS1.getType("Face_647020"); assertTrue("Face should be componed from at least one Arc", geoms.size() > 0 && geoms.get(0).length > 1); } catch (IOException e) { assertFalse(e.getMessage(), true); } }
protected List<Coordinate[]> getType(String id) throws IOException { EdigeoParser parser = new EdigeoParser(vecFile); String buffern1 = ""; String type = ""; List<Coordinate[]> geoms = new LinkedList<Coordinate[]>(); while (parser.readLine()) { if (parser.line.contains(DS + id)) { type = getValue(buffern1, typDesc); if (type.equals(faceDesc)) { geoms = getRelation(id); break; } else if (type.equals(arcDesc)) { geoms.add(getCoordinates(parser, false)); nbarc++; } else if (type.equals(nodeDesc)) { geoms.add(getCoordinates(parser, true)); nbPoint++; } break; } buffern1 = new String(parser.line); } parser.close(); return geoms; }
EdigeoVEC { protected List<Coordinate[]> getType(String id) throws IOException { EdigeoParser parser = new EdigeoParser(vecFile); String buffern1 = ""; String type = ""; List<Coordinate[]> geoms = new LinkedList<Coordinate[]>(); while (parser.readLine()) { if (parser.line.contains(DS + id)) { type = getValue(buffern1, typDesc); if (type.equals(faceDesc)) { geoms = getRelation(id); break; } else if (type.equals(arcDesc)) { geoms.add(getCoordinates(parser, false)); nbarc++; } else if (type.equals(nodeDesc)) { geoms.add(getCoordinates(parser, true)); nbPoint++; } break; } buffern1 = new String(parser.line); } parser.close(); return geoms; } }
EdigeoVEC { protected List<Coordinate[]> getType(String id) throws IOException { EdigeoParser parser = new EdigeoParser(vecFile); String buffern1 = ""; String type = ""; List<Coordinate[]> geoms = new LinkedList<Coordinate[]>(); while (parser.readLine()) { if (parser.line.contains(DS + id)) { type = getValue(buffern1, typDesc); if (type.equals(faceDesc)) { geoms = getRelation(id); break; } else if (type.equals(arcDesc)) { geoms.add(getCoordinates(parser, false)); nbarc++; } else if (type.equals(nodeDesc)) { geoms.add(getCoordinates(parser, true)); nbPoint++; } break; } buffern1 = new String(parser.line); } parser.close(); return geoms; } EdigeoVEC(String path); }
EdigeoVEC { protected List<Coordinate[]> getType(String id) throws IOException { EdigeoParser parser = new EdigeoParser(vecFile); String buffern1 = ""; String type = ""; List<Coordinate[]> geoms = new LinkedList<Coordinate[]>(); while (parser.readLine()) { if (parser.line.contains(DS + id)) { type = getValue(buffern1, typDesc); if (type.equals(faceDesc)) { geoms = getRelation(id); break; } else if (type.equals(arcDesc)) { geoms.add(getCoordinates(parser, false)); nbarc++; } else if (type.equals(nodeDesc)) { geoms.add(getCoordinates(parser, true)); nbPoint++; } break; } buffern1 = new String(parser.line); } parser.close(); return geoms; } EdigeoVEC(String path); void readVECFile(String obj, Visitor visitor); String getValue(String line, String target); }
EdigeoVEC { protected List<Coordinate[]> getType(String id) throws IOException { EdigeoParser parser = new EdigeoParser(vecFile); String buffern1 = ""; String type = ""; List<Coordinate[]> geoms = new LinkedList<Coordinate[]>(); while (parser.readLine()) { if (parser.line.contains(DS + id)) { type = getValue(buffern1, typDesc); if (type.equals(faceDesc)) { geoms = getRelation(id); break; } else if (type.equals(arcDesc)) { geoms.add(getCoordinates(parser, false)); nbarc++; } else if (type.equals(nodeDesc)) { geoms.add(getCoordinates(parser, true)); nbPoint++; } break; } buffern1 = new String(parser.line); } parser.close(); return geoms; } EdigeoVEC(String path); void readVECFile(String obj, Visitor visitor); String getValue(String line, String target);  }