/[schmitzm]/trunk/src/skrueger/geotools/StyledFeatureCollectionTableModel.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/StyledFeatureCollectionTableModel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 604 by alfonx, Wed Dec 9 14:15:53 2009 UTC revision 607 by alfonx, Wed Dec 9 15:13:42 2009 UTC
# Line 120  public class StyledFeatureCollectionTabl Line 120  public class StyledFeatureCollectionTabl
120                          if (amdm != null) {                          if (amdm != null) {
121                                  Vector<String> visibleAttrNames = new Vector<String>();                                  Vector<String> visibleAttrNames = new Vector<String>();
122    
123                                  // Add the column with the geometry (usually "the_geom")                                  // Add the column with the geometry (usually "the_geom") always
124                                  visibleAttrNames.add(schema.getGeometryDescriptor()                                  visibleAttrNames.add(schema.getGeometryDescriptor()
125                                                  .getLocalName());                                                  .getLocalName());
126    
# Line 129  public class StyledFeatureCollectionTabl Line 129  public class StyledFeatureCollectionTabl
129                                          visibleAttrNames.add(a.getLocalName());                                          visibleAttrNames.add(a.getLocalName());
130                                  }                                  }
131    
132                                  // for (AttributeDescriptor aDesc :  //                      Tested with 2.6.x trunk from 2009-11-26 and it now works. So we only request the properties we need!                    
133                                  // schema.getAttributeDescriptors()) {  //                              /**
134                                  //                                        //                               * I got NPEs when properties contained only [the_geom] ?!??!!??
135                                  // // Always add the geometry  //                               */
136                                  // if (schema.getGeometryDescriptor()  //                              if (properties.length > 1) {
                                 // .getName().equals(aDesc.getName())) {  
                                 // visibleAttrNames.add(schema.getGeometryDescriptor()  
                                 // .getLocalName());  
                                 // continue;  
                                 // }  
                                 //                                        
                                 // if (amd.get(aDesc.getName()).isVisible())  
                                 // visibleAttrNames.add(aDesc.getName().getLocalPart());  
                                 // }  
                                 //  
                                 // // create a query for the visible attributes  
                                 String[] properties = visibleAttrNames.toArray(new String[] {});  
                                 //  
                                 // LOGGER.debug("Query contains the following attributes: "  
                                 // + visibleAttrNames);  
   
                                 /**  
                                  * I got NPEs when properties contained only [the_geom] ?!??!!??  
                                  * TODO Try again one day... Not today... 20.11.2009, SK  
                                  */  
                                 if (properties.length > 1) {  
137                                          query = new DefaultQuery(schema.getTypeName(), filter,                                          query = new DefaultQuery(schema.getTypeName(), filter,
138                                                          properties);                                                          visibleAttrNames.toArray(new String[] {}));
139                                  } else {  //                              } else {
140                                          query = new DefaultQuery(schema.getTypeName(), filter);  //                                      query = new DefaultQuery(schema.getTypeName(), filter);
141                                  }  //                              }
142                          }                          }
143                          fc = fs.getFeatures(query);                          fc = fs.getFeatures(query);
144                  }                  }

Legend:
Removed from v.604  
changed lines
  Added in v.607

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26