[GeoNode-devel] Behavior of distribution_url, distribution_description?

Tom Kralidis tomkralidis at gmail.com
Sat Feb 13 06:03:15 PST 2016


Thanks for the info.  A given layer's links are automagically managed
based on the layer type and are tightly bound to GeoNode.  Here's an
example: http://demo.geonode.org/catalogue/csw?service=CSW&request=GetRecordById&version=2.0.2&elementsetname=full&id=8b79f97e-cecc-11e5-8d44-12d3d02c9b01

You could probably interact directly with the GeoNode Django admin
(/admin/base/link) for a given layer.


On Fri, Feb 12, 2016 at 2:43 PM, Bruce Crevensten
<becrevensten at alaska.edu> wrote:
> Thanks for the information, Tom!  To clarify my intent, I was hacking to use
> these fields to drive a different front-end for publishing maps with
> GeoNode, and here's how I was using the fields in that front-end:
>
> https://drive.google.com/file/d/0B78jsyYUsdOaSnJZbWUtS0RkWjQ/view?usp=sharing
>
> What I need is two key/value pairs with a known key in each case that I can
> reference in an API request for the layer (in our case, we're extending the
> API with pull request [1] below).  I'm unclear on where, via GeoNode's layer
> editor (Home > Layers > Pick a layer > Edit > Metadata), I could add that
> type of information -- or where, in general, to interact via the GUI with
> the "rich metadata links model"?
>
> Any guidance would be appreciated!
>
> [1] https://github.com/GeoNode/geonode/pull/2305
>
> On Wed, Feb 10, 2016 at 5:38 PM, Tom Kralidis <tomkralidis at gmail.com> wrote:
>>
>> 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.
>>
>> Thanks
>>
>> ..Tom
>>
>> [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
>
>
>
>
> --
> Bruce Crevensten
>
> Senior Software Engineer
> (SNAP) Scenarios Network for Alaska & Arctic Planning
> www.snap.uaf.edu


More information about the geonode-devel mailing list