On Sat, 2006-08-05 at 11:36 -0600, [EMAIL PROTECTED] wrote:
> Hello All,
>
> I'm using v2.2 to create a Shapefile from scratch and I'm confused about
> the correct way to create a FeatureType.
There's a mysterious FeatureTypes (note the plural) that does this, not
quite sure about it's historical origin. We know this is all a mess and
hope, in the upcoming future releases to clean this all up with a
standard and sane factory system.
--adrian
***************************************************************************
Class cls = ptG.getClass();
GeometryAttributeType ptGA =
(GeometryAttributeType) AttributeTypeFactory.newAttributeType(
"the_geom", cls, true, 1, null,ptCRS);
AttributeType cityAT =
AttributeTypeFactory.newAttributeType(
"CITYNAME", String.class, true, 48, null);
AttributeType popAT =
AttributeTypeFactory.newAttributeType(
"CITYPOP", Integer.class, true, 48, null);
// Create the FeatureType
AttributeType[] ptATs = new AttributeType[3];
ptATs[0] = ptGA;
ptATs[1] = cityAT;
ptATs[2] = popAT;
org.geotools.feature.FeatureType ptFT = null;
try{
ptFT = FeatureTypes.newFeatureType(ptATs, "Metropolis");
} catch (SchemaException sex){
System.out.println("SchemaException on FeatureType creation: "+sex);
}
***************************************************************************
> It seems that the examples
> I've found are marked as deprecated. e.g.
>
> FeatureTypeBuilder build = FeatureTypeFactory.newInstance();
> //or
> FeatureType ftPoint = FeatureTypeFactory.newFeatureType();
>
> Can someone please straiighten me out?
>
> Thanks!
>
> -- john
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users