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

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

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

branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java revision 426 by alfonx, Fri Oct 2 17:20:00 2009 UTC branches/2.0-RC1/src/skrueger/geotools/StyledFS.java revision 604 by alfonx, Wed Dec 9 14:15:53 2009 UTC
# Line 50  import org.opengis.feature.type.Attribut Line 50  import org.opengis.feature.type.Attribut
50  import org.opengis.filter.Filter;  import org.opengis.filter.Filter;
51  import org.opengis.referencing.crs.CoordinateReferenceSystem;  import org.opengis.referencing.crs.CoordinateReferenceSystem;
52    
53    import schmitzm.geotools.io.GeoImportUtil;
54  import schmitzm.geotools.styling.StylingUtil;  import schmitzm.geotools.styling.StylingUtil;
55  import skrueger.AttributeMetaData;  import skrueger.AttributeMetadata;
56  import skrueger.i8n.Translation;  import skrueger.i8n.Translation;
57    
58  import com.vividsolutions.jts.geom.Envelope;  import com.vividsolutions.jts.geom.Envelope;
# Line 147  public class StyledFS implements StyledF Line 148  public class StyledFS implements StyledF
148          }          }
149    
150          public CoordinateReferenceSystem getCrs() {          public CoordinateReferenceSystem getCrs() {
151                  return fs.getSchema().getCoordinateReferenceSystem();                  CoordinateReferenceSystem crs = fs.getSchema().getCoordinateReferenceSystem();
152                    if (fs.getSchema().getCoordinateReferenceSystem() == null) {
153                            LOGGER.warn("Could not determine the CRS of "+getTitle()+". Using default "+GeoImportUtil.getDefaultCRS());
154                            crs = GeoImportUtil.getDefaultCRS();
155                    }
156                    return crs;
157          }          }
158    
159          public Translation getDesc() {          public Translation getDesc() {
# Line 239  public class StyledFS implements StyledF Line 245  public class StyledFS implements StyledF
245          public AttributeMetadataMap getAttributeMetaDataMap() {          public AttributeMetadataMap getAttributeMetaDataMap() {
246                  if (map == null) {                  if (map == null) {
247    
248                          map = new AttributeMetadataMap();                          map = new AttributeMetadataMap(new String[] {Translation.getActiveLang()});
249    
250                          // Leaving out the first one, it will be the_geom                          // Leaving out the first one, it will be the_geom
251                          for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) {                          for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) {
252                                  AttributeDescriptor att = fs.getSchema().getDescriptor(i);                                  AttributeDescriptor attDesc = fs.getSchema().getDescriptor(i);
253    
254                                  AttributeMetaData attMetaData = new AttributeMetaData(i, att                                  AttributeMetadata attMetaData = new AttributeMetadata(attDesc.getName(), map.getLanguages());
255                                                  .getLocalName());                                  map.put(attDesc.getName(), attMetaData);
                                 map.put(i, attMetaData);  
256                          }                          }
257                  }                  }
258                  return map;                  return map;
# Line 274  public class StyledFS implements StyledF Line 279  public class StyledFS implements StyledF
279           * @see {@link StyledFeaturesInterface}           * @see {@link StyledFeaturesInterface}
280           */           */
281          @Override          @Override
282          public FeatureCollection getFeatureCollection() {          public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatureCollection() {
283                  FeatureCollection features;                  FeatureCollection<SimpleFeatureType, SimpleFeature> features;
284                  try {                  try {
285                          features = getGeoObject().getFeatures();                          features = getGeoObject().getFeatures();
286                  } catch (IOException e) {                  } catch (IOException e) {

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26