devkit_f2c_planner.test_projection

Unit tests for the lat/lon <-> local-xy projection and field_centroid_xy().

Functions

haversine_m(lat1, lon1, lat2, lon2[, radius])

Classes

FieldCentroidTest([methodName])

ProjectionTest([methodName])

class devkit_f2c_planner.test_projection.FieldCentroidTest(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_frame_is_anchored_at_first_corner()[source]

Starting from the opposite corner puts the anchor there: centroid is (-50, -25).

test_rectangle_centroid_is_its_midpoint()[source]
test_self_intersecting_boundary_does_not_raise()[source]
test_winding_direction_does_not_matter()[source]
class devkit_f2c_planner.test_projection.ProjectionTest(methodName='runTest')[source]

Bases: TestCase

test_anchor_maps_to_origin()[source]
test_axes_point_east_and_north()[source]
test_distances_match_great_circle_within_field_scale()[source]

Equirectangular error stays under 0.01 % out to ~1.4 km from the anchor.

test_east_is_scaled_by_cosine_of_anchor_latitude()[source]
test_one_degree_north_is_one_degree_of_arc_at_any_latitude()[source]
test_roundtrip_latlon_xy_latlon()[source]
test_roundtrip_xy_latlon_xy()[source]
devkit_f2c_planner.test_projection.haversine_m(lat1: float, lon1: float, lat2: float, lon2: float, radius: float = 6378137.0) → float[source]