Changeset 32358 in osm for applications/editors/josm/plugins/OSMRecPlugin/src/org
- Timestamp:
- 2016-06-22T01:44:57+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/OSMRecPlugin/src/org/openstreetmap/josm/plugins/container/OSMWay.java
r31106 r32358 1 1 package org.openstreetmap.josm.plugins.container; 2 2 3 import com.vividsolutions.jts.geom.Coordinate;4 import com.vividsolutions.jts.geom.Geometry;5 import de.bwaldvogel.liblinear.FeatureNode;6 3 import java.io.Serializable; 7 4 import java.util.ArrayList; … … 12 9 import java.util.TreeMap; 13 10 11 import com.vividsolutions.jts.geom.Coordinate; 12 import com.vividsolutions.jts.geom.Geometry; 13 14 import de.bwaldvogel.liblinear.FeatureNode; 15 14 16 /** 15 17 * Class containing information about the OSM ways. 16 * 18 * 17 19 * @author imis-nkarag 18 20 */ 21 public class OSMWay implements Serializable{ 19 22 20 public class OSMWay implements Serializable{ 21 22 private String id; 23 private String id; 23 24 private String user; 24 25 private int classID; 25 private Set<Integer> classIDs; 26 private Set<Integer> classIDs; 26 27 private final List<String> nodeReferences = new ArrayList<>(); //node references //made final 27 28 private final List<Geometry> nodeGeometries = new ArrayList<>(); //nodeGeometries //made final 28 private Coordinate[] coordinateList; 29 private Map<String, String> tags = new HashMap<>(); 29 private Coordinate[] coordinateList; 30 private Map<String, String> tags = new HashMap<>(); 30 31 private Geometry geometry; 31 private TreeMap<Integer,Double> indexVector = new TreeMap<>(); 32 private TreeMap<Integer,Double> indexVector = new TreeMap<>(); 32 33 private ArrayList<FeatureNode> featureNodeList = new ArrayList<>(); 33 //private Map<String, String> tags; 34 35 //way attributes getters 34 //private Map<String, String> tags; 35 36 //way attributes getters 36 37 public String getID(){ 37 38 return id; 38 } 39 39 } 40 40 41 public String getUser(){ 41 42 return user; 42 43 } 43 44 44 45 public List<Geometry> getNodeGeometries(){ 45 46 return nodeGeometries; 46 47 } 47 48 public Coordinate[] getCoordinateList(){ 49 coordinateList = (Coordinate[]) nodeGeometries.toArray();48 49 public Coordinate[] getCoordinateList(){ 50 coordinateList = nodeGeometries.toArray(new Coordinate[0]); 50 51 return coordinateList; 51 52 } 52 53 53 54 public Geometry getGeometry(){ 54 55 return geometry; 55 } 56 56 } 57 57 58 public List<String> getNodeReferences(){ 58 59 return nodeReferences; 59 60 } 60 61 61 62 public int getNumberOfNodes(){ 62 63 return nodeReferences.size(); 63 64 } 64 65 65 66 public Map<String, String> getTagKeyValue(){ 66 67 return tags; 67 68 } 68 69 69 70 public int getClassID(){ 70 71 return classID; 71 72 } 72 73 73 74 public Set<Integer> getClassIDs(){ 74 75 return classIDs; 75 76 } 76 77 77 78 public TreeMap<Integer, Double> getIndexVector(){ 78 79 return indexVector; 79 80 } 80 81 81 82 public void setIndexVector(TreeMap<Integer, Double> indexVector){ 82 83 this.indexVector = indexVector; 83 84 } 84 85 85 86 //way attributes setters 86 87 public void setID(String id){ 87 88 this.id = id; 88 89 } 89 90 90 91 public void setUser(String user){ 91 92 this.user = user; 92 93 } 93 94 94 95 public void setTagKeyValue(String tagKey, String tagValue){ 95 96 this.tags.put(tagKey, tagValue); 96 97 } 97 98 98 99 public void addNodeReference(String nodeReference){ 99 100 nodeReferences.add(nodeReference); 100 101 } 101 102 102 103 public void addNodeGeometry(Geometry geometry){ 103 104 nodeGeometries.add(geometry); 104 105 } 105 106 public void setGeometry(Geometry geometry){ 106 107 public void setGeometry(Geometry geometry){ 107 108 this.geometry = geometry; 108 } 109 109 } 110 110 111 public void setClassID(int classID){ 111 112 this.classID = classID; … … 114 115 public void setClassIDs(Set<Integer> classIDs){ 115 116 this.classIDs = classIDs; 116 } 117 117 } 118 118 119 public void setFeature(FeatureNode featureNode){ 119 120 this.featureNodeList.add(featureNode); 120 121 } 121 122 122 123 public List<FeatureNode> getFeatureNodeList(){ 123 124 return featureNodeList; 124 125 } 125 126 126 127 public void setAllTags(Map<String, String> selectedTags){ 127 128 tags.putAll(selectedTags);
Note:
See TracChangeset
for help on using the changeset viewer.