Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. List<LineString> lines = map.getList();
  2. List<LineString> linesPurified = new LinkedList<LineString>() ;
  3.  
  4. for (ListIterator l = lines.listIterator(); l.hasNext();)
  5. {
  6. LineString line_graph = (LineString) l.next();
  7. int aux1=0, aux2=0;
  8.  
  9. for(ListIterator m = (ListIterator) lines.listIterator(); m.hasNext();)
  10. {
  11. LineString compare = (LineString) m.next();
  12.  
  13. for(int i=0;i<compare.getCoordinates().length;i++)
  14. {
  15. if( line_graph.getCoordinates()[0] == compare.getCoordinates()[i] )aux1++;
  16. if( line_graph.getCoordinates()[line_graph.getCoordinates().length-1] == compare.getCoordinates()[i] ) aux2++;
  17.  
  18. }
  19. }
  20.  
  21. if (aux1>1 || aux2>1)linesPurified.add(line_graph);
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement