geonode.upload.upload_validators

Tools for performing validation of uploaded spatial files.

Attributes

logger

ShapefileAux

Functions

_supported_type(ext, supported_types)

validate_uploaded_files(cleaned, uploaded_files, ...)

_validate_shapefile_components(possible_filenames)

Validates that a shapefile can be loaded from the input file paths

_validate_kml_bytes(kml_bytes, other_files)

validate_kml(possible_files)

Validate uploaded KML file and a possible image companion file

validate_kml_zip(kmz_django_file)

validate_kmz(kmz_django_file)

validate_shapefile(zip_django_file)

validate_raster(contents[, allow_multiple])

validate_raster_zip(zip_django_file)

Module Contents

geonode.upload.upload_validators.logger[source]
geonode.upload.upload_validators.ShapefileAux[source]
geonode.upload.upload_validators._supported_type(ext, supported_types)[source]
geonode.upload.upload_validators.validate_uploaded_files(cleaned, uploaded_files, field_spatial_types, base_file_path)[source]
geonode.upload.upload_validators._validate_shapefile_components(possible_filenames)[source]

Validates that a shapefile can be loaded from the input file paths

Parameters:

possible_files (list) – Remaining form upload contents

Raises:

forms.ValidationError

geonode.upload.upload_validators._validate_kml_bytes(kml_bytes, other_files)[source]
geonode.upload.upload_validators.validate_kml(possible_files)[source]

Validate uploaded KML file and a possible image companion file

KML files that specify vectorial data typers are uploaded standalone. However, if the KML specifies a GroundOverlay type (raster) they are uploaded together with a raster file.

geonode.upload.upload_validators.validate_kml_zip(kmz_django_file)[source]
geonode.upload.upload_validators.validate_kmz(kmz_django_file)[source]
geonode.upload.upload_validators.validate_shapefile(zip_django_file)[source]
geonode.upload.upload_validators.validate_raster(contents, allow_multiple=False)[source]
geonode.upload.upload_validators.validate_raster_zip(zip_django_file)[source]