Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] adding a feature to the current map

Hello all,


Thanks for your help and pointers and what not. I'm still fundamentally
missing the point of what's going on between having created a Feature
and wanting to get that feature into a form that can be displayed by
uDig. If someone could spell out generically what needs to happen, i.e.
what the Iservices and friends actually are, that would certainly help
me. 


Jesse, how and where in the code below does uDig learn about the
underlying geometry? You create a featureType, and use that featureType
to get an IGeoResource. Where does the actual feature get pulled into
the data model? Right now, in neither your code nor in Vitali's, does
uDig ever get a pointer to the actual feature. I've tried a few things
like manually adding it to the datastore but those things don't work.


On Tue, 2006-02-28 at 09:18 -0800, Jesse Eichar wrote:
> DefaultFeatureTypeFactory ftFactory = new DefaultFeatureTypeFactory();
> AttributeType at = AttributeTypeFactory.newAttributeType("geom",
> 	Polygon.class);
> ftFactory.addType(at);
> ftFactory.setName("myFeatureType");
> FeatureType dbFeatureType = ftFactory.getFeatureType();
> IGeoResource resource=CatalogPlugin.getDefault().getLocalCatalog.createTempResource( dbFeatureType );
> CreateMapCommand command=new CreateMapCommand( "New Map", Collections.singletonList(resource), null );
> ApplicationGIS.getActiveProject( ).sendASync( command );
> 

thanks,
adrian



Back to the top