You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-17Lines changed: 59 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,9 @@ to Django by providing a set of abstract, mixin API viewset classes that will
27
27
handle tile serving, fetching metadata from images, and extracting regions of
28
28
interest.
29
29
30
-
`django-large-image` is an optionally installable Django app with
30
+
`django-large-image` is an installable Django app with
31
31
a few classes that can be mixed into a Django project (or application)'s
32
-
drf-based views to provide tile serving endpoints out of the box. Notably,
32
+
drf-based viewsets to provide tile serving endpoints out of the box. Notably,
33
33
`django-large-image` is designed to work specifically with `FileField`
34
34
interfaces with development being tailored to Kitware's
35
35
[`S3FileField`](https://github.com/girder/django-s3-file-field). We are working
@@ -89,9 +89,8 @@ pip install \
89
89
90
90
## Usage
91
91
92
-
Simply install the app and mixin the `LargeImageViewSetMixin` class to your
93
-
existing `django-rest-framework` viewsets and specify the `FILE_FIELD_NAME` as
94
-
the string name of the `FileField` in which your image data are saved.
92
+
Simply install the app and mixin one of the mixing classes to your
93
+
existing `django-rest-framework` viewset.
95
94
96
95
```py
97
96
# settings.py
@@ -101,11 +100,24 @@ INSTALLED_APPS = [
101
100
]
102
101
```
103
102
103
+
The following are the provided mixin classes and their use case:
104
+
105
+
-`LargeImageMixin`: for use with a standard, non-detail `ViewSet`. Users must implement `get_path()`
106
+
-`LargeImageDetailMixin`: for use with a detail viewset like `GenericViewSet`. Users must implement `get_path()`
107
+
-`LargeImageFileDetailMixin`: (most commonly used) for use with a detail viewset like `GenericViewSet` where the associated model has a `FileField` storing the image data.
108
+
-`LargeImageVSIFileDetailMixin`: (geospatial) for use with a detail viewset like `GenericViewSet` where the associated model has a `FileField` storing the image data that is intended to be read with GDAL. This will access the data over GDAL's Virtual File System interface (a VSI path).
109
+
110
+
Most users will want to use `LargeImageFileDetailMixin` and so the following
111
+
example demonstrate how to use it:
112
+
113
+
Specify the `FILE_FIELD_NAME` as the string name of the `FileField` in which
114
+
your image data are saved on the associated model.
115
+
104
116
```py
105
117
# viewsets.py
106
-
from django_large_image.rest importLargeImageViewSetMixin
118
+
from django_large_image.rest importLargeImageFileDetailMixin
0 commit comments