Title: Message

Hi!

Silly question.

Earlier you helpfully gave me a code snippet to create a new shapefile.

IndexedShapefileDatastoreFactory fac=new IndexedShapefileDataStoreFactory();

ShapefileDataStore ds=fac.createDatastore(url);

// I assume this is the URL of the new shapefile I want it to create?

GeometryFactory gf = new GeometryFactory();

ds.createSchema( featureType );

// Here I got lost. Started to investigate FeatureType and felt like I was walking through tar.

I eventually found IndexedShapefileDatastoreFactory etc in the GeoTools api.

Do I actually have to download this and import it into Eclipse, or is it already available to me somehow, as the compiler keeps telling me it can't find IndexedShapefileDatastoreFactory even though I have put the import statement for it in the class?

Michelle

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jesse Eichar
Sent: 24 February 2006 17:54
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] Shapefiles

That is a geotools issue.  To create a new shapefile do something like:

IndexedShapefileDatastoreFactory fac=new IndexedShapefileDataStoreFactory();

ShapefileDataStore ds=fac.createDatastore( url );
ds.createSchema( featureType );

List<IService> service = CatalogPlugin.getDefault().getServiceFactory().acquire(url);


Now you have a service with which you can get the resource and create a layer from the resource.

Jesse

M.S.Bachler wrote:

Hi!

This is probably a daft question, but I have had a hunt around the API and can't figure it out.

If I want to create new layers programmatically on the drop of my icons and I want that data to be stored in a shapefile,

Are there classes/methods in uDig to create a new shapefile for a new layer, or do I have to create the shapefile myself somehow?

Michelle



_______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to