Example #1
0
def test_material_solid_color():
    expected_result = """{
    "solidColor": {
        "color": {
            "rgba": [
                200,
                100,
                30,
                255
            ]
        }
    }
}"""
    mat = Material(solidColor=SolidColorMaterial.from_list([200, 100, 30]))

    assert repr(mat) == expected_result

    pol_mat = PolylineMaterial(solidColor=SolidColorMaterial.from_list([200, 100, 30]))
    assert repr(pol_mat) == expected_result
Example #2
0
def test_packet_polyline():
    expected_result = """{
    "id": "id_00",
    "polyline": {
        "positions": {
            "cartographicDegrees": [
                -75,
                43,
                500000,
                -125,
                43,
                500000
            ]
        },
        "material": {
            "solidColor": {
                "color": {
                    "rgba": [
                        255,
                        0,
                        0,
                        255
                    ]
                }
            }
        }
    }
}"""
    packet = Packet(
        id="id_00",
        polyline=Polyline(
            positions=PositionList(
                cartographicDegrees=[-75, 43, 500000, -125, 43, 500000]
            ),
            material=PolylineMaterial(
                solidColor=SolidColorMaterial.from_list([255, 0, 0, 255])
            ),
        ),
    )

    assert repr(packet) == expected_result
Example #3
0
def test_packet_polygon():
    expected_result = """{
    "id": "id_00",
    "polygon": {
        "positions": {
            "cartographicDegrees": [
                -115.0,
                37.0,
                0,
                -115.0,
                32.0,
                0,
                -107.0,
                33.0,
                0,
                -102.0,
                31.0,
                0,
                -102.0,
                35.0,
                0
            ]
        },
        "granularity": 1.0,
        "material": {
            "solidColor": {
                "color": {
                    "rgba": [
                        255,
                        0,
                        0,
                        255
                    ]
                }
            }
        }
    }
}"""
    packet = Packet(
        id="id_00",
        polygon=Polygon(
            positions=PositionList(
                cartographicDegrees=[
                    -115.0,
                    37.0,
                    0,
                    -115.0,
                    32.0,
                    0,
                    -107.0,
                    33.0,
                    0,
                    -102.0,
                    31.0,
                    0,
                    -102.0,
                    35.0,
                    0,
                ]
            ),
            granularity=1.0,
            material=Material(solidColor=SolidColorMaterial.from_list([255, 0, 0])),
        ),
    )

    assert repr(packet) == expected_result
Example #4
0
 label=Label(
     horizontalOrigin=HorizontalOrigins.LEFT,
     outlineWidth=2,
     show=True,
     font="11pt Lucida Console",
     style=LabelStyles.FILL_AND_OUTLINE,
     text="Geoeye 1",
     verticalOrigin=VerticalOrigins.CENTER,
     fillColor=Color.from_list([0, 255, 0]),
     outlineColor=Color.from_list([0, 0, 0]),
 ),
 path=Path(
     show=Sequence([IntervalValue(start=start, end=end, value=True)]),
     width=1,
     resolution=120,
     material=Material(solidColor=SolidColorMaterial.from_list([0, 255, 0])),
 ),
 position=Position(
     interpolationAlgorithm=InterpolationAlgorithms.LAGRANGE,
     interpolationDegree=5,
     referenceFrame=ReferenceFrames.INERTIAL,
     epoch=start,
     cartesian=[
         0,
         4650397.56551457,
         -3390535.52275848,
         -4087729.48877329,
         300,
         3169722.12564676,
         -2787480.80604407,
         -5661647.74541255,