From 9cb3633dc808b8cbdda7ff6cdbeb32f4d32c53da Mon Sep 17 00:00:00 2001 From: Dmitriy Prodchenko Date: Fri, 10 Feb 2017 16:49:19 +0200 Subject: [PATCH 1/2] Altitude icons for new GPX activity. --- .../drawable-hdpi/ic_action_altitude_ascent.png | Bin 0 -> 1168 bytes .../drawable-hdpi/ic_action_altitude_average.png | Bin 0 -> 1267 bytes .../drawable-hdpi/ic_action_altitude_descent.png | Bin 0 -> 1169 bytes .../drawable-mdpi/ic_action_altitude_ascent.png | Bin 0 -> 1124 bytes .../drawable-mdpi/ic_action_altitude_average.png | Bin 0 -> 1188 bytes .../drawable-mdpi/ic_action_altitude_descent.png | Bin 0 -> 1121 bytes .../drawable-xhdpi/ic_action_altitude_ascent.png | Bin 0 -> 1210 bytes .../ic_action_altitude_average.png | Bin 0 -> 1358 bytes .../ic_action_altitude_descent.png | Bin 0 -> 1224 bytes .../ic_action_altitude_ascent.png | Bin 0 -> 1293 bytes .../ic_action_altitude_average.png | Bin 0 -> 1504 bytes .../ic_action_altitude_descent.png | Bin 0 -> 1286 bytes 12 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 OsmAnd/res/drawable-hdpi/ic_action_altitude_ascent.png create mode 100644 OsmAnd/res/drawable-hdpi/ic_action_altitude_average.png create mode 100644 OsmAnd/res/drawable-hdpi/ic_action_altitude_descent.png create mode 100644 OsmAnd/res/drawable-mdpi/ic_action_altitude_ascent.png create mode 100644 OsmAnd/res/drawable-mdpi/ic_action_altitude_average.png create mode 100644 OsmAnd/res/drawable-mdpi/ic_action_altitude_descent.png create mode 100644 OsmAnd/res/drawable-xhdpi/ic_action_altitude_ascent.png create mode 100644 OsmAnd/res/drawable-xhdpi/ic_action_altitude_average.png create mode 100644 OsmAnd/res/drawable-xhdpi/ic_action_altitude_descent.png create mode 100644 OsmAnd/res/drawable-xxhdpi/ic_action_altitude_ascent.png create mode 100644 OsmAnd/res/drawable-xxhdpi/ic_action_altitude_average.png create mode 100644 OsmAnd/res/drawable-xxhdpi/ic_action_altitude_descent.png diff --git a/OsmAnd/res/drawable-hdpi/ic_action_altitude_ascent.png b/OsmAnd/res/drawable-hdpi/ic_action_altitude_ascent.png new file mode 100644 index 0000000000000000000000000000000000000000..aa69b56e2335ef1c85b7e3fe613826193eedbe6d GIT binary patch literal 1168 zcmaJ>PiP!f7$1y=vbJcUluZxvm$vWf^eXI(rfZ{GJp1s^Y<^pwQGEtV6_EymbO_Jr9`L%)F+@Gp+(Xp zC|G;rHklHHvCCm=fh{y;&S87r<1{mnICFbtaoeuT_qkXW!L|xpE{nsU z78>)QN>c(%$%0tbHBfRS)pRu5cphkqYRQTrs}59km*0j0b}o^7OM|xC^k#N^@l#n` zVk~iGx!dhZU0tH-BF8$8tZ1^PL9PL_wV0tEjI*O73m(aE8YV2HF~}_D-nrV-7Aayixh-`YnVac`<4YY%QB#&7!GutK!X-hiHUuKwEbXY zXD@u!(X5JY*J>rbqN+8^p7GS_=~Bh0&M5Y@W{j})IAbWrWaK;KzIU+RBe8BZC5X|q zMQLZ$1@lXk(QJt(pjyqVZb~LN)<8InbMbR|sfL+*Bn?+dFq6^pkbRnv@MN5tecKu*+j!7&cP5LJjCI!SGk1el8i!fEsQK|=n6!(uRxX42>muT zA#NKs(rsHeR3yqgL^*GthuUc*;ys#gcZY)?cE^jve5O)9JO|r;#0PJq?p0d7pYQ#2 zx^NThfBc76`_cIazh3{d@b}fN2^d^hm7W>gu|;?F+qKT&v57yZ XefPBwe=q)<|0C+PIq%cy3xodvoZfoi literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-hdpi/ic_action_altitude_average.png b/OsmAnd/res/drawable-hdpi/ic_action_altitude_average.png new file mode 100644 index 0000000000000000000000000000000000000000..28ef08d495bbe02ed0493c434949418bb40141c0 GIT binary patch literal 1267 zcmaJ>TWs4@81|?@^b(*H1}y_zZ&VD;*VvBjHEZKISprQdX(TGO67%IGHI41eb{e;U z1gsAO#>fS>xbIgalC0HgL@i1H^ZErnMFlA(*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+kPxv&vUonltR9`c12D_o#~l@ljE#LV z4OmgooEzi$kVLfMIy}1({J^(0-S<7uFrZ=>8nh(Mf|lhg&>%9=v8R!a=MU^`gm)#w zm9@H6FRK+jroYDLv`K?nPr2nSIiK2VgZAGu4?;3DzI(l`XGxweB1c<88X8onjLvWYCH znYsr}Lm?2Wx}_N=QE-{%ppW-I$YH-%nS{lX3@F(KMh4bY2_n;zpv=+;y$;qP?r0`b zO;gom#EXogShUXv?KBXv9xb-(!@&;g<3%DiQz;vs@uYf<4PM%CEA9Nz%lm(gTmqlE zr(P`m`{K-J1{s^ zOwc!+G%RKlu0?Y1hN4r(dmX ao#uX@s=T^#{l=DJ?i=-S_vh;L<^KUcuxZf% literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-mdpi/ic_action_altitude_average.png b/OsmAnd/res/drawable-mdpi/ic_action_altitude_average.png new file mode 100644 index 0000000000000000000000000000000000000000..597e0662c340a329ea6fad4e6bfafd497f7c4b59 GIT binary patch literal 1188 zcmaJ>U1%It6rLJ4F5Om;)zE&egA2;JGFC ztlAJ7QI&MPlbbO)vpL_wn=9CG+46H>rf*UMK1mVi`>R1>_Dk%JU6bxJG0%b>m2{=V z4ufhp7C<$O2~ar=Vo{br(cnbYkaT4lNP?*Gg2Iai6lIg%iU4*mmU@fbj@h(pyT0hD z#CFp(GI_q&>v27q3*%*qH4I*mcu9g(111|miuy1}rbZTQlHk~jQZEcZW)V5zdRk&> zq{9^asL|Ln93;C$QOfu}ig=L|c;C%eYKO;Mnw1~Ny7CQ(|UBKMqtX_ zgB@jxG#c}C?9rm2RXfD%J_*vgU1I4M&h=bVQC-(@G!06cra(hb3}_gx1T`WO6*~&) zIPS>Ke)y^(X_jnAb4A$_#W_u{*j*n5e%wK(*_4%eo)PaG;L z>Y8f^u&5&gD!S@GU6TmJvT7)rP9$8U91QX9eH;#Zl}czX(I_NS!$`x5EI_0?0u(8Y z(CJ_m;*O#tS=VJnL@ZB3HEP8g=5S^hnQ!$KVG}UOdiet8}+$)`;*Gj;6Jz$exU#W literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-mdpi/ic_action_altitude_descent.png b/OsmAnd/res/drawable-mdpi/ic_action_altitude_descent.png new file mode 100644 index 0000000000000000000000000000000000000000..a2221d0779ea01f304014dc70a8fd204cb493e9c GIT binary patch literal 1121 zcmaJ=O>ERg6gGvH)k^%RNc^1!Bcv8F{vCU5lMQUvyRZ@)!m<)MG9J$+R$`B_XW31T zhy$%a6%`U!)LW|x+FKb;5EbgB2M&z0*}x&fvOP0z-uK@3{=S=; zKC`QQxGYK1uGU$w;@Xouo(>Bk4x z&Ms&4;_`HtEH4l@luu29iJ>P9#FS$&j2DyK8&>6YyPnt=VpRs~Dtw_Tk4Vk7XF#20 z6j+K4iEbL8;wrl38V))E3{AIH4XL^db<-0s(!j#CZe8U_>^FkebI9>OF)I=0}`oMchTBbI=|A`V!eS7pI;6hfS~+na`y zd?QgJW$F;8s;+2i92aq|Yv;T}KhoGzJMS)~RPE55^)n*s(K|W@i`;$QQK2ZCapfR?Uk)aymnEyV)gv@wa2Li}w}s!`-V&7!L`Y-TJ5>$&!#EqGYC;@F|9!HR=jh#V_` zj%`p#Ov^>KLk&_9IT+!?PjWcwRUr|vq+?2+O|VUnsX^=n8q`G^VbCKMBt7I{({W6s zV_6jx)uMeqX{WJB^k}i&91d~V950%PnaafQ9Qf(4yJGNI%dd5ZFW&t9dwEqW?fCP> z9ya;%>&G+Scb`3U1%It6rN2(jln`{p<ANOO4t)Gk3GoWPY5P zbSJCGQj{1FjBg_1gTDAuTM)6e#UHE^EmRPFP_ZDz7ZGKp;txf=lg-9Hgbp)v?>%$A z^Yfi^W_5OEa@X*_VTz)5m8XmId2XR00I!|j=x)n2ePn?Cpu7)x|wz{N2FiM!}UdXl3z?CNBnidhw)g4pprkXl5hzZBgy$413WgQG_x!K>^D%9P7GiUK`p`T*d!~v8{GgTMjT=#gV@hTBIJ0(LR`P zcXLOnB8f(SICMx+(4yg6OD^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 diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_altitude_ascent.png b/OsmAnd/res/drawable-xxhdpi/ic_action_altitude_ascent.png new file mode 100644 index 0000000000000000000000000000000000000000..79d70dc07f7b3e09fc080e9a90a8ea4b0907416c GIT binary patch literal 1293 zcmaJ>ZD<>19KW_{ZAv=Eu!XJ;j_a)5^m6Z)yIayNZ(ZZenWUL^6NZ<&C(YU3OE1?Y ztzSw(nI8-xU!ANB!78#Z1HTM>S)E}Y91bSV4Pod92P#u03WJKzB~9Ijvg7V~p8Mbb z_y7O?Z}(0{K0Y|Ge*i&{!PImj2lr|3>FcsjwVVM8>6gpXEjMV$vOS^#sp8NnW0`5Z%a zErPwurOC7%2PJ)a#Q`%ba$a4TS49mwI*Ep>5;R}{S3#@Bf?1ZT5v*lbf@e=mU}#Il zosVE`QnTp{8n+yPazP$fDTYQvVvyoQT3}y5X_Ddzk|ih+rx*#|EQxMk81&|7MJbn< z+V%zCB3Q|FZHXW%l}fO}1TAL{VnvZ4X@aJ4sDYQ4O;@SnW_he*Apy#&quZ`-nW$$` zDOgKx1cOZ5AsBW#y<^xcZzl?-jHoI$K?O;|Fub^0+GRHf{-?34b~(Rn10n~?){>*b zdKAYxV3@lnJMt7E8|h_7hec5q5|+AT0Mkt+A{hJ<)O1Z^IZZ1Rcpj&Dp2bCy6>(A2 zXq*QW;M4*OiUqA>XE%IIWCW6Cqsb5xrKlt?OeLsTEEHwqQ=|~1*$y^kmR-eELC3ca zeQ#sMCt{_z0~FVC@|LyG>4Hqja;ZT_?*~4S)ffh zmVvf%E$O@P;FOTSYa)q<1VzMIfh*twPXk5y2kyjyuBvUv|a|m~f^X zI6N2Ly8kbNbd9DG(R}sJZ+A}(Y?6WG&2jhp1M8cg{rKpL@5O!B9~}B;EoAS#{pgQd zr;prp7$4H*+k33Fc>C7ftvByn6~me4G8y#?->sf)e&l<4ZKii3@L_jmqIM)B)R@db z?fK09+F0grZS-4wwCUgYIehAsYxXm%Z~wH>GuX`bHNMF9HonaI8dtMDjm>O#a4V(5JT zdhOxl&>MZvJ+*Q0#+hSa@o(htyO)PH!Z(K3)ML`p;i~*n01;4?g|o;hye( sw7Ud;x&PX#-#hlBt4M3Pcww?TfDE7GZ;yZcKJNXXQb{>+Dfar>e@q0V0ssI2 literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_altitude_average.png b/OsmAnd/res/drawable-xxhdpi/ic_action_altitude_average.png new file mode 100644 index 0000000000000000000000000000000000000000..7b67c20f31631c3b4bdb63f5395b54708e5cf864 GIT binary patch literal 1504 zcmaJ>eN5D57%#FZVKSJ1%xN~#oJ$l&uh;9xwUra$4vvc+5I*Dv$wsez@93b{vsd6C zE;Blnk+>y(WxDBH*s?g}OXdb6VBBPm$R=TP5uI!qQKvx-nQ>!GvbUVaTw-jV_I=;y zeSXjP)3=HWTuF&56A=VSa_2jX;hJx}35(&k>{gEpE-Un0uU?}1^#(x$NVcT<0P0qR z04N56)VO&VWFkm>vs~)cy`GJ{s48Z`kTFM;5JV$LW>zF5h&4b*eIOtQ?WQ~Zr%b3U z*-hoN$KnY&K((CTq=AyAf>N=mM&u+@);csZ!b1fL&;>N2)CR+R#BQ3`%fr3F#!cwF zh+bniMV<0`icp8D0hBf~m`IRT)W(?!nzOQ025Pks3~r%tg2M=sheTP>2agF_(9ch+-k+31Qu=#>OuqyhF8TjI6+v{?zdFilT4E}TDk<#JP#t^`Z zL0GNRL|701su&pN?(v2ULFf%%sL8M>LakF3>l6^w-A=m+-k2p>;wf5^d_IQ3tPDe8 zoQ2{rj+3ky0|-EiJ_`7KQcTYy@p%l(kq$c7Mv?@P%dmM)A}7a|O*!%`Y>t(RVco&7 zE(Apovn?C8qgd*(Sl*!lL07d>RjrM6K~c4;tKn)jggP8X)oC-0uJH(>95mQzMyaBa zJAo$G11V2a6?8t=y!;41Xu-xZ5@*3|tiWLuOZzaEu>wpaX^vu8U=?jJ2T{EAP!6NL z3OO*AP|PKs5d}u1NDC&gJ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4lGexcSO4dg>OUudGII_QxM@K33t^ z_6j5Ke~*FaZ Date: Fri, 10 Feb 2017 16:55:56 +0100 Subject: [PATCH 2/2] Add xml serializer method --- OsmAnd-java/src/net/osmand/PlatformUtil.java | 5 ++ .../osmand/router/RouteResultPreparation.java | 61 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/PlatformUtil.java b/OsmAnd-java/src/net/osmand/PlatformUtil.java index dd66708086..ffc9bf05b0 100644 --- a/OsmAnd-java/src/net/osmand/PlatformUtil.java +++ b/OsmAnd-java/src/net/osmand/PlatformUtil.java @@ -6,6 +6,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; +import org.xmlpull.v1.XmlSerializer; /** * That class is replacing of standard LogFactory due to @@ -24,5 +25,9 @@ public class PlatformUtil { public static XmlPullParser newXMLPullParser() throws XmlPullParserException{ return new org.kxml2.io.KXmlParser(); } + + public static XmlSerializer newSerializer() { + return new org.kxml2.io.KXmlSerializer(); + } } diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 82a6110dee..b6efc28a55 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -4,6 +4,7 @@ import gnu.trove.iterator.TIntIterator; import gnu.trove.list.array.TIntArrayList; import gnu.trove.set.hash.TIntHashSet; +import java.io.FileWriter; import java.io.IOException; import java.text.MessageFormat; import java.util.ArrayList; @@ -28,10 +29,12 @@ import net.osmand.util.Algorithms; import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; +import org.kxml2.io.KXmlSerializer; public class RouteResultPreparation { public static boolean PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST = false; + public static String PRINT_TO_GPX_FILE = null; private static final float TURN_DEGREE_MIN = 45; private Log log = PlatformUtil.getLog(RouteResultPreparation.class); /** @@ -332,6 +335,26 @@ public class RouteResultPreparation { log.info(msg); println(msg); if (PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST) { + org.xmlpull.v1.XmlSerializer serializer = null; + if(PRINT_TO_GPX_FILE != null) { + serializer = PlatformUtil.newSerializer(); + try { + serializer.setOutput(new FileWriter(PRINT_TO_GPX_FILE)); + serializer.startDocument("UTF-8", true); + serializer.startTag("", "gpx"); + serializer.attribute("", "version", "1.1"); + serializer.attribute("", "xmlns", "http://www.topografix.com/GPX/1/1"); + serializer.attribute("", "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + serializer.attribute("", "xmlns:schemaLocation", "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"); + serializer.startTag("", "trk"); + serializer.startTag("", "trkseg"); + } catch (IOException e) { + e.printStackTrace(); + serializer = null; + } + } + + for (RouteSegmentResult res : result) { String name = res.getObject().getName(); String ref = res.getObject().getRef("", false, res.isForwardDirection()); @@ -365,8 +388,46 @@ public class RouteResultPreparation { println(MessageFormat.format("\t", (res.getObject().getId() >> (BinaryInspector.SHIFT_ID )) + "", res.getObject().getId() + "", res.getStartPointIndex() + "", res.getEndPointIndex() + "", additional.toString())); + int inc = res.getStartPointIndex() < res.getEndPointIndex() ? 1 : -1; + int indexnext = res.getStartPointIndex() + inc; + int k = 0; + for (int index = res.getStartPointIndex() ; + indexnext != res.getEndPointIndex(); index = indexnext, indexnext += inc, k++) { + indexnext = index < res.getEndPointIndex() ? index + 1 : index - 1; + if (serializer != null) { + try { + LatLon l = res.getPoint(index); + serializer.startTag("","trkpt"); + serializer.attribute("", "lat", l.getLatitude() + ""); + serializer.attribute("", "lon", l.getLongitude() + ""); + float[] vls = res.getHeightValues(); + if(k * 2 + 1 < vls.length) { + serializer.startTag("","ele"); + serializer.text(vls[2*k + 1] +""); + serializer.endTag("","ele"); + } + serializer.startTag("","desc"); + serializer.text(vls[2*k + 1] +""); + serializer.endTag("","desc"); + serializer.endTag("", "trkpt"); + } catch (IOException e) { + e.printStackTrace(); + } + } + } printAdditionalPointInfo(res); } + if(serializer != null) { + try { + serializer.endTag("", "trkseg"); + serializer.endTag("", "trk"); + serializer.endTag("", "gpx"); + serializer.endDocument(); + serializer.flush(); + } catch (IOException e) { + e.printStackTrace(); + } + } } println(""); }