Skip to content

Implement GDAL-related updates in Django 4.2 #1525

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

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions django-stubs/contrib/gis/db/models/functions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ class Envelope(GeomOutputGeoFunc):
class ForcePolygonCW(GeomOutputGeoFunc):
arity: int

class FromWKB(GeoFunc):
output_field: Any
arity: int

class FromWKT(GeoFunc):
output_field: Any
arity: int

class GeoHash(GeoFunc):
output_field: Any
def __init__(self, expression: Any, precision: Any | None = ..., **extra: Any) -> None: ...
Expand All @@ -112,6 +120,10 @@ class Intersection(OracleToleranceMixin, GeomOutputGeoFunc):
arity: int
geom_param_pos: Any

class IsEmpty(GeoFuncMixin, StandardTransform):
lookup_name: str
output_field: Any

class IsValid(OracleToleranceMixin, GeoFuncMixin, StandardTransform):
lookup_name: str
output_field: Any
Expand Down
5 changes: 4 additions & 1 deletion django-stubs/contrib/gis/gdal/raster/source.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from collections.abc import Sequence
from ctypes import c_void_p
from pathlib import Path
from typing import Any

from django.contrib.gis.gdal.driver import Driver
Expand All @@ -20,7 +22,7 @@ class TransformPoint(list[Sequence[float]]):

class GDALRaster(GDALRasterBase):
destructor: Any
def __init__(self, ds_input: Any, write: bool = ...) -> None: ...
def __init__(self, ds_input: str | Path | bytes | dict | c_void_p, write: bool = ...) -> None: ...
def __del__(self) -> None: ...
@property
def vsi_buffer(self) -> bytes | None: ...
Expand Down Expand Up @@ -57,6 +59,7 @@ class GDALRaster(GDALRasterBase):
@property
def bands(self) -> BandList: ...
def warp(self, ds_input: Any, resampling: str = ..., max_error: float = ...) -> GDALRaster: ...
def clone(self, name: str | None = ...) -> GDALRaster: ...
def transform(
self,
srs: SpatialReference | int | str,
Expand Down