Skip to content

Commit

Permalink
Merge pull request #469 from geoadmin/feat_PB-1071_copc_mime_type
Browse files Browse the repository at this point in the history
PB-1071: add new mime types for Zipped LAS and Cloud Optimized Point
  • Loading branch information
ltclm authored Nov 5, 2024
2 parents 830fd61 + edf32e7 commit 5976c9f
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 0 deletions.
246 changes: 246 additions & 0 deletions app/stac_api/migrations/0053_alter_asset_media_type_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
# Generated by Django 5.0.8 on 2024-11-04 09:52

from django.db import migrations
from django.db import models


class Migration(migrations.Migration):

dependencies = [
('stac_api', '0052_asset_add_del_asset_item_file_size_trigger_and_more'),
]

operations = [
migrations.AlterField(
model_name='asset',
name='media_type',
field=models.CharField(
choices=
[(
'application/vnd.apache.parquet',
'Apache Parquet column-oriented data file format (application/vnd.apache.parquet)'
),
(
'application/x.ascii-grid+zip',
'Zipped ESRI ASCII raster format (.asc) (application/x.ascii-grid+zip)'
),
('application/x.ascii-xyz+zip', 'Zipped XYZ (.xyz) (application/x.ascii-xyz+zip)'),
('application/x.e00+zip', 'Zipped e00 (application/x.e00+zip)'),
('application/x.geotiff+zip', 'Zipped GeoTIFF (application/x.geotiff+zip)'),
('image/tiff; application=geotiff', 'GeoTIFF (image/tiff; application=geotiff)'),
('application/x.tiff+zip', 'Zipped TIFF (application/x.tiff+zip)'),
('application/x.png+zip', 'Zipped PNG (application/x.png+zip)'),
('application/x.jpeg+zip', 'Zipped JPEG (application/x.jpeg+zip)'),
(
'application/vnd.google-earth.kml+xml',
'KML (application/vnd.google-earth.kml+xml)'
),
(
'application/vnd.google-earth.kmz',
'Zipped KML (application/vnd.google-earth.kmz)'
), ('application/x.dxf+zip', 'Zipped DXF (application/x.dxf+zip)'),
('application/gml+xml', 'GML (application/gml+xml)'),
('application/x.gml+zip', 'Zipped GML (application/x.gml+zip)'),
('application/vnd.las', 'LIDAR (application/vnd.las)'),
('application/vnd.laszip', 'Zipped LIDAR (application/vnd.laszip)'),
('application/x.vnd.las+zip', 'Zipped LAS (application/x.vnd.las+zip)'),
(
'application/vnd.laszip+copc',
'Cloud Optimized Point Cloud (COPC) (application/vnd.laszip+copc)'
),
('application/x.shapefile+zip',
'Zipped Shapefile (application/x.shapefile+zip)'), (
'application/x.filegdb+zip',
'Zipped File Geodatabase (application/x.filegdb+zip)'
),
(
'application/x.filegdbp+zip',
'Zipped File Geodatabase (ArcGIS Pro) (application/x.filegdbp+zip)'
),
(
'application/x.ms-access+zip',
'Zipped Personal Geodatabase (application/x.ms-access+zip)'
), ('application/x.ms-excel+zip', 'Zipped Excel (application/x.ms-excel+zip)'),
('application/x.tab+zip', 'Zipped Mapinfo-TAB (application/x.tab+zip)'),
(
'application/x.tab-raster+zip',
'Zipped Mapinfo-Raster-TAB (application/x.tab-raster+zip)'
), ('application/x.csv+zip',
'Zipped CSV (application/x.csv+zip)'), ('text/csv', 'CSV (text/csv)'),
('application/geopackage+sqlite3',
'Geopackage (application/geopackage+sqlite3)'), (
'application/x.geopackage+zip',
'Zipped Geopackage (application/x.geopackage+zip)'
), ('application/geo+json', 'GeoJSON (application/geo+json)'),
('application/x.geojson+zip', 'Zipped GeoJSON (application/x.geojson+zip)'),
(
'application/x.interlis; version=2.3',
'Interlis 2 (application/x.interlis; version=2.3)'
),
(
'application/x.interlis+zip; version=2.3',
'Zipped XTF (2.3) (application/x.interlis+zip; version=2.3)'
),
(
'application/x.interlis; version=2.4',
'Interlis 2 (application/x.interlis; version=2.4)'
),
(
'application/x.interlis+zip; version=2.4',
'Zipped XTF (2.4) (application/x.interlis+zip; version=2.4)'
),
(
'application/x.interlis; version=1',
'Interlis 1 (application/x.interlis; version=1)'
),
(
'application/x.interlis+zip; version=1',
'Zipped ITF (application/x.interlis+zip; version=1)'
),
(
'image/tiff; application=geotiff; profile=cloud-optimized',
'Cloud Optimized GeoTIFF (COG) (image/tiff; application=geotiff; profile=cloud-optimized)'
), ('application/pdf', 'PDF (application/pdf)'),
('application/x.pdf+zip', 'Zipped PDF (application/x.pdf+zip)'),
('application/json', 'JSON (application/json)'),
('application/x.json+zip', 'Zipped JSON (application/x.json+zip)'),
('application/x-netcdf', 'NetCDF (application/x-netcdf)'),
('application/x.netcdf+zip', 'Zipped NetCDF (application/x.netcdf+zip)'),
('application/xml', 'XML (application/xml)'),
('application/x.xml+zip', 'Zipped XML (application/x.xml+zip)'),
(
'application/vnd.mapbox-vector-tile',
'mbtiles (application/vnd.mapbox-vector-tile)'
), ('text/plain',
'Text (text/plain)'), ('text/x.plain+zip', 'Zipped text (text/x.plain+zip)'),
('application/x.dwg+zip', 'Zipped DWG (application/x.dwg+zip)'),
('application/zip',
'Generic Zip File (application/zip)'), ('image/tiff', 'TIFF (image/tiff)'),
('image/jpeg', 'JPEG (image/jpeg)'), ('image/png', 'PNG (image/png)'),
('application/vnd.sqlite3', 'sqlite (application/vnd.sqlite3)')],
help_text=
"This media type will be used as <em>Content-Type</em> header for the asset's object upon upload.</br></br><b>WARNING: when updating the Media Type, the asset's object Content-Type header is not automatically updated, it needs to be uploaded again.</b>",
max_length=200
),
),
migrations.AlterField(
model_name='collectionasset',
name='media_type',
field=models.CharField(
choices=[
(
'application/vnd.apache.parquet',
'Apache Parquet column-oriented data file format (application/vnd.apache.parquet)'
),
(
'application/x.ascii-grid+zip',
'Zipped ESRI ASCII raster format (.asc) (application/x.ascii-grid+zip)'
),
(
'application/x.ascii-xyz+zip',
'Zipped XYZ (.xyz) (application/x.ascii-xyz+zip)'
), ('application/x.e00+zip', 'Zipped e00 (application/x.e00+zip)'),
('application/x.geotiff+zip', 'Zipped GeoTIFF (application/x.geotiff+zip)'), (
'image/tiff; application=geotiff',
'GeoTIFF (image/tiff; application=geotiff)'
), ('application/x.tiff+zip', 'Zipped TIFF (application/x.tiff+zip)'),
('application/x.png+zip', 'Zipped PNG (application/x.png+zip)'),
('application/x.jpeg+zip', 'Zipped JPEG (application/x.jpeg+zip)'),
(
'application/vnd.google-earth.kml+xml',
'KML (application/vnd.google-earth.kml+xml)'
),
(
'application/vnd.google-earth.kmz',
'Zipped KML (application/vnd.google-earth.kmz)'
), ('application/x.dxf+zip', 'Zipped DXF (application/x.dxf+zip)'),
('application/gml+xml', 'GML (application/gml+xml)'),
('application/x.gml+zip', 'Zipped GML (application/x.gml+zip)'),
('application/vnd.las', 'LIDAR (application/vnd.las)'),
('application/vnd.laszip', 'Zipped LIDAR (application/vnd.laszip)'),
('application/x.vnd.las+zip', 'Zipped LAS (application/x.vnd.las+zip)'),
(
'application/vnd.laszip+copc',
'Cloud Optimized Point Cloud (COPC) (application/vnd.laszip+copc)'
), (
'application/x.shapefile+zip',
'Zipped Shapefile (application/x.shapefile+zip)'
),
(
'application/x.filegdb+zip',
'Zipped File Geodatabase (application/x.filegdb+zip)'
),
(
'application/x.filegdbp+zip',
'Zipped File Geodatabase (ArcGIS Pro) (application/x.filegdbp+zip)'
),
(
'application/x.ms-access+zip',
'Zipped Personal Geodatabase (application/x.ms-access+zip)'
), ('application/x.ms-excel+zip', 'Zipped Excel (application/x.ms-excel+zip)'),
('application/x.tab+zip', 'Zipped Mapinfo-TAB (application/x.tab+zip)'),
(
'application/x.tab-raster+zip',
'Zipped Mapinfo-Raster-TAB (application/x.tab-raster+zip)'
), ('application/x.csv+zip',
'Zipped CSV (application/x.csv+zip)'), ('text/csv', 'CSV (text/csv)'), (
'application/geopackage+sqlite3',
'Geopackage (application/geopackage+sqlite3)'
),
(
'application/x.geopackage+zip',
'Zipped Geopackage (application/x.geopackage+zip)'
), ('application/geo+json', 'GeoJSON (application/geo+json)'),
('application/x.geojson+zip', 'Zipped GeoJSON (application/x.geojson+zip)'),
(
'application/x.interlis; version=2.3',
'Interlis 2 (application/x.interlis; version=2.3)'
),
(
'application/x.interlis+zip; version=2.3',
'Zipped XTF (2.3) (application/x.interlis+zip; version=2.3)'
),
(
'application/x.interlis; version=2.4',
'Interlis 2 (application/x.interlis; version=2.4)'
),
(
'application/x.interlis+zip; version=2.4',
'Zipped XTF (2.4) (application/x.interlis+zip; version=2.4)'
),
(
'application/x.interlis; version=1',
'Interlis 1 (application/x.interlis; version=1)'
),
(
'application/x.interlis+zip; version=1',
'Zipped ITF (application/x.interlis+zip; version=1)'
),
(
'image/tiff; application=geotiff; profile=cloud-optimized',
'Cloud Optimized GeoTIFF (COG) (image/tiff; application=geotiff; profile=cloud-optimized)'
), ('application/pdf', 'PDF (application/pdf)'),
('application/x.pdf+zip', 'Zipped PDF (application/x.pdf+zip)'),
('application/json', 'JSON (application/json)'),
('application/x.json+zip', 'Zipped JSON (application/x.json+zip)'),
('application/x-netcdf', 'NetCDF (application/x-netcdf)'),
('application/x.netcdf+zip', 'Zipped NetCDF (application/x.netcdf+zip)'),
('application/xml', 'XML (application/xml)'),
('application/x.xml+zip', 'Zipped XML (application/x.xml+zip)'),
(
'application/vnd.mapbox-vector-tile',
'mbtiles (application/vnd.mapbox-vector-tile)'
), ('text/plain', 'Text (text/plain)'),
('text/x.plain+zip', 'Zipped text (text/x.plain+zip)'),
('application/x.dwg+zip', 'Zipped DWG (application/x.dwg+zip)'),
('application/zip',
'Generic Zip File (application/zip)'), ('image/tiff', 'TIFF (image/tiff)'),
('image/jpeg', 'JPEG (image/jpeg)'), ('image/png', 'PNG (image/png)'),
('application/vnd.sqlite3', 'sqlite (application/vnd.sqlite3)')
],
help_text=
"This media type will be used as <em>Content-Type</em> header for the asset's object upon upload.</br></br><b>WARNING: when updating the Media Type, the asset's object Content-Type header is not automatically updated, it needs to be uploaded again.</b>",
max_length=200
),
),
]
2 changes: 2 additions & 0 deletions app/stac_api/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
MediaType('application/x.gml+zip', 'Zipped GML', ['.zip']),
MediaType('application/vnd.las', 'LIDAR', ['.las']),
MediaType('application/vnd.laszip', 'Zipped LIDAR', ['.laz', '.zip']),
MediaType('application/x.vnd.las+zip', 'Zipped LAS', ['.zip']),
MediaType('application/vnd.laszip+copc', 'Cloud Optimized Point Cloud (COPC)', ['.zip']),
MediaType('application/x.shapefile+zip', 'Zipped Shapefile', ['.zip']),
MediaType('application/x.filegdb+zip', 'Zipped File Geodatabase', ['.zip']),
MediaType('application/x.filegdbp+zip', 'Zipped File Geodatabase (ArcGIS Pro)', ['.zip']),
Expand Down
2 changes: 2 additions & 0 deletions spec/static/spec/v0.9/openapitransactional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ tags:
| application/x.gml+zip | Zipped GML | .zip |
| application/vnd.las | LIDAR | .las |
| application/vnd.laszip | Zipped LIDAR | .laz, .zip |
| application/x.vnd.las+zip | Zipped LAS | .zip |
| application/vnd.laszip+copc | loud Optimized Point Cloud (COPC) | .zip |
| application/x.shapefile+zip | Zipped Shapefile | .zip |
| application/x.filegdb+zip | Zipped File Geodatabase | .zip |
| application/x.filegdbp+zip | Zipped File Geodatabase (ArcGIS Pro) | .zip |
Expand Down
2 changes: 2 additions & 0 deletions spec/static/spec/v1/openapitransactional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ tags:
| application/x.gml+zip | Zipped GML | .zip |
| application/vnd.las | LIDAR | .las |
| application/vnd.laszip | Zipped LIDAR | .laz, .zip |
| application/x.vnd.las+zip | Zipped LAS | .zip |
| application/vnd.laszip+copc | loud Optimized Point Cloud (COPC) | .zip |
| application/x.shapefile+zip | Zipped Shapefile | .zip |
| application/x.filegdb+zip | Zipped File Geodatabase | .zip |
| application/x.filegdbp+zip | Zipped File Geodatabase (ArcGIS Pro) | .zip |
Expand Down
2 changes: 2 additions & 0 deletions spec/transaction/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ tags:
| application/x.gml+zip | Zipped GML | .zip |
| application/vnd.las | LIDAR | .las |
| application/vnd.laszip | Zipped LIDAR | .laz, .zip |
| application/x.vnd.las+zip | Zipped LAS | .zip |
| application/vnd.laszip+copc | loud Optimized Point Cloud (COPC) | .zip |
| application/x.shapefile+zip | Zipped Shapefile | .zip |
| application/x.filegdb+zip | Zipped File Geodatabase | .zip |
| application/x.filegdbp+zip | Zipped File Geodatabase (ArcGIS Pro) | .zip |
Expand Down

0 comments on commit 5976c9f

Please sign in to comment.