Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabular datasets do not include a download_url #16

Closed
ridoo opened this issue Jun 14, 2024 · 3 comments
Closed

Tabular datasets do not include a download_url #16

ridoo opened this issue Jun 14, 2024 · 3 comments

Comments

@ridoo
Copy link
Member

ridoo commented Jun 14, 2024

See #4

DatasetDownloadHandler: download_url()

@ridoo
Copy link
Member Author

ridoo commented Jun 14, 2024

Adding tabular to DatasetDownloadHandler: download_url() will add proper links to /datasets response:

"download_urls": [
    {
        "url": "/datasets/geonode:horizon_data/dataset_download",
        "ajax_safe": true,
        "default": true
    }
]

However, the download link responds with:

{
    "error": "NoApplicableCode: Process failed during execution\norg.geotools.process.ProcessException: Don't know how to encode in mime type image/tiff\nDon't know how to encode in mime type image/tiff"
}

ridoo added a commit to GeoNodeUserGroup-DE/geonode that referenced this issue Jun 14, 2024
@ridoo ridoo closed this as completed Jun 14, 2024
@ridoo
Copy link
Member Author

ridoo commented Jun 14, 2024

More testing reveals that there's both download_urls (plural) and download_url (singular). Not sure why this is the case. However, the current fix only considered the plural case:

https://development.demo.geonode.org/api/v2/datasets?exclude[]=*&include[]=download_url&include[]=download_urls

{
    "links": {
        "next": null,
        "previous": null
    },
    "total": 2,
    "page": 1,
    "page_size": 10,
    "datasets": [
        {
            "download_urls": [
                {
                    "url": "/datasets/geonode:horizon_data/dataset_download",
                    "ajax_safe": true,
                    "default": true
                }
            ],
            "download_url": null
        },
        {
            "download_urls": [
                {
                    "url": "/datasets/geonode:laboratory_data/dataset_download",
                    "ajax_safe": true,
                    "default": true
                }
            ],
            "download_url": null
        }
    ]
}

The single case has to be fixed to, of course.

@ridoo ridoo reopened this Jun 14, 2024
ridoo added a commit to GeoNodeUserGroup-DE/geonode that referenced this issue Jun 14, 2024
@ridoo
Copy link
Member Author

ridoo commented Jun 14, 2024

Fixed

@ridoo ridoo closed this as completed Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant