Check the compatibility of the given spatial reference object.
(self, source_srs)
| 308 | self.fields[field_name] = fields_val |
| 309 | |
| 310 | def check_srs(self, source_srs): |
| 311 | "Check the compatibility of the given spatial reference object." |
| 312 | |
| 313 | if isinstance(source_srs, SpatialReference): |
| 314 | sr = source_srs |
| 315 | elif isinstance(source_srs, self.spatial_backend.spatial_ref_sys()): |
| 316 | sr = source_srs.srs |
| 317 | elif isinstance(source_srs, (int, str)): |
| 318 | sr = SpatialReference(source_srs) |
| 319 | else: |
| 320 | # Otherwise just pulling the SpatialReference from the layer |
| 321 | sr = self.layer.srs |
| 322 | |
| 323 | if not sr: |
| 324 | raise LayerMapError("No source reference system defined.") |
| 325 | else: |
| 326 | return sr |
| 327 | |
| 328 | def check_unique(self, unique): |
| 329 | "Check the `unique` keyword parameter -- may be a sequence or string." |
no test coverage detected