changeset 95:75229d2567ba

Merge with 893efd0ac54b719bf16049c66d0d8739acd242f3
author fknauft
date Wed, 26 Jan 2011 17:17:17 +0100
parents e76dd62f93fd (diff) 893efd0ac54b (current diff)
children a7d94f1a1429
files gis_gui/intro.pt
diffstat 5 files changed, 36 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/.project	Wed Jan 12 19:20:11 2011 +0100
+++ b/.project	Wed Jan 26 17:17:17 2011 +0100
@@ -7,12 +7,19 @@
 	</projects>
 	<buildSpec>
 		<buildCommand>
-			<name>org.python.pydev.PyDevBuilder</name>
+			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
 			<arguments>
 			</arguments>
 		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.python.pydev.pythonNature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
 	</natures>
 </projectDescription>
--- a/RestDbGisApi.py	Wed Jan 12 19:20:11 2011 +0100
+++ b/RestDbGisApi.py	Wed Jan 26 17:17:17 2011 +0100
@@ -190,24 +190,34 @@
         
         if (gisIdField is None) and (latField is None or lonField is None):
             # no fields given - choose automagically
+            sql = 'SELECT field_name FROM public.gis_table_meta_rows WHERE table_name = %s and gis_type = %s'
             # gis id in metadata first
-            #SQL='SELECT "attribute with gis_id" FROM public.metadata WHERE tablename = %s'
-            sql = 'SELECT field_name FROM public.gis_table_meta_rows WHERE table_name = %s and gis_type = %s'
             res = self.executeSQL(sql, (table,'gis_id'))
             if len(res['rows']) > 0:
                 gisIdField = res['rows'][0][0]
             else:
-                logging.warning("no entry in metadata table for table %s"%table)
-                # try field names
-                if 'latitude' in fieldMap and 'longitude' in fieldMap:
-                    latField = 'latitude'
-                    lonField = 'longitude'
-                elif 'x_coord' in fieldMap and 'y_coord' in fieldMap:
-                    latField = 'x_coord'
-                    lonField = 'y_coord'
-                else:
-                    logging.error("getKMLdata unable to find position fields")
-                    return None
+                # latitude in metadata
+                res = self.executeSQL(sql, (table,'coord_lat'))
+                if len(res['rows']) > 0:
+                    latField = res['rows'][0][0]
+                    # longitude in metadata
+                    res = self.executeSQL(sql, (table,'coord_lon'))
+                    if len(res['rows']) > 0:
+                        lonField = res['rows'][0][0]
+                        
+        if (gisIdField is None) and (latField is None or lonField is None):
+            logging.warning("no entry in metadata table for table %s" % table)
+            # still no fields - try field names
+            if 'latitude' in fieldMap and 'longitude' in fieldMap:
+                latField = 'latitude'
+                lonField = 'longitude'
+            elif 'x_coord' in fieldMap and 'y_coord' in fieldMap:
+                latField = 'x_coord'
+                lonField = 'y_coord'
+            else:
+                logging.error("getKMLdata unable to find position fields")
+                return None
+
         
         # convert field names to row indexes
         gisIdIdx = fieldMap.get(gisIdField,None)
--- a/gis_gui/blocks/layer.html.pt	Wed Jan 12 19:20:11 2011 +0100
+++ b/gis_gui/blocks/layer.html.pt	Wed Jan 26 17:17:17 2011 +0100
@@ -8,11 +8,9 @@
   
   <tal:block metal:fill-slot="menu">
   <ul id="account_menu">
-    <li> Save </li>
-    
+    <li> Save </li>    
     <li> Open </li>
-
-    <li> 
+    <li>  </li>
   </ul>
   </tal:block>
   
--- a/gis_gui/home.pt	Wed Jan 12 19:20:11 2011 +0100
+++ b/gis_gui/home.pt	Wed Jan 26 17:17:17 2011 +0100
@@ -41,7 +41,7 @@
       $(document).ready(function(){
       	var blockContainer = $("#moduleslot").get();
         blocks = new guiBlocks(blockContainer);
-       	blocks.addBlock("blocks/home.html?impermanent=false&title=home", "home");
+       	blocks.addBlock("blocks/home.html?title=home&impermanent=false","home");
        	guiBlocks_init();
         // add menubar
         $('div.menubar').livequery(function(){
--- a/gis_gui/lib/blocks.css	Wed Jan 12 19:20:11 2011 +0100
+++ b/gis_gui/lib/blocks.css	Wed Jan 26 17:17:17 2011 +0100
@@ -132,7 +132,7 @@
     text-align: center;
     font-size: 14px;
     align: center;
-    height:250px;
+    height:1000px;
     padding:10px;
     margin-left:50px;
     margin-right:50px;
@@ -160,6 +160,7 @@
     height: 150px;
     background-color:#bbbbff;
     text-align: center;
+    margin-bottom: -120px;
 }
 
 #login {