Skip to content

Map all resources as downloadUrls #5

@thatbudakguy

Description

@thatbudakguy

Instead of looking for the primary download link for spatial data, just add a labelled entry to the downloadUrl reference for every downloadable resource.

org.humdata/mapper.rb

Lines 213 to 222 in cb6080a

# Look for the primary download link
resources = @dataset['resources'] || []
spatial_formats = %w[GeoTIFF Shapefile GeoJSON KML KMZ GML GPX]
spatial_resource = resources.find { |r| spatial_formats.include?(r['format']) } || resources.first
if spatial_resource && spatial_resource['download_url'].present?
refs['http://schema.org/downloadUrl'] = [
{url: spatial_resource['download_url'], label: spatial_resource['format']}
]
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions