Changeset 30334 in osm for applications/editors/josm/plugins
- Timestamp:
- 2014-03-20T21:59:08+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/pointInfo
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pointInfo/build.xml
r30331 r30334 15 15 16 16 <!-- enter the SVN commit message --> 17 <property name="commit.message" value="PointInfo: Initial version"/>17 <property name="commit.message" value="PointInfo: Fix format of start_date key"/> 18 18 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 19 19 <property name="plugin.main.version" value="6238"/> … … 27 27 <property name="plugin.author" value="Marian Kyral"/> 28 28 <property name="plugin.class" value="org.openstreetmap.josm.plugins.pointinfo.PointInfoPlugin"/> 29 <property name="plugin.description" value="Shows an additional information about point on map. Currently only Czech Ruian module available."/>29 <property name="plugin.description" value="Shows an additional information about point on map. There is only a Czech RUIAN module available at this moment."/> 30 30 <property name="plugin.icon" value="images/mapmode/info-sml.png"/> 31 31 <property name="plugin.link" value="https://github.com/mkyral/josm-pointInfo"/> -
applications/editors/josm/plugins/pointInfo/servers/RUIAN/index.php
r30328 r30334 15 15 $query=" 16 16 select s.kod, 17 s.pocet_podlazi, a.nazev , s.plati_od, s.pocet_bytu, s.dokonceni,18 a.osmtag_k, a.osmtag_v17 s.pocet_podlazi, a.nazev zpusob_vyuziti, s.plati_od, s.pocet_bytu, s.dokonceni, 18 s.zpusob_vyuziti_kod, a.osmtag_k, a.osmtag_v 19 19 from rn_stavebni_objekt s 20 20 left outer join osmtables.zpusob_vyuziti_objektu a on s.zpusob_vyuziti_kod = a.kod … … 33 33 array( "ruian_id" => $row["kod"], 34 34 "pocet_podlazi" => $row["pocet_podlazi"], 35 "zpusob_vyuziti" => $row["nazev"], 35 "zpusob_vyuziti" => $row["zpusob_vyuziti"], 36 "zpusob_vyuziti_kod" => $row["zpusob_vyuziti_kod"], 36 37 "zpusob_vyuziti_key" => $row["osmtag_k"], 37 38 "zpusob_vyuziti_val" => $row["osmtag_v"], -
applications/editors/josm/plugins/pointInfo/src/org/openstreetmap/josm/plugins/pointinfo/PointInfoAction.java
r30328 r30334 74 74 @Override 75 75 public void enterMode() { 76 System.out.println("enterMode() - start");77 76 if (!isEnabled()) { 78 77 return; … … 81 80 Main.map.mapView.setCursor(getCursor()); 82 81 Main.map.mapView.addMouseListener(this); 83 System.out.println("enterMode() - end");84 82 85 83 } … … 87 85 @Override 88 86 public void exitMode() { 89 System.out.println("exitMode() - start");90 87 super.exitMode(); 91 88 Main.map.mapView.removeMouseListener(this); 92 System.out.println("exitMode() - end");93 89 } 94 90 -
applications/editors/josm/plugins/pointInfo/src/org/openstreetmap/josm/plugins/pointinfo/ruianModule.java
r30328 r30334 201 201 private int m_objekt_byty; 202 202 private String m_objekt_zpusob_vyuziti; 203 private String m_objekt_zpusob_vyuziti_kod; 203 204 private String m_objekt_zpusob_vyuziti_key; 204 205 private String m_objekt_zpusob_vyuziti_val; … … 245 246 m_objekt_byty = 0; 246 247 m_objekt_zpusob_vyuziti = ""; 248 m_objekt_zpusob_vyuziti_kod = ""; 247 249 m_objekt_zpusob_vyuziti_key = ""; 248 250 m_objekt_zpusob_vyuziti_val = ""; … … 317 319 try { 318 320 m_objekt_zpusob_vyuziti = stavebniObjekt.getString("zpusob_vyuziti"); 321 } catch (Exception e) { 322 } 323 324 try { 325 m_objekt_zpusob_vyuziti_kod = stavebniObjekt.getString("zpusob_vyuziti_kod"); 319 326 } catch (Exception e) { 320 327 } … … 523 530 r.append("<br/>"); 524 531 if (m_objekt_ruian_id > 0) { 525 r.append("<i><u>Informace o objektu</u></i>");532 r.append("<i><u>Informace o budově</u></i>"); 526 533 r.append(" <a href=file://tags.copy/building><img src="+getClass().getResource("/images/dialogs/copy-tags.png")+" border=0 alt=\"Vložit tagy do schránky\" ></a><br/>"); 527 534 r.append("<b>RUIAN id: </b><a href=http://vdp.cuzk.cz/vdp/ruian/stavebniobjekty/" + m_objekt_ruian_id +">" + m_objekt_ruian_id + "</a><br/>"); … … 678 685 679 686 /** 687 * Convert date from Czech to OSM format 688 * @param ruianDate Date in RUIAN (Czech) format DD.MM.YYYY 689 * @return String with date converted to OSM data format YYYY-MM-DD 690 */ 691 String convertDate (String ruianDate) { 692 String r = new String(); 693 String[] parts = ruianDate.split("\\."); 694 try { 695 int day = Integer.parseInt(parts[0]); 696 int month = Integer.parseInt(parts[1]); 697 int year = Integer.parseInt(parts[2]); 698 r = new Integer(year).toString() + "-" + String.format("%02d", month) + "-" + String.format("%02d", day); 699 } catch (Exception e) { 700 } 701 702 return r; 703 } 704 705 /** 680 706 * Construct tag string for clipboard 681 707 * @param k OSM Key … … 710 736 c.append(tagToString("building:flats", Integer.toString(m_objekt_byty))); 711 737 } 712 if (m_objekt_dokonceni.length() > 0) { 713 c.append(tagToString("start_date", m_objekt_dokonceni)); 738 if (m_objekt_dokonceni.length() > 0 && convertDate(m_objekt_dokonceni).length() > 0) { 739 c.append(tagToString("start_date", convertDate(m_objekt_dokonceni))); 740 } 741 if (m_objekt_zpusob_vyuziti_kod.length() > 0) { 742 c.append(tagToString("building:ruian:type", m_objekt_zpusob_vyuziti_kod)); 714 743 } 715 744 c.append(tagToString("source", "cuzk:ruian"));
Note:
See TracChangeset
for help on using the changeset viewer.