40 |
import org.geotools.feature.FeatureCollection; |
import org.geotools.feature.FeatureCollection; |
41 |
import org.geotools.feature.NameImpl; |
import org.geotools.feature.NameImpl; |
42 |
import org.geotools.feature.collection.SubFeatureCollection; |
import org.geotools.feature.collection.SubFeatureCollection; |
43 |
|
import org.geotools.geometry.jts.ReferencedEnvelope; |
44 |
import org.geotools.styling.Style; |
import org.geotools.styling.Style; |
45 |
import org.opengis.feature.simple.SimpleFeature; |
import org.opengis.feature.simple.SimpleFeature; |
46 |
import org.opengis.feature.simple.SimpleFeatureType; |
import org.opengis.feature.simple.SimpleFeatureType; |
48 |
import org.opengis.filter.Filter; |
import org.opengis.filter.Filter; |
49 |
|
|
50 |
import schmitzm.geotools.feature.FeatureUtil; |
import schmitzm.geotools.feature.FeatureUtil; |
51 |
|
import schmitzm.geotools.feature.FeatureUtil.GeometryForm; |
52 |
import skrueger.AttributeMetadataImpl; |
import skrueger.AttributeMetadataImpl; |
53 |
import skrueger.i8n.Translation; |
import skrueger.i8n.Translation; |
54 |
|
|
321 |
SimpleFeatureType ftype = fc.getSchema(); |
SimpleFeatureType ftype = fc.getSchema(); |
322 |
for (int i = 0; i < ftype.getAttributeCount(); i++) { |
for (int i = 0; i < ftype.getAttributeCount(); i++) { |
323 |
AttributeDescriptor aDesc = ftype.getAttributeDescriptors().get(i); |
AttributeDescriptor aDesc = ftype.getAttributeDescriptors().get(i); |
324 |
if (aDesc != ftype.getGeometryDescriptor()) |
if (!FeatureUtil.isGeometryAttribute(aDesc)) |
325 |
metaDataMap.put(aDesc.getName(), new AttributeMetadataImpl( new NameImpl( aDesc.getName().getNamespaceURI(), aDesc.getName().getLocalPart()), |
metaDataMap.put(aDesc.getName(), new AttributeMetadataImpl( |
326 |
true, // visible |
new NameImpl(aDesc.getName().getNamespaceURI(), aDesc |
327 |
|
.getName().getLocalPart()), true, // visible |
328 |
new Translation(aDesc.getLocalName()), // Column name |
new Translation(aDesc.getLocalName()), // Column name |
329 |
new Translation(aDesc.getLocalName()), // description |
new Translation(aDesc.getLocalName()), // description |
330 |
"" // Unit |
"" // Unit |
360 |
/** It will be recreated on the next getFetureSource() **/ |
/** It will be recreated on the next getFetureSource() **/ |
361 |
featureSource = null; |
featureSource = null; |
362 |
|
|
363 |
LOGGER |
LOGGER.warn("Uncache onyl uncached any virtual FeatureSource. Object remains in memory."); |
|
.warn("Uncache onyl uncached any virtual FeatureSource. Object remains in memory."); |
|
364 |
} |
} |
365 |
|
|
366 |
/* |
/* |
440 |
return getGeoObject().getSchema(); |
return getGeoObject().getSchema(); |
441 |
} |
} |
442 |
|
|
443 |
|
@Override |
444 |
|
public ReferencedEnvelope getReferencedEnvelope() { |
445 |
|
return new ReferencedEnvelope(getEnvelope(), getCrs()); |
446 |
|
} |
447 |
|
|
448 |
|
/** |
449 |
|
* Defaults to the GeometryForm determined with FeatureUtil.getGeometryForm, |
450 |
|
* but can be set to override ANY. |
451 |
|
*/ |
452 |
|
private GeometryForm geometryForm; |
453 |
|
|
454 |
|
/** |
455 |
|
* Defaults to the GeometryForm determined with FeatureUtil.getGeometryForm, |
456 |
|
* but can be set to override ANY. |
457 |
|
*/ |
458 |
|
|
459 |
|
@Override |
460 |
|
public GeometryForm getGeometryForm() { |
461 |
|
if (geometryForm == null) { |
462 |
|
geometryForm = FeatureUtil.getGeometryForm(getSchema()); |
463 |
|
} |
464 |
|
return geometryForm; |
465 |
|
} |
466 |
|
|
467 |
|
/** |
468 |
|
* Defaults to the GeometryForm determined with FeatureUtil.getGeometryForm, |
469 |
|
* but can be set to override ANY. |
470 |
|
*/ |
471 |
|
public void setGeometryForm(GeometryForm geometryForm) { |
472 |
|
this.geometryForm = geometryForm; |
473 |
|
} |
474 |
|
|
475 |
} |
} |