# HG changeset patch # User fknauft # Date 1327516399 -3600 # Node ID 52b1247140b76a4f12c53ed0b33811d5164ac3ae # Parent 3a10287447b170cd8422fcf74dc73d843baccea2 Multilayer for Europeana4D diff -r 3a10287447b1 -r 52b1247140b7 RestDbGisApi.py --- a/RestDbGisApi.py Thu Dec 01 13:48:56 2011 +0100 +++ b/RestDbGisApi.py Wed Jan 25 19:33:19 2012 +0100 @@ -315,18 +315,25 @@ desc = '' timestring = '' - beg_yr = '' - end_yr = '' + beg_yr = '-9999' + end_yr = '9999' from_year = '' until_year = '' sql = "SELECT field_name FROM public.gis_table_meta_rows WHERE table_name = %s and gis_type = %s" # from_year and until_year in metadata first - res = self.executeSQL(sql, (table,'from_year')) - if len(res['rows']) > 0: - from_year = res['rows'][0][0] - res = self.executeSQL(sql, (table,'until_year')) - if len(res['rows']) > 0: - until_year = res['rows'][0][0] + try: + res = self.executeSQL(sql, (table,'from_year')) + if len(res['rows']) > 0: + from_year = res['rows'][0][0] + except: + from_year = "from_year_dummy" + try: + res = self.executeSQL(sql, (table,'until_year')) + if len(res['rows']) > 0: + until_year = res['rows'][0][0] + except: + until_year = "until_year_dummy" + for i in range (len(dataset)): value = dataset[i] @@ -371,11 +378,10 @@ #kmlPlace['description'] = ""%desc - if beg_yr!='': - if end_yr!='': + if end_yr!='9999': kmlPlace['TimeSpan0'] = '%s'%beg_yr kmlPlace['TimeSpan1'] = '%s'%end_yr - else: + else: kmlPlace['TimeStamp'] = '%s'%beg_yr if geomField=='point': diff -r 3a10287447b1 -r 52b1247140b7 RestDbInterface.py --- a/RestDbInterface.py Thu Dec 01 13:48:56 2011 +0100 +++ b/RestDbInterface.py Wed Jan 25 19:33:19 2012 +0100 @@ -396,7 +396,8 @@ attrString=attrString+"ST_AsText("+name[0]+")," not_added=False if not_added: - attrString=attrString+name[0]+"," + if name[0].find('pg.dropped')==-1: + attrString=attrString+name[0]+"," attrString=str(attrString).rsplit(",",1)[0] #to remove last "," if sortBy: data = self.executeSQL('select %s from "%s"."%s" order by %s'%(attrString,schema,table,sortBy)) diff -r 3a10287447b1 -r 52b1247140b7 gis_gui/blocks/home.html.pt --- a/gis_gui/blocks/home.html.pt Thu Dec 01 13:48:56 2011 +0100 +++ b/gis_gui/blocks/home.html.pt Wed Jan 25 19:33:19 2012 +0100 @@ -7,41 +7,41 @@