Changeset 35404 in osm for applications/editors/josm/plugins/seachart/src/s57
- Timestamp:
- 2020-03-29T23:03:21+02:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src/s57
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/s57/S57att.java
r34906 r35404 115 115 AttStr.put(Att.HORCLR, "clearance_width"); AttStr.put(Att.HORLEN, "length"); AttStr.put(Att.HORWID, "width"); AttStr.put(Att.ICEFAC, "factor"); 116 116 AttStr.put(Att.INFORM, "information"); AttStr.put(Att.JRSDTN, "jurisdiction"); AttStr.put(Att.LIFCAP, "maximum_load"); AttStr.put(Att.LITCHR, "character"); 117 AttStr.put(Att.LITVIS, "visibility"); AttStr.put(Att.MARSYS, "system"); AttStr.put(Att.MLTYLT, "multiple"); AttStr.put(Att.NATION, "nation ality");117 AttStr.put(Att.LITVIS, "visibility"); AttStr.put(Att.MARSYS, "system"); AttStr.put(Att.MLTYLT, "multiple"); AttStr.put(Att.NATION, "nation"); 118 118 AttStr.put(Att.NATCON, "construction"); AttStr.put(Att.NATSUR, "surface"); AttStr.put(Att.NATQUA, "surface_qualification"); AttStr.put(Att.NMDATE, "nm_date"); 119 119 AttStr.put(Att.OBJNAM, "name"); AttStr.put(Att.ORIENT, "orientation"); AttStr.put(Att.PEREND, "period_end"); AttStr.put(Att.PERSTA, "period_start"); -
applications/editors/josm/plugins/seachart/src/s57/S57osm.java
r35392 r35404 59 59 OSMtags.put("landuse=industrial", new KeyVal<>(Obj.BUAARE, Att.UNKATT, null, null)); OSMtags.put("landuse=commercial", new KeyVal<>(Obj.BUAARE, Att.UNKATT, null, null)); 60 60 OSMtags.put("landuse=retail", new KeyVal<>(Obj.BUAARE, Att.UNKATT, null, null)); OSMtags.put("landuse=residential", new KeyVal<>(Obj.BUAARE, Att.UNKATT, null, null)); 61 OSMtags.put("boundary_type=territorial_waters", new KeyVal<>(Obj.TESARE, Att.UNKATT, null, null)); 61 62 } 62 63 … … 98 99 99 100 public static void OSMmap(File in, S57map map, boolean bb) throws Exception { 100 String k = "";101 String v = "";102 103 101 double lat = 0; 104 102 double lon = 0; 105 103 long id = 0; 106 104 long ref = 0; 105 String k = ""; 106 String v = ""; 107 107 String type = ""; 108 108 String role = ""; … … 121 121 System.exit(-1); 122 122 } 123 NodeList nList = doc.getElementsByTagName("bounds"); 124 NamedNodeMap nnmap = nList.item(0).getAttributes(); 125 map.bounds.minlat = Math.toRadians(Double.parseDouble(nnmap.getNamedItem("minlat").getNodeValue())); 126 map.nodes.get(2L).lat = map.bounds.minlat; 127 map.nodes.get(3L).lat = map.bounds.minlat; 128 map.bounds.minlon = Math.toRadians(Double.parseDouble(nnmap.getNamedItem("minlon").getNodeValue())); 129 map.nodes.get(1L).lon = map.bounds.minlon; 130 map.nodes.get(2L).lon = map.bounds.minlon; 131 map.bounds.maxlat = Math.toRadians(Double.parseDouble(nnmap.getNamedItem("maxlat").getNodeValue())); 132 map.nodes.get(1L).lat = map.bounds.maxlat; 133 map.nodes.get(4L).lat = map.bounds.maxlat; 134 map.bounds.maxlon = Math.toRadians(Double.parseDouble(nnmap.getNamedItem("maxlon").getNodeValue())); 135 map.nodes.get(3L).lon = map.bounds.maxlon; 136 map.nodes.get(4L).lon = map.bounds.maxlon; 123 NodeList nList = doc.getElementsByTagName("bounds"); 124 NamedNodeMap nnmap; 125 if (nList.getLength() != 0) { 126 nnmap = nList.item(0).getAttributes(); 127 map.bounds.minlat = Math.toRadians(Double.parseDouble(nnmap.getNamedItem("minlat").getNodeValue())); 128 map.nodes.get(2L).lat = map.bounds.minlat; 129 map.nodes.get(3L).lat = map.bounds.minlat; 130 map.bounds.minlon = Math.toRadians(Double.parseDouble(nnmap.getNamedItem("minlon").getNodeValue())); 131 map.nodes.get(1L).lon = map.bounds.minlon; 132 map.nodes.get(2L).lon = map.bounds.minlon; 133 map.bounds.maxlat = Math.toRadians(Double.parseDouble(nnmap.getNamedItem("maxlat").getNodeValue())); 134 map.nodes.get(1L).lat = map.bounds.maxlat; 135 map.nodes.get(4L).lat = map.bounds.maxlat; 136 map.bounds.maxlon = Math.toRadians(Double.parseDouble(nnmap.getNamedItem("maxlon").getNodeValue())); 137 map.nodes.get(3L).lon = map.bounds.maxlon; 138 map.nodes.get(4L).lon = map.bounds.maxlon; 139 } 137 140 138 141 nList = doc.getElementsByTagName("node"); … … 141 144 Node nNode = nList.item(i); 142 145 if (nNode.getNodeType() == Node.ELEMENT_NODE) { 143 146 nnmap = nNode.getAttributes(); 144 147 id = Long.parseLong(nnmap.getNamedItem("id").getNodeValue()); 145 148 lat = Double.parseDouble(nnmap.getNamedItem("lat").getNodeValue());
Note:
See TracChangeset
for help on using the changeset viewer.