@@ -13,6 +13,15 @@ def test_export_to_csv(zmap_object, tmpdir):
1313 assert lines [1 ] == "0.0,300.0,nan\n "
1414
1515
16+ def test_export_to_csv_pixel_is_point (zmap_object_pixel_is_point , tmpdir ):
17+ x = tmpdir .join ("output.csv" )
18+ zmap_object_pixel_is_point .to_csv (x .strpath )
19+ lines = x .readlines ()
20+ assert len (lines ) == 25
21+ assert lines [0 ] == "# X,Y,Z\n "
22+ assert lines [1 ] == "25.0,275.0,nan\n "
23+
24+
1625def test_export_to_geojson (zmap_object , tmpdir ):
1726 x = tmpdir .join ("output.json" )
1827 zmap_object .to_geojson (x .strpath )
@@ -23,6 +32,16 @@ def test_export_to_geojson(zmap_object, tmpdir):
2332 assert [0.0 , 60.0 , 88.0 ] in d .get ("coordinates" )
2433
2534
35+ def test_export_to_geojson_pixel_is_point (zmap_object_pixel_is_point , tmpdir ):
36+ x = tmpdir .join ("output.json" )
37+ zmap_object_pixel_is_point .to_geojson (x .strpath )
38+ d = json .load (x )
39+ assert sorted (list (d .keys ())) == ["coordinates" , "type" ]
40+ assert d .get ("type" ) == "MultiPoint"
41+ assert len (d .get ("coordinates" )) == 24
42+ assert [25.0 , 175.0 , 3.0 ] in d .get ("coordinates" )
43+
44+
2645def test_export_to_wkt (zmap_object , tmpdir ):
2746 x = tmpdir .join ("output.wkt" )
2847 zmap_object .to_wkt (x .strpath )
@@ -31,6 +50,14 @@ def test_export_to_wkt(zmap_object, tmpdir):
3150 assert line .startswith ("MULTIPOINT ((0.0000000 300.0000000 nan)," )
3251
3352
53+ def test_export_to_wkt_pixel_is_point (zmap_object_pixel_is_point , tmpdir ):
54+ x = tmpdir .join ("output.wkt" )
55+ zmap_object_pixel_is_point .to_wkt (x .strpath )
56+ with open (x .strpath ) as f :
57+ line = f .readline ()
58+ assert line .startswith ("MULTIPOINT ((25.0000000 275.0000000 nan)," )
59+
60+
3461def test_export_to_wkt_with_precision (zmap_object , tmpdir ):
3562 x = tmpdir .join ("output.wkt" )
3663 zmap_object .to_wkt (x .strpath , precision = 2 )
0 commit comments