Point: Store coordinate as pair of double, rather than 1E6 ints.

This makes the lat/lon member variables private and adds 1E6 variants for getters and the static constructor.
Also, Location now stores a Point for its coordinate, rather than 1E6 ints. The 1E6-based constructors have been removed.
This commit is contained in:
Andreas Schildbach 2018-11-15 21:59:38 +01:00
parent a7f6abc4b9
commit e6474db222
49 changed files with 514 additions and 462 deletions

View file

@ -30,6 +30,7 @@ import de.schildbach.pte.CmtaProvider;
import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType;
import de.schildbach.pte.dto.NearbyLocationsResult;
import de.schildbach.pte.dto.Point;
import de.schildbach.pte.dto.QueryDeparturesResult;
import de.schildbach.pte.dto.QueryTripsResult;
import de.schildbach.pte.dto.SuggestLocationsResult;
@ -62,8 +63,8 @@ public class CmtaProviderLiveTest extends AbstractProviderLiveTest {
print(result);
assertThat(result.locations,
hasItem(new Location(LocationType.POI,
"A=4@O=Texas State Capitol@X=-97740215@Y=30275103@u=0@U=130@L=9819105@", 30275103, -97740215,
null, "Texas State Capitol")));
"A=4@O=Texas State Capitol@X=-97740215@Y=30275103@u=0@U=130@L=9819105@",
Point.from1E6(30275103, -97740215), null, "Texas State Capitol")));
}
@Test