[GeoNode-devel] Behavior of distribution_url, distribution_description?

Tom Kralidis tomkralidis at gmail.com
Wed Feb 10 18:38:35 PST 2016

Hi Bruce: sorry for the delayed response, comments interleaved:

On Fri, Feb 5, 2016 at 6:42 PM, Bruce Crevensten
<becrevensten at alaska.edu> wrote:
> I'm curious about the intended (and actual) behavior of the distribution_url
> and distribution_description metadata properties for layers.
> I expected to be able to use GeoNode's layer editor (Layer > pick a layer >
> Edit Layer > Metadata) in order to manage those fields, but I found that the
> behavior was somewhat unpredictable -- either it always reset the
> distribution_url to a default GeoNode point, and the url_description field
> to "Web address (URL)", _or_ for some layers it's worked fine to edit them!
> I can't discern the difference layers that I can edit and those I cannot,
> and a colleague gets different behavior with the same layers I'm using.
> I traced the relevant code to:
> geonode/geonode/catalogue/models.py:
>   112          if len(onlineresources) == 1:
>   113              res = onlineresources[0]
>   114:             instance.distribution_url = res.url
>   115              instance.distribution_description = res.description
> I'm unclear on how this `onlineresource` is getting set (appears to happen
> by default, but not always?) and/or if the intent of the Metadata editor is
> to allow this to be overwritten -- and if so, is this a bug?

distribution_url and distribution_description are autopopulated [1] from either
[a] GeoNode's metadata link objects or [b] derived from combining
other objects in
the absence of [a].

Having said this, I believe these fields were in the codebase prior to GeoNode's
rich metadata links model [2], and as such we should probably remove them. I've
opened a ticket [3] to track this.



[1] https://github.com/GeoNode/geonode/blob/master/geonode/catalogue/models.py#L109-L123
[2] https://github.com/GeoNode/geonode/blob/master/geonode/base/models.py#L689
[3] https://github.com/GeoNode/geonode/issues/2422

> Thanks!
> --
> Bruce Crevensten

More information about the geonode-devel mailing list