[GeoNode-users] geonode importlayers error when metadata XML is present

Daniel Victoria daniel.victoria at gmail.com
Tue Apr 12 09:39:29 PDT 2016


Hi all,

I'm trying to populate a new geonode instance (v2.4) with some shapefiles
from another geonode (v2.4).

I have all the shapefiles in a directory so I'm inclined to use the
importlayers command. And to make things easier, I've downloaded the
metadata (ISO format, XML file) from the former geonode and placed it with
the shapefiles that will be imported.

The importlayers command fails with the following message

./par_a01_2013_inventoryplotsubplot.shp
================
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/geonode/layers/utils.py",
line 588, in upload
    title=title
  File "/usr/local/lib/python2.7/dist-packages/geonode/layers/utils.py",
line 429, in file_upload
    vals, regions, keywords = set_metadata(xml_file.read())
  File "/usr/local/lib/python2.7/dist-packages/geonode/layers/metadata.py",
line 62, in set_metadata
    vals, regions, keywords = dc2dict(exml)
  File "/usr/local/lib/python2.7/dist-packages/geonode/layers/metadata.py",
line 198, in dc2dict
    vals['date'] = sniff_date(mdata.modified)
  File "/usr/local/lib/python2.7/dist-packages/geonode/layers/metadata.py",
line 222, in sniff_date
    return datetime.datetime.strptime(datestr.strip(), dfmt)
AttributeError: 'NoneType' object has no attribute 'strip'

If I remove the XML file from the shapefile directory, the importlayers
command works OK.

Any idea what is wrong? Attached is the offending metadata file, just in
case.
Cheers
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20160412/23bb1fe9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: par_a01_2013_las_boundary.xml
Type: text/xml
Size: 6098 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20160412/23bb1fe9/attachment.xml>


More information about the geonode-users mailing list