|
From: sebdell <sha...@ba...> - 2011-03-18 05:33:31
|
Hi,
I have an issue with the following code where the SimpleFeatureType schema
CRS is being set to null even though it is being set multiple times within
the SimpleFeatureTypeBuilder. The getFormat().getCRS() is returning a valid
CoordinateReferenceSystem and the builder CRS value appears to be set
correctly. This is causing the layers to draw with the incorrect CRS and
miss-matching bounding box.
Have I missed a step or am i setting the CRS incorrectly?
SimpleFeatureType schema = null;
public SimpleFeatureType getFeatureType()
{
if (schema == null)
{
SimpleFeatureTypeBuilder builder = new
SimpleFeatureTypeBuilder();
builder.setName(featureCode);
builder.setCRS(getFormat().getCRS());
builder.setDefaultGeometry(Helper.GEOM);
for (AttributeInfo info : attributeInfos.values())
{
builder.nillable(info.isMandatory());
builder.minOccurs(info.isMandatory() ? 0 : 1);
builder.maxOccurs(1);
builder.crs(getFormat().getCRS());
if (info.getShortName().equals(Helper.GEOM))
{
builder.add(info.getShortName(), info.getBinding(),
getFormat().getCRS());
}
else
{
builder.add(info.getShortName(), info.getBinding());
}
}
schema = builder.buildFeatureType();
}
return schema;
}
Regards,
Shaun
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/SimpleFeatureType-CRS-being-set-to-null-tp6183478p6183478.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
|