Skip to content

Commit

Permalink
[Fixes GeoNode#1064] Expose supported upload file formats as configur…
Browse files Browse the repository at this point in the history
…ations
  • Loading branch information
mattiagiupponi committed Jul 5, 2022
1 parent 87357f3 commit 3245b39
Showing 1 changed file with 2 additions and 51 deletions.
53 changes: 2 additions & 51 deletions geonode_mapstore_client/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from django.conf import settings

from geonode.upload.utils import get_max_upload_size, get_max_upload_parallelism_limit
from geonode.utils import get_supported_file_types

def resource_urls(request):
"""Global values to pass to templates"""
Expand Down Expand Up @@ -55,56 +56,6 @@ def resource_urls(request):
dict()).get(
'MOSAIC_ENABLED',
False),
'SUPPORTED_DATASET_FILE_TYPES': getattr(settings, "MAPSTORE_SUPPORTED_DATASET_FILE_TYPES", [
{
"id": "shp",
"label": "ESRI Shapefile",
"format": "vector",
"ext": ["shp"],
"requires": ["shp", "prj", "dbf", "shx"],
"optional": ["xml", "sld"]
},
{
"id": "tiff",
"label": "GeoTIFF",
"format": "raster",
"ext": ["tiff", "tif"],
"mimeType": ["image/tiff"],
"optional": ["xml", "sld"]
},
{
"id": "csv",
"label": "Comma Separated Value (CSV)",
"format": "vector",
"ext": ["csv"],
"mimeType": ["text/csv"],
"optional": ["xml", "sld"]
},
{
"id": "zip",
"label": "Zip Archive",
"format": "archive",
"ext": ["zip"],
"mimeType": ["application/zip"],
"optional": ["xml", "sld"]
},
{
"id": "xml",
"label": "XML Metadata File",
"format": "metadata",
"ext": ["xml"],
"mimeType": ["application/json"],
"needsFiles": ["shp", "prj", "dbf", "shx", "csv", "tiff", "zip", "sld"]
},
{
"id": "sld",
"label": "Styled Layer Descriptor (SLD)",
"format": "metadata",
"ext": ["sld"],
"mimeType": ["application/json"],
"needsFiles": ["shp", "prj", "dbf", "shx", "csv", "tiff", "zip", "xml"]
}
]
)
'SUPPORTED_DATASET_FILE_TYPES': get_supported_file_types()
}
return defaults

0 comments on commit 3245b39

Please sign in to comment.