Skip to content

Commit

Permalink
[3.2.x] Fixed #33030 -- Fixed broken links to GDAL docs.
Browse files Browse the repository at this point in the history
Backport of ed317e7 from main
  • Loading branch information
MaertHaekkinen authored and felixxm committed Aug 23, 2021
1 parent d29a9ed commit 358e65a
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions django/contrib/gis/gdal/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
from django.utils.encoding import force_bytes, force_str


# For more information, see the OGR C API source code:
# https://www.gdal.org/ogr__api_8h.html
# For more information, see the OGR C API documentation:
# https://gdal.org/api/vector_c_api.html
#
# The OGR_DS_* routines are relevant here.
class DataSource(GDALBase):
Expand Down
9 changes: 5 additions & 4 deletions django/contrib/gis/gdal/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
class Driver(GDALBase):
"""
Wrap a GDAL/OGR Data Source Driver.
For more information, see the C API source code:
https://www.gdal.org/gdal_8h.html - https://www.gdal.org/ogr__api_8h.html
For more information, see the C API documentation:
https://gdal.org/api/vector_c_api.html
https://gdal.org/api/raster_c_api.html
"""

# Case-insensitive aliases for some GDAL/OGR Drivers.
# For a complete list of original driver names see
# https://www.gdal.org/ogr_formats.html (vector)
# https://www.gdal.org/formats_list.html (raster)
# https://gdal.org/drivers/vector/
# https://gdal.org/drivers/raster/
_alias = {
# vector
'esri': 'ESRI Shapefile',
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/gdal/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# The OGR definition of an Envelope is a C structure containing four doubles.
# See the 'ogr_core.h' source file for more information:
# https://www.gdal.org/ogr__core_8h_source.html
# https://gdal.org/doxygen/ogr__core_8h_source.html
class OGREnvelope(Structure):
"Represent the OGREnvelope C Structure."
_fields_ = [("MinX", c_double),
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/gdal/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SRSException(Exception):
}

# CPL Error Codes
# https://www.gdal.org/cpl__error_8h.html
# https://gdal.org/api/cpl.html#cpl-error-h
CPLERR_DICT = {
1: (GDALException, 'AppDefined'),
2: (GDALException, 'OutOfMemory'),
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/gdal/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


# For more information, see the OGR C API source code:
# https://www.gdal.org/ogr__api_8h.html
# https://gdal.org/api/vector_c_api.html
#
# The OGR_F_* routines are relevant here.
class Feature(GDALBase):
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/gdal/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


# For more information, see the OGR C API source code:
# https://www.gdal.org/ogr__api_8h.html
# https://gdal.org/api/vector_c_api.html
#
# The OGR_Fld_* routines are relevant here.
class Field(GDALBase):
Expand Down
6 changes: 3 additions & 3 deletions django/contrib/gis/gdal/geometries.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
The OGRGeometry is a wrapper for using the OGR Geometry class
(see https://www.gdal.org/classOGRGeometry.html). OGRGeometry
may be instantiated when reading geometries from OGR Data Sources
(see https://gdal.org/api/ogrgeometry_cpp.html#_CPPv411OGRGeometry).
OGRGeometry may be instantiated when reading geometries from OGR Data Sources
(e.g. SHP files), or when given OGC WKT (a string).
While the 'full' API is not present yet, the API is "pythonic" unlike
Expand Down Expand Up @@ -53,7 +53,7 @@


# For more information, see the OGR C API source code:
# https://www.gdal.org/ogr__api_8h.html
# https://gdal.org/api/vector_c_api.html
#
# The OGR_G_* routines are relevant here.
class OGRGeometry(GDALBase):
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/gdal/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


# For more information, see the OGR C API source code:
# https://www.gdal.org/ogr__api_8h.html
# https://gdal.org/api/vector_c_api.html
#
# The OGR_L_* routines are relevant here.
class Layer(GDALBase):
Expand Down
8 changes: 4 additions & 4 deletions django/contrib/gis/gdal/prototypes/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
)

# For more detail about c function names and definitions see
# https://gdal.org/gdal_8h.html
# https://gdal.org/gdalwarper_8h.html
# https://www.gdal.org/gdal__utils_8h.html
# https://gdal.org/api/raster_c_api.html
# https://gdal.org/doxygen/gdalwarper_8h.html
# https://gdal.org/api/gdal_utils.html

# Prepare partial functions that use cpl error codes
void_output = partial(void_output, cpl=True)
Expand Down Expand Up @@ -102,7 +102,7 @@
)

# Create VSI gdal raster files from in-memory buffers.
# https://gdal.org/cpl__vsi_8h.html
# https://gdal.org/api/cpl.html#cpl-vsi-h
create_vsi_file_from_mem_buffer = voidptr_output(std_call('VSIFileFromMemBuffer'), [c_char_p, c_void_p, c_int, c_int])
get_mem_buffer_from_vsi_file = voidptr_output(std_call('VSIGetMemFileBuffer'), [c_char_p, POINTER(c_int), c_bool])
unlink_vsi_file = int_output(std_call('VSIUnlink'), [c_char_p])
4 changes: 2 additions & 2 deletions django/contrib/gis/gdal/raster/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
c_double, c_float, c_int16, c_int32, c_ubyte, c_uint16, c_uint32,
)

# See https://www.gdal.org/gdal_8h.html#a22e22ce0a55036a96f652765793fb7a4
# See https://gdal.org/api/raster_c_api.html#_CPPv412GDALDataType
GDAL_PIXEL_TYPES = {
0: 'GDT_Unknown', # Unknown or unspecified type
1: 'GDT_Byte', # Eight bit unsigned integer
Expand Down Expand Up @@ -44,7 +44,7 @@
'Mode': 6,
}

# See https://www.gdal.org/gdal_8h.html#ace76452d94514561fffa8ea1d2a5968c
# See https://gdal.org/api/raster_c_api.html#_CPPv415GDALColorInterp
GDAL_COLOR_TYPES = {
0: 'GCI_Undefined', # Undefined, default value, i.e. not known
1: 'GCI_GrayIndex', # Greyscale
Expand Down
2 changes: 1 addition & 1 deletion tests/gis_tests/inspectapp/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def get_ogr_db_string():
db = connections.databases['default']

# Map from the django backend into the OGR driver name and database identifier
# https://www.gdal.org/ogr/ogr_formats.html
# https://gdal.org/drivers/vector/
#
# TODO: Support Oracle (OCI).
drivers = {
Expand Down

0 comments on commit 358e65a

Please sign in to comment.