Search in sources :

Example 21 with Point

use of org.activityinfo.shared.report.content.Point in project activityinfo by bedatadriven.

the class TileMathTest method inverse.

@Test
public void inverse() {
    AiLatLng latlng = new AiLatLng(15, 30);
    Point px = TileMath.fromLatLngToPixel(latlng, 6);
    AiLatLng inverse = TileMath.inverse(px, 6);
    assertThat("longitude", inverse.getLng(), equalTo(latlng.getLng()));
    assertThat("latitude", inverse.getLat(), closeTo(latlng.getLat(), 0.0001));
}
Also used : AiLatLng(org.activityinfo.shared.report.content.AiLatLng) Point(org.activityinfo.shared.report.content.Point) Test(org.junit.Test)

Aggregations

Point (org.activityinfo.shared.report.content.Point)21 AiLatLng (org.activityinfo.shared.report.content.AiLatLng)10 PointValue (org.activityinfo.shared.report.model.PointValue)10 ArrayList (java.util.ArrayList)7 Cluster (org.activityinfo.server.report.generator.map.cluster.Cluster)6 Test (org.junit.Test)6 SiteDTO (org.activityinfo.shared.dto.SiteDTO)4 Clusterer (org.activityinfo.server.report.generator.map.cluster.Clusterer)3 MarkerGraph (org.activityinfo.server.report.generator.map.cluster.genetic.MarkerGraph)2 BubbleMapMarker (org.activityinfo.shared.report.content.BubbleMapMarker)2 MapSymbol (org.activityinfo.shared.report.model.MapSymbol)2 Coordinate (com.vividsolutions.jts.geom.Coordinate)1 CoordinateArraySequence (com.vividsolutions.jts.geom.impl.CoordinateArraySequence)1 File (java.io.File)1 FileWriter (java.io.FileWriter)1 List (java.util.List)1 BubbleFitnessFunctor (org.activityinfo.server.report.generator.map.cluster.genetic.BubbleFitnessFunctor)1 GeneticSolver (org.activityinfo.server.report.generator.map.cluster.genetic.GeneticSolver)1 IntersectionCalculator (org.activityinfo.server.report.generator.map.cluster.genetic.MarkerGraph.IntersectionCalculator)1 Node (org.activityinfo.server.report.generator.map.cluster.genetic.MarkerGraph.Node)1