kartoza / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
http://geonode.org/
GNU General Public License v3.0
8 stars 17 forks source link

Error showing Buildings layer #40

Closed timlinux closed 8 years ago

timlinux commented 8 years ago

I am trying to view the buildings layer:

http://geonode.kartoza.com/layers/geonode%3Abuildings

Request Method: GET
Request URL:    http://geonode/layers/geonode:buildings
Django Version: 1.6.11
Exception Type: IndexError
Exception Value:    
list index out of range
Exception Location: /home/web/geonode/geonode/base/models.py in language_title, line 617
Python Executable:  /home/geonode/.venvs/geonode/bin/python
Python Version: 2.7.9
Python Path:    
['/home/web/geonode',
 '/home/geonode/.venvs/geonode/local/lib/python2.7/site-packages/GDAL-1.10.0-py2.7-linux-x86_64.egg',
 '/home/geonode/.venvs/geonode/lib/python2.7',
 '/home/geonode/.venvs/geonode/lib/python2.7/plat-x86_64-linux-gnu',
 '/home/geonode/.venvs/geonode/lib/python2.7/lib-tk',
 '/home/geonode/.venvs/geonode/lib/python2.7/lib-old',
 '/home/geonode/.venvs/geonode/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/home/geonode/.venvs/geonode/local/lib/python2.7/site-packages',
 '/home/web/geonode',
 '/home/web/geonode',
 '/home/web/geonode']
Server time:    Fri, 6 May 2016 01:49:48 -0500

Template error:

136     <dd>{{ resource.edition}}</dd>
137     {% endif %}
138 
139     {% if resource.purpose %}
140     <dt>{% trans "Purpose" %}</dt>
141     <dd>{{ resource.purpose|escape|urlize|linebreaks|safe|truncatechars:160 }}</dd>
142     {% endif %}
143 
144     {% if resource.language %}
145     <dt>{% trans "Language" %}</dt>
146     <dd>{{ resource.language_title }}</dd>
147     {% endif %}
148 
149     {% if resource.temporal_extent_start and resource.temporal_extent_end %}
150     <dt>{% trans "Temporal Extent" %}</dt>
151     <dd>{{ resource.temporal_extent_start }} - {{ resource.temporal_extent_end }}</dd>
152     {% endif %}
153 
154     {% if resource.data_quality_statement %}
155     <dt>{% trans "Data Quality" %}</dt>
156     <dd>{{ resource.data_quality_statement }}</dd>
ismailsunni commented 8 years ago

Hi @timlinux After investigating it, the reason of the problem is data specific. The language the the layer has is u'English', and geonode can't find. The right format is u'eng'. I have fixed manually the language, and it's working fine now. Please check, and close the ticket if it's fixed for you.

Gustry commented 8 years ago

Does it come from when we import the layer ? What happen if we import the wrong layer again ?

ismailsunni commented 8 years ago

@Gustry I think so. Hmm, we should make a patch to geonode then. It comes from the geonode itself.

@timlinux can you send me the layer for testing?

timlinux commented 8 years ago

buildings.zip

But strangely it is not giving the error anymore. See

http://geonode.kartoza.com/layers/geonode%3Abuildings_1

ismailsunni commented 8 years ago

Update: After discussing with @Gustry , the problem lies on the template of osm-downloader. @Gustry has fixed it in his PR here : https://github.com/kartoza/osm-reporter/pull/85/files

That's why, the problem only occurs when you upload layer from osm downloader. And it get fixed later because you open it in QGIS with InaSAFE (since the template in InaSAFE is correct).

Closing this issue.