Skip to content

CRS equality operator #45

@dazza-codes

Description

@dazza-codes

Can PyCRS pass this test?

import rasterio
import pycrs

def test_pycrs_parses_ogc_wkt():
    # data from https://spatialreference.org/ref/epsg/4326/
    epsg_4326_to_ogc_wkt = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]'
    rasterio_ogc_wkt = rasterio.crs.CRS.from_string('EPSG:4326').to_wkt(morph_to_esri_dialect=False)
    epsg_4326_ogc_crs = pycrs.parse.from_ogc_wkt(epsg_4326_to_ogc_wkt)
    rasterio_ogc_crs = pycrs.parse.from_ogc_wkt(rasterio_ogc_wkt)
    assert rasterio_ogc_crs == epsg_4326_ogc_crs

The aim of this test is to check for the equality of some CRS regardless of what tools have serialized the CRS, assuming that it should be an OGC WKT serialization.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions