From cbcb545b65a1f48fe5d6b4936850676ee24763b6 Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Sun, 8 Jan 2012 15:01:54 +0100 Subject: [PATCH] Fix the problem reported in #1003 (NE, NW, SE not working for text-placement=simple). Add test cases for this problem. Conflicts: src/text_placements.cpp tests/data/placement/clean.sh tests/data/placement/test.py --- src/text_placements.cpp | 3 ++ tests/data/placement/clean.sh | 5 +++ .../data/placement/simple-E-500-reference.png | Bin 0 -> 1514 bytes tests/data/placement/simple-E.xml | 21 ++++++++++++ .../data/placement/simple-N-500-reference.png | Bin 0 -> 1526 bytes tests/data/placement/simple-N.xml | 21 ++++++++++++ .../placement/simple-NE-500-reference.png | Bin 0 -> 1528 bytes tests/data/placement/simple-NE.xml | 21 ++++++++++++ .../placement/simple-NW-500-reference.png | Bin 0 -> 1531 bytes tests/data/placement/simple-NW.xml | 21 ++++++++++++ .../data/placement/simple-S-500-reference.png | Bin 0 -> 1524 bytes tests/data/placement/simple-S.xml | 21 ++++++++++++ .../placement/simple-SE-500-reference.png | Bin 0 -> 1526 bytes tests/data/placement/simple-SE.xml | 21 ++++++++++++ .../placement/simple-SW-500-reference.png | Bin 0 -> 1530 bytes tests/data/placement/simple-SW.xml | 21 ++++++++++++ .../data/placement/simple-W-500-reference.png | Bin 0 -> 1529 bytes tests/data/placement/simple-W.xml | 21 ++++++++++++ tests/data/placement/test.py | 32 ++++++++++++++++++ 19 files changed, 208 insertions(+) create mode 100755 tests/data/placement/clean.sh create mode 100644 tests/data/placement/simple-E-500-reference.png create mode 100644 tests/data/placement/simple-E.xml create mode 100644 tests/data/placement/simple-N-500-reference.png create mode 100644 tests/data/placement/simple-N.xml create mode 100644 tests/data/placement/simple-NE-500-reference.png create mode 100644 tests/data/placement/simple-NE.xml create mode 100644 tests/data/placement/simple-NW-500-reference.png create mode 100644 tests/data/placement/simple-NW.xml create mode 100644 tests/data/placement/simple-S-500-reference.png create mode 100644 tests/data/placement/simple-S.xml create mode 100644 tests/data/placement/simple-SE-500-reference.png create mode 100644 tests/data/placement/simple-SE.xml create mode 100644 tests/data/placement/simple-SW-500-reference.png create mode 100644 tests/data/placement/simple-SW.xml create mode 100644 tests/data/placement/simple-W-500-reference.png create mode 100644 tests/data/placement/simple-W.xml create mode 100755 tests/data/placement/test.py diff --git a/src/text_placements.cpp b/src/text_placements.cpp index 8929d86ce..aca06a5ac 100644 --- a/src/text_placements.cpp +++ b/src/text_placements.cpp @@ -107,14 +107,17 @@ bool text_placement_info_simple::next_position_only() displacement = boost::make_tuple( abs(parent_->displacement_.get<0>()), -abs(parent_->displacement_.get<1>())); + break; case SOUTHEAST: displacement = boost::make_tuple( abs(parent_->displacement_.get<0>()), abs(parent_->displacement_.get<1>())); + break; case NORTHWEST: displacement = boost::make_tuple( -abs(parent_->displacement_.get<0>()), -abs(parent_->displacement_.get<1>())); + break; case SOUTHWEST: displacement = boost::make_tuple( -abs(parent_->displacement_.get<0>()), diff --git a/tests/data/placement/clean.sh b/tests/data/placement/clean.sh new file mode 100755 index 000000000..a6f192b13 --- /dev/null +++ b/tests/data/placement/clean.sh @@ -0,0 +1,5 @@ +rm -f list-[0-9][0-9]0-agg.png +rm -f simple-[0-9][0-9]0-agg.png +rm -f simple-{E,N,NE,NW,N,SE,SW,S,W}-500-agg.png +rm -f list-out.xml simple-out.xml + diff --git a/tests/data/placement/simple-E-500-reference.png b/tests/data/placement/simple-E-500-reference.png new file mode 100644 index 0000000000000000000000000000000000000000..5e6d3230faa3aecadd33823dba91fba9489ce399 GIT binary patch literal 1514 zcmdT^`%{u>6#mMz$k58k#?s75ZA;yDjm=5JGA-|D*2a#GS`iA1=6Zt^g>G80DGh4o zCDAE$y`h##UQu_0RYVztyp@!SppKF9kpc?)?GODAyT811=A1LZ>KLBl^j8MSI_zI552!5MdFXc%*YMHdN+@7t0Wq#SBPrW2YK z$B;(6iV21#J4AJ76iu)bm?z>V@~67UXm0xY+H%X4-aC#~rlD3|_b=CmFg@|yM^=KQ zCGM7uzARI03}r*Bj`MpDR^vyi3NR?9XXMw@nOcyp8f}OuoD-Cwm*3ph!rWUPTlW@6U?h9Nb=UCRPj3=u zM7NE$iXK`V77Z31zj)uwMpPMCIPjyzVN}qc_sv7LnjZ*?9WHaBLI{~rUFii7g3GK) zC?|clTx^q zt9_33Nmm=sj5mYj)KRh5>9m#WC+7wVoFuxcpdtpBZY%xc8>C$z#ITScV-KlZUrO25 z0%snn?;flsxa0(ue-)WD>!(gFc2}Gn)3mKYBjU?>blXDdhb}VdITtPt5mpq`Iw>@5 zDP}X-@cl>I&qpN@6~YQc>Vi0Fs_1y^fWFEsz4h8#nz#<#xMGf5+0C||hZyUhCmK6{!ke`T-Y0 zKf&|45^4Ygf8Tp-fbqImDqCYkbGo(br!di-Hxt{=l^rTE9E!}`X90GeN7_z8SLq%* z4bRz+ds^-tn%0kwntUd8rhN>^tMEGmNSZNOa8v+0 sZ + + + + + My Style + + shape + points.shp + + + + + + diff --git a/tests/data/placement/simple-N-500-reference.png b/tests/data/placement/simple-N-500-reference.png new file mode 100644 index 0000000000000000000000000000000000000000..f31f28124f382a181e82d8029dcbc7612bff0442 GIT binary patch literal 1526 zcmeAS@N?(olHy`uVBq!ia0y~yVEh7Pr*N3o$R0@Q~1$=^dbeH3=I4IFEA=F zII=e|u*fnn36wB!IM7a@{r`^h^X-@a{{DV>_4jv6r|ZWr+g<+N?E8d<{|b)J>)$>; z-k*7_N3wpmZtSitTJOKVxVX6F-=Cju^80gdZ@aS4xjiH}c=E2&*VD}M?#!?%e-|@# zBf~}xtN+>a?P|R?r=4B3x%ABq!>?~|Z$G#1>FMd=PydFkjS4+;L~-nSFg-=7R%`scrwi zy}i99`FP)z_3`_!Ec2ahl6a_P)7d$eo9}(Uxu>#N$}q`=^B2%}r#Jrmv$y*DGR@#+ zQ2m@UfAv7L*T)z-deTCzpjnHgL1@9!&lb7P}P z?XNFa*2V5Fd3dO`=**9gk1tZV z=5PNaT2=e$P0iC&Q&nHgHp|sI{_J!8zV?5wuCBhaulDzr)YH?fp6{#vu2=f%fa@h`wonb!VPOeZ41>F4Kd85b8B zF`r}Om73DVFF%h@&L$%5!qio=Ux2A$da_>Zu8`gNmzH>D0{!eOWq#okr&Y)b{TKf8 z?Q|cW@t^xVHDzjaU)r?C)_He!Tv-*mdehSla#kfPzFA%6tKuu$r@yb_jJNz@IJ>UV=+O^e_qTv>(W;tH{;(fNIyMI z*Bh8jH0&KFPv7y>1L(0|^1ad-JAqy>DdDfZvLZ0^$%%thYtwWhC+WrSi%B~sZ&%~7yX>vjM%$t%9y{IkZJ!qpjCkAFJr#y` zcN8u@SZHGQA~NolS;B#aqMEpK*QOLQ8**5M{J3iM<#0Ry^sP@U=hWxfR)5oJto!yR zGIG + + + + + My Style + + shape + points.shp + + + + + + diff --git a/tests/data/placement/simple-NE-500-reference.png b/tests/data/placement/simple-NE-500-reference.png new file mode 100644 index 0000000000000000000000000000000000000000..99a76002f27d15f5e5378b8b47e772e4c25a8caa GIT binary patch literal 1528 zcmdUvTTs$z7{>pEYw3DuYIZjdWMhSSs#bJe(Ns2f%uKW_YlWmu%hcRFk!b>XD97E> zTs6ln1xp}PGBZ39SeueMhc3s7mm~Gj+_vR+J0vhCKwM!Fhe>V@(MjKc1Ig;8@kyxfy zs9QwnHH{%F9xt4)XD%azqN=BYCd>|iqF|m=KmdS*9)N5EQ0uP%MlfLA#x!7q{}&YE zC#SeYQpMX2X@8}+RI8Rqm*r!;eLGe-_OoH@CpaWBE#&rc(b#0y9|WV9-x#pr=Nd49|vS#>^z4PLiG5QV~)3*=0VLO;Z& z2A2z_^%3r6^K|`)xOKLhbKE|AEvnUA$lmuV7M1p zG&tUt8ZKfJ!X^Ec;f9a;J~IP2Vcb}AVr?kdxAs_FMBI35@|oMdgv?xJQ}R@|`}x<8 zHZ2x!54;tv)^?;T(IxN@C$6m@ktHLoEWE!UX^3Px@&59tn@fh4nIMO252E;%_rzNY ztv#INZ<-unUMV|5Dv=({xFL9@cltwH#6{U__e%@!o}?=$(p1wus`O>q8|j;-Sm_`& zSlkXnrtOkQTuE0aZu)qGi)EOsUNg7pZPe=Ql+~O|AMBZlV?QJcpGfJcB34ET5e(AWdEj6|)!Bgz438$mW zD7dGYOKWVL-S2&tGIJ}pX}TH&cdWkyKOb>y%GlZgG~3#ARl+Ct{hgwo;W=09k};1? zp(-G;P-C+L`|~YA)-=jJh*{hSayGDNt1B1Vn)H5+ZL%3&^XgupXWY2|nH&rJgKCN& zQP-M>@WWS?7wg-_=gxYuqr0yMfk|<}Sj=Zb*RyeS0gC^uU(@y7ZtRID5r@QKDZ#ki zcK?my_K9g2$W&_E?U5ijiod~{J`Vznn|x6qW^Hyrm+F}onawdhe-1M+Eh?ycMggX9 zv9ElOfu0QIY)-o$UZ$un+VZ`0gY!4*qh&fse5Y8+Ag zgkg0fNG?7JKJmIWyW0e5R92oPX1>+-sK6G~1{~+(qJcG|>n(GZcHgj(f;r&1_lopG zt=ZR1kbu#)SzzN83e+FSu>c?&{wwgNxptvFHl5@J$924bf$T`t=l5ri{ + + + + + My Style + + shape + points.shp + + + + + + diff --git a/tests/data/placement/simple-NW-500-reference.png b/tests/data/placement/simple-NW-500-reference.png new file mode 100644 index 0000000000000000000000000000000000000000..7381a7643046b741e73c836fc2e1c97b1e6f213a GIT binary patch literal 1531 zcmeAS@N?(olHy`uVBq!ia0y~yVEh7Pr*Nm*RC5W;Pz4B`ux59fG{rPW_$Kp^@mYPV@Wk z&+jW=*;?K!-t&CVxtqWL|Nm=0KWgqbtL(LZd%kT?U;p*ZEEa}8=U1=%#=y{Eul|BT zpkV>C149!Z10#nO1B(Lf1U}cl{`~y>%YT1=zr44%`sLHp(_g;3yZfq~(1HDGFSc~_ z%iAxLG*0{Tcw5QKOKFw+-TUR10@a)U`jLBk+fqJRt0l8$&APHSdi$2b$H%VhEPkFQ z$?aguVWs=%@^b&oYilA)xAnUC;BnaDJ|Jc-ph@^>MiqH!_4Y zF9*fs+n2t*Wy&jK zvEj^z`}=BVm%X_$@z>Ya({F9boUGaPF6qt?|8rb|F?fkv#%|&EPiHEb%$Z9(u)uuXUFsWi=RsLNgAuYy}eyu z*1Al`cfOtN*6izgu{#PD${5%E`C(G>;=-2t|NlyUeR=t*{N0_MFOPPMzdSWn`{}N^ zR;60cpX=7Q#?7~}j^A07%J~cE+fy5V{+a)N;r^B%&AV&$_TJvz2eZwe zYJWFQKR0DT{QkPVW%t+fAAQRH4H(>E&-VbsZOUh$b1ttaWDc1G49%~se_vl;|1@zY zE4SE`fPZ^*qqeL#)3DjGnQiIA!|ltP+4-kQepx@u`UNm7^pD5vDp^@}e~IVhOE)$q z&o;?x@DeQ1TDEV2eeJI;Eynhx^QKSyyX$F2n&rO7$9lcjMs3xK=6k)+xjk$BhspRLUr$)yAK0I{3wKY4u^X)`s_fw{y_I~|S z_50h~myeEizdY6}&D*zlqvQEcm$or7vrT#YxoF$69_a;>fKK~)*XqmRcK+#GpIFYR z&jp6QPGjA-H<6K>zJ2~*RC9e@Y;<+qyp8%XJ2up~&QqRUKXIL+FK1QU;(7gVf%#~! z@yGkUV1xckRh|rwyFGWlPW^`mj=%o>t)Bb;x#@GD0p8p5?s~nyzkmHDjsNfFAL9++ zBv5!bPyO>J*`$*Bhp?UN0xuTX3_nboL4m=My@7#6mVrs2gn`510^?8>cwld$zDB2* T|LhuIq0Zpx>gTe~DWM4fZxFbh literal 0 HcmV?d00001 diff --git a/tests/data/placement/simple-NW.xml b/tests/data/placement/simple-NW.xml new file mode 100644 index 000000000..5e80dc607 --- /dev/null +++ b/tests/data/placement/simple-NW.xml @@ -0,0 +1,21 @@ + + + + + + My Style + + shape + points.shp + + + + + + diff --git a/tests/data/placement/simple-S-500-reference.png b/tests/data/placement/simple-S-500-reference.png new file mode 100644 index 0000000000000000000000000000000000000000..97370ba2a913ea842ab4382ef9d06122697e7b62 GIT binary patch literal 1524 zcmeAS@N?(olHy`uVBq!ia0y~yVEh7Pr*N3o$R0@Q~1$=^dbeH3=I4IFEA=F zII=e|u*fnn36wB!I1ELBS)RVWzH@mWl>ZQEOjCN{VEPk-X2k2ohxYG2KR^HS-{0Ra z@9nLA`SkSkm+$WGK5MJ;z~1A+&-mXzJ|@pHOg?r$&wIMw+Ec%6tG;N=wXffI@p%62 zZMvl|E-d`>!DoBk-Al)MrGuZJo4eXbOhL@?dHvhV%l$L2t%)q%)+cMdY+vo~Yd5#o z{QR_P&;3=QtG#AOKmPgo`O4he+cFQg@xDAe+dOrRd%v9T=VxbEpNeRRV3F1O^6IL# z?`*TT@jJ_co9f=(*=c0Fzv}C&{b2Lkx%P8a?d!L#{`Tg|?(+9n_Evv4DSULKt=ZG{Vs-@dN!r)dNLiI++}dAX zZ&mxNPKzTfRRx*Sc5AT%dV@ zbL+3Be_vl;|Fq#w6DzluM*Tf8-KdbX12-2qHedSi@bKk>&FrUnb_H#1uKV-jW6_zV z-qW+b`_3}a?3K0N=J}W{%FeN!>nrQumzS5T&iT3W^PZkHMW-*GDXKZ%D?L4GYgXts znQPANd{^U^-*P;E@Z9&K;`(tharQMoHtYd8Vzx=%f~UeID+1y#e6D>dbFB3BHPcs8 zl_zgDGP7TLa&q$N%H@7@wSKRb{gQKYQ|d}!GI`3L@kwaA%uArh{x2?M)}0RYLfgBA z{Zgh{y)u?YwZFfuy?FhU@e3Q_xV=@Sm3!;{{&G9tB`y607}3)ne==umX6M)Qzxw~( zj>c*37Zy4>JK7gMa`|ax&Hfn}l}{Bn{}C;(n^gPy+S=5Uw~_V)JW-QxPoq|Nh8Ec%YI*`D^k&Bh}U(0Bgy%~?iy3T(iT z*&o$j_v6FEP19`JKc8Qletw?nh4b@lwY{&^{fqB=4@@uF=g%8|YvmT7w*EwM%4hvc zrb{#(&u3rxys`GzmzCve|5g_=8**5g1jc=udcEwq`e}KaiV6Gb|HnQ5UwQWD*6iz- vfN_55_xJa+GpE#lEeFPj8U0JO2mJBh*68p|_x%Pe%^5sh{an^LB{Ts5V^y)D literal 0 HcmV?d00001 diff --git a/tests/data/placement/simple-S.xml b/tests/data/placement/simple-S.xml new file mode 100644 index 000000000..1ada1baca --- /dev/null +++ b/tests/data/placement/simple-S.xml @@ -0,0 +1,21 @@ + + + + + + My Style + + shape + points.shp + + + + + + diff --git a/tests/data/placement/simple-SE-500-reference.png b/tests/data/placement/simple-SE-500-reference.png new file mode 100644 index 0000000000000000000000000000000000000000..6f7b438cb8ca05d6541aa1c6c46a518ea9314920 GIT binary patch literal 1526 zcmdT^YgEz)6#pA)u97m>%QC8yl^u;WU&AaUEhBtYdYYN$j+&2B2SO-5NRK;Ar_?M- znGZHiTs|0*8XDlTMM;XG^FfNQl!p%rQHO}^zdr5LzV%^W?z!ild+xoz$GN$I{yvr) zY&HM@V2M8GeGvdmv|t`(VGhP`h0ihoz>J6XMg^sm&JAN~{N`ZoSmNoIzy+M+@hy2- zIa!6d-d2!YE9+lA$N7C3(cbQPzWB-JgAbz^!|>eix0=7B;{-@!IWwG0;fUMBGf&Hw z)Q0qUf^?>?X~{`CTF&d|gdPMK(@nASCICS8?=jg2pw{08Ol^U6TkwE|=l`)lNB^+h zQFRj_KVw=rTcg&~3j?fT4`oB0?J5rR_?p_rogG1R-t9;@eYb|n42676A)(l`}i4p4FnO^cFS+K z>&8|4t6g~SFmA%Yvezb_@@=9NSmD`xZwGo$}#3V=` zqh|(K0jz6+W05Cu@6ORr5EJj^o7GSmUInTlP7K|hpc3HbUYHtYhd9yKGp9O>$k7g- z1XJ7iATN}7nH|$bFCs0fidqRXv_rndce_gw3zNn>Fr@#&bQi|3vWN+5#iJqSn~pfG zx+Te~=H9k2!JDi5>qD6zCWQ|YUgYmuF0NpT9>5>W+?pL^msYf_ZX;!AX4C)3+h(WO z?Uv{uoL(UFDQlW3QC~w?+vC)QX?Hm|z?CpRjBvchf2zVliavAit2vJn>&-Xsy}Gwb zFIrZQVvaCR&sGmmCNz*VFAB6iSvEh? zCQ5Bd8f}Ol_U!nF%nX!KGlfb0IuX3w?mjYUh)?Q|2!P(j`O7ZOFW3AR@V@4(>KV&oCB zRzj^u6iqPE9nhFG)cDXLB=l(twiU0uSh7n%HlCUr=5n4dfo7Sq(aA`eyo9&S`0;1o z;X$wEP1d+7Lc*o}U>`0$yt}^`3$e7u*Icly_d?-#_ji6FO#Dd;F4fTF+=X6(hbUZX#*#$lVU&0l--HpYozn5Q96Tu zxfhgAwTfgRKwrkUrY>A3EzgHJ6=;ZLw?sx}HWV%e~wpwIYwH=K^h{u}wzyyXA@ literal 0 HcmV?d00001 diff --git a/tests/data/placement/simple-SE.xml b/tests/data/placement/simple-SE.xml new file mode 100644 index 000000000..c8ee4f6d5 --- /dev/null +++ b/tests/data/placement/simple-SE.xml @@ -0,0 +1,21 @@ + + + + + + My Style + + shape + points.shp + + + + + + diff --git a/tests/data/placement/simple-SW-500-reference.png b/tests/data/placement/simple-SW-500-reference.png new file mode 100644 index 0000000000000000000000000000000000000000..4599a044d708888b309b2d1d47db89b528a7c65a GIT binary patch literal 1530 zcmeAS@N?(olHy`uVBq!ia0y~yVEh7Pr*Nm*RC5W;Pz4B`ux59fG{rPW_$Kp^@mYPV@Wk z&+jW=*;?K!-t&CVxtqWL|Nm=0KWgqbtL(LZd%kT?U;p*ZEEa}8=U1=%#=y{Eul|BT zpkV>C149!Z10#nO1B=2?6bKCp4h~Ld{vmAVy18>oWN%<#k!4^KC}H4m zxWI@k@Grmi-yh4n`|IuR?k?BgTl3TC?%wL{x15=NTxXdp_VMH6<0i?+dg|{?(~G^O z^Zxsbi;GMC{rTx8zd!f(wkr#r+dnny-Q88{Ep49XGuOI2Z`wwNkmd!KmF#MNO-VaD zD>VJ}jg85#Zg0<@TYGxCe*U!Y(Oa`ZIg68R>i^kn&An}wdt-y*-pbF*dcFcp&b+s$ z@~n|qLzX~^*0S*RahbQaWa<{ZUB>eF&d%c0w7Rdau8K)=JD74u)3d5`uTZl|Nft>?tkge&(FdC|NRZVzApCifkx)jJpbR`-ky29Pj+Se z{<@XEv&}LOwQ#1+wk%HD`+jrf=VvBKM>>SQTwLrvJ^Ay`>hJG-gO~Ye9-m`Vx#>;) zpC2FZpNrp|<~z$c-EZ-6-T=)ezoRB1U;Y?G^*x+nn0#qp?e9w)laF8e^73-w|uOdwY4BZuF};zu(>6ePyZl^est8yWIMv7X-1) z?aI`6QF(uYqVuWdlKP(?AG>oty|Oa+@^t<9px4*dUIuEA-cuI5ugJdmnGff$udlCX zfB*X{Af_%M|Hg*I(sQ>rr~6yJKR4I9SIXQ$mD5TzIR3)^y1!9!)1o&dIC4Hce|wQ@ z_bDC=X_JfqDZ82qtBMZ^Gadi0+SyzO42z;OK*wZ#_nl>;*(+3;U%^wR&YNjcR{?TYK^PDdQJ5!f|`6N-Ou){r%;3 zzDrvA%WU)fX^%gdGd8pH>-k^(|8fUoRM&!FLtfUuM>>U{zJ4Qf2AEc-x1aeGe&?s> zx3$sRr>SOpPt)-P2Cbg)V}5zNC9%89rrwaVELswyd_Vg9`tAAm=jp}mnE~|a#RnEr z(qDA+bEORu94zhh)3Z^iXZxBT1(DwK4*$G<4VY?$UI3HoRMl+z|N6(v z-`?7~_4#wj--lYcPlrFT-1JlYrPQS<3!a<4`gsGGkFHn?|Gx`1=;!*0(`%k?z5Daz zCw6|hCGYR=zy7m6uDA|pKnXD3zx@0ATdVie`+u2t7^V(DY4(S`mdKI;Vst09d5BYXATM literal 0 HcmV?d00001 diff --git a/tests/data/placement/simple-SW.xml b/tests/data/placement/simple-SW.xml new file mode 100644 index 000000000..641452d4b --- /dev/null +++ b/tests/data/placement/simple-SW.xml @@ -0,0 +1,21 @@ + + + + + + My Style + + shape + points.shp + + + + + + diff --git a/tests/data/placement/simple-W-500-reference.png b/tests/data/placement/simple-W-500-reference.png new file mode 100644 index 0000000000000000000000000000000000000000..3744851f7c8c7bc906a761c1a09b8d75a65f02c8 GIT binary patch literal 1529 zcmdUv=~Giz7{)JaEey-(474zSor)-BDUw35hOjAM0GBA5ib2a#fj|s|oe-q83W{1l zAczT8WJ?f`B`OdoR#2cMl4uA5!IEoo33~!&A<)}SKlD#%znu5X`<{8`JkR;fDL5Jy zXkuh#1OR|Za8ST;0MJpu`{-?k@Op8up9}y7eZc{~Co-xQCec@qEZOy~5H0;It`;X0 zTt4cw%c&H|CqD+10!BQf0|1mTuFg)t_oF;O-v-b%Cjr}h{@V=+ zN+y?ZpiQj?n(oPlz~OReajMH1xhszn!i}@AL*<6J$Brl$I!VyjZdG^SP1^_Xc~7M> z@onb=Q=9!Yjg5``rZcQ|;_LwbNs46mr^Y^Lb5iB=x+C;4CblgeZ}UxB2wAh<)JjmT zf}yLKjPNGM^GR1F9C}@6;@esiYmXXF!gOh?Eiw!7`yJ2b-~nCkcKy4B&}+u2N{_^E z+akK$d{OC(5mahqPgV!^pK*h$ROP)sFKojsP4{3vEKc!$E7-vkwtY`wZ;4-)ASjy~ z{9eiyzav3_xH!|d?-@n2o;cAO6*wnoj*REkhE{%g-cJ}iT7{KK@YCI1MW49+qEA*x zUxDK}n{X7o(!H1=H-{rMCk-6J21_nrVoTnSP0V(iXf{M{D)_|NbmYDCyyvsW_jFu{yaEa9>l8~7QykXZP zHg;qsuFmIxL$~dvcRUgu2j9yXB7e%-+{t(mn>_I-23?dQ>d7vDN`i{RnWtaP5Csl5 z@2L%!9dfQ6{p$`(*88G^GH)$XayOL6{Jc`<_zL(D`A<`2?b#m|_cu>f&?h-nUKrgh zt$K~F$tCY`LA7||$6Kr<3&OU#s&vWdUBerT z!ZizLNB0>#x7s&Ox%>{A`SphwLoK7$RJ}4gIP6yLa#sC>Fjf;B2iq^QN+m7THj$Ey0>vnyaq`r@Rp zo+t?9UaA$J`LVFUS*l`_ZU|vFR-~eC@qFJUy|`8JORyVL7j|14YNNmlAH_7lRDyO~ zv3-))SaW3WX5g&hg{1tj=loPNGQa*#m7c(kIe=IMVKf_9LM!zX@ z!WO$kvLj*#?7VY=y3!ULTan4)peKjeELtQC1M+NlhTGI*;{8z~0wKlXCOppd + + + + + My Style + + shape + points.shp + + + + + + diff --git a/tests/data/placement/test.py b/tests/data/placement/test.py new file mode 100755 index 000000000..1fabccbce --- /dev/null +++ b/tests/data/placement/test.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import mapnik +import cairo +import sys +import os.path + +dirname = os.path.dirname(sys.argv[0]) + +widths = [ 800, 600, 400, 300, 250, 200, 150, 100] +filenames = ["list", "simple"] +filenames_one_width = ["simple-E", "simple-NE", "simple-NW", "simple-N", + "simple-SE", "simple-SW", "simple-S", "simple-W"] + +def render(filename, width): + print "Rendering style \"%s\" with width %d" % (filename, width) + m = mapnik.Map(width, 100) + mapnik.load_map(m, os.path.join(dirname, "%s.xml" % filename), False) + bbox = mapnik.Box2d(-0.05, -0.01, 0.95, 0.01) + m.zoom_to_box(bbox) + mapnik.render_to_file(m, '%s-%d-agg.png' % (filename, width)) + return m + + +for filename in filenames: + for width in widths: + m = render(filename, width) + mapnik.save_map(m, "%s-out.xml" % filename) + +for filename in filenames_one_width: + render(filename, 500) \ No newline at end of file