OCHA-DAP / hdx-ckan

A repo for HDX's configurations and extensions to CKAN
Other
75 stars 24 forks source link

Add property to API call to activate or deactivate the geo-preview #3315

Open luiscape opened 9 years ago

luiscape commented 9 years ago

It would be great to have a property that specifies the creation (or not) of the geo-preview via the API call. Assuming I am creating a dataset with the method api/action/dataset_create. That method takes a JSON with all the properties of the to-be-created dataset. Adding a property to create a geo-preview could be something like:

{
  "id": "dataset_with_geo_preview",
  "name": "Dataset with Geo-preview",
  "description": "This dataset has a geo preview active.", 
  "geo_preview": true
  ...
}

In that case, CKAN would see that "geo_preview": true property and trigger the geo-preview (assuming that the user has added a zipped shapefile resource or alike). If the property is set to false then it would do nothing.

I think it would be useful to deal with datasets that contain resources with the right format, but that are organized in such a way that a geo-preview is somewhat confusing to users.

danmihaila commented 9 years ago

ping @cjhendrix and @alexandru-m-g for comments

cjhendrix commented 9 years ago

I think it's a good idea. We might also be able to use that flag in the resource create/edit interface to eliminate the dependence on magic file types for triggering geo preview.