Newer
Older
osmCoverage / src / osm / jp / api / OsmnodeNd.java
@hayashi hayashi on 23 Nov 2017 947 bytes DbExistの開発着手
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package osm.jp.api;
  7.  
  8. import org.w3c.dom.NamedNodeMap;
  9. import org.w3c.dom.Node;
  10.  
  11. /**
  12. * OSM.xml の「Area(way)」ノード
  13. * 例)
  14. * <pre>{@code
  15. * <nd ref="1738352013"/>
  16. * <nd ref="1738351984"/>
  17. * <nd ref="1738352019"/>
  18. * <nd ref="1738352024"/>
  19. * }</pre>
  20. *
  21. * @author yuu
  22. */
  23. public class OsmnodeNd {
  24. Node ndnode = null;
  25. String ref = null;
  26. public OsmnodeNd(Node node) {
  27. this.ndnode = node;
  28. NamedNodeMap nodeMap2 = this.ndnode.getAttributes();
  29. for (int j=0; j < nodeMap2.getLength(); j++) {
  30. if (nodeMap2.item(j).getNodeName().equals("ref")) {
  31. ref = nodeMap2.item(j).getNodeValue();
  32. }
  33. }
  34. }
  35. public String getRef() {
  36. return ref;
  37. }
  38.  
  39. }