Testing GeoJSON input/output.
(self)
| 116 | self.assertEqual(geom1, geom2) |
| 117 | |
| 118 | def test_json(self): |
| 119 | "Testing GeoJSON input/output." |
| 120 | for g in self.geometries.json_geoms: |
| 121 | geom = OGRGeometry(g.wkt) |
| 122 | if not hasattr(g, "not_equal"): |
| 123 | # Loading jsons to prevent decimal differences |
| 124 | self.assertEqual(json.loads(g.json), json.loads(geom.json)) |
| 125 | self.assertEqual(json.loads(g.json), json.loads(geom.geojson)) |
| 126 | self.assertEqual(OGRGeometry(g.wkt), OGRGeometry(geom.json)) |
| 127 | # Test input with some garbage content (but valid json) (#15529) |
| 128 | geom = OGRGeometry( |
| 129 | '{"type": "Point", "coordinates": [ 100.0, 0.0 ], "other": "<test>"}' |
| 130 | ) |
| 131 | self.assertIsInstance(geom, OGRGeometry) |
| 132 | |
| 133 | def test_points(self): |
| 134 | "Testing Point objects." |
nothing calls this directly
no test coverage detected