1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Wikibase.Coordinate: Reverse NS / EW direction for geocoordinates; also, standardize spacing / symbols for wikibase

This commit is contained in:
gnosygnu
2017-04-02 08:46:12 -04:00
parent 8501ec6fd8
commit 26a56950cd
7 changed files with 43 additions and 24 deletions

View File

@@ -133,9 +133,9 @@ public class Wdata_prop_val_visitor implements Wbase_claim_visitor {
}
// build String
gplx.xowa.xtns.mapSources.Map_dd2dms_func.Deg_to_dms(bfr, Bool_.N, lat, precision_int);
gplx.xowa.xtns.mapSources.Map_dd2dms_func.Deg_to_dms(bfr, Bool_.Y, Bool_.N, lat, precision_int);
bfr.Add_byte_comma().Add_byte_space();
gplx.xowa.xtns.mapSources.Map_dd2dms_func.Deg_to_dms(bfr, Bool_.Y, lng, precision_int);
gplx.xowa.xtns.mapSources.Map_dd2dms_func.Deg_to_dms(bfr, Bool_.Y, Bool_.Y, lng, precision_int);
// write globe if any
if (wikidata_page) {

View File

@@ -81,21 +81,21 @@ public class Wdata_visitor__html_wtr_tst {
.Init_resolved_qid(2, "Earth")
.Test_claim_val
( fxt.Wdata_fxt().Make_claim_geo(1, "51.5072222", "-0.1275", ".000027777", "123", "http://www.wikidata.org/entity/Q2")
, " 7' 39&quot; W, 51° 30' 26&quot; N (<a href='/wiki/Q2'>Earth</a>)"
, "7&#39;39&#34;S, 51°30&#39;26&#34;E (<a href='/wiki/Q2'>Earth</a>)"
);
}
@Test public void Globecoordinate__globe__null() {
fxt
.Test_claim_val
( fxt.Wdata_fxt().Make_claim_geo(1, "51.5072222", "-0.1275", ".000027777", "null", "")
, " 7' 39&quot; W, 51° 30' 26&quot; N"
, "7&#39;39&#34;S, 51°30&#39;26&#34;E"
);
}
@Test public void Globecoordinate__precision__0() { // PURPOSE: 0 precision was causing divide by 0 error; PAGE:ru.w:Лысково_(Калужская_область) DATE:2016-11-24
fxt
.Test_claim_val
( fxt.Wdata_fxt().Make_claim_geo(1, "51.5072222", "-0.1275", "0", "null", "")
, " 6' W, 51° 30' N"
, "6&#39;S, 51°30&#39;E"
);
}
}

View File

@@ -49,7 +49,7 @@ public class Wdata_pf_property__basic__tst {
@Test public void Geodata() {
fxt.Init_links_add("enwiki", "Test_page", "q1");
fxt.Init__docs__add(fxt.doc_("q1", fxt.Make_claim_geo(1, "6.789", "1.2345")));
fxt.Test_parse("{{#property:p1}}", " 14' 4.2&quot; E, 6° 47' 20.4&quot; N");
fxt.Test_parse("{{#property:p1}}", "1°14&#39;4.2&#34;N, 6°47&#39;20.4&#34;E");
}
@Test public void Quantity__plus_minus__y() {
fxt.Init_links_add("enwiki", "Test_page", "q1");