-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch from rasterio/gdal to pyproj #58
Conversation
@@ -13,7 +13,7 @@ jobs: | |||
runs-on: ubuntu-latest | |||
strategy: | |||
matrix: | |||
python-version: [3.6, 3.7, 3.8, 3.9] | |||
python-version: [3.7, 3.8, 3.9] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyproj only supports >=3.7
@@ -56,4 +56,4 @@ def register( | |||
return TileMatrixSets({**self.tms, **new_tms}) | |||
|
|||
|
|||
tms = TileMatrixSets(deepcopy(default_tms)) # noqa | |||
tms = TileMatrixSets(copy(default_tms)) # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deepcopy complained about the pyproj Transformer. Used copy
and it worked 🤷♂️
@@ -121,13 +124,25 @@ class TileMatrixSet(BaseModel): | |||
wellKnownScaleSet: Optional[AnyHttpUrl] = None | |||
boundingBox: Optional[TMSBoundingBox] | |||
tileMatrix: List[TileMatrix] | |||
_to_wgs84: Transformer = PrivateAttr() | |||
_from_wgs84: Transformer = PrivateAttr() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we initialize the transformers once!
tms = morecantile.tms.get("WebMercatorQuad") | ||
with pytest.warns(PointOutsideTMSBounds): | ||
xy = tms.xy(0.0, -90) | ||
assert xy.x == float("inf") | ||
assert xy.y == float("-inf") | ||
assert xy.y == float("inf") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inf or -inf 🤷♂️
b61b60d
to
417a3c3
Compare
e0ef922
to
8860250
Compare
as seen in #56 and #57 we are constantly fighting with change in rasterio/gdal/proj. The main problem is that we used rasterio (which is a raster library) to access Proj C libs via GDAL. It worked ok, and we choose this to avoid mixing PROJ version used in the code base (for a long time rasterio wheels where using PROJ 6 while pyproj was already using PROJ>=7).
This PR replace any rasterio calls by pyproj.