Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] RE: RE: Problems adding a layer programmatically


Yeah, I tend to use the versions in internal for that reason.  Not best
practice, but I *need* those methods, and many of the useful ones are not
provided in the public interfaces.

import net.refractions.udig.project.internal.Map;    (etc)

Pete


David Fleig wrote:
> 
> With the current API I don't see a setCRS method for ILayer
> 
> 
> -----Original Message-----
> From: ukpete [mailto:pete@xxxxxxxxx] 
> Sent: Thursday, January 25, 2007 2:50 PM
> To: udig-devel@xxxxxxxxxxxxxxxxxxxxx
> Subject: [udig-devel] RE: Problems adding a layer programmatically
> 
> 
> David,
> 
> I have used the CRS of the map to set the layer (and not have to set it
> temporarily in the layer view)
> 
> e.g.
> 
> 
> /* set the layer CRS - same as the map */
> 			
> currentActiveMap.getEditManagerInternal().getSelectedLayer().setCRS(currentA
> ctiveMap.getViewportModelInternal().getCRS());
> 
> 
> Pete
> 
> 
> David Fleig wrote:
>> 
>> I made a change to the code and I think I have it working now:
>> 
>> 	Feature f = createLocationFeature(CMH, "cmh1");
>> 			resource =
>>
> CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(f.getFe
>> atureType());
>> 			FeatureStore mds;
>> 			try
>> 			{
>> 				mds = resource.resolve(FeatureStore.class,
>> null);
>> 				List myFeatures = new LinkedList();
>> 				myFeatures.add(f);
>> 				FeatureReader fReader = new
>> CollectionFeatureReader(myFeatures,f.getFeatureType());
>> 				mds.setFeatures(fReader);
>> 			}
>> 			catch (Exception e)
>> 			{
>> 				e.printStackTrace();
>> 			}
>> 
>> 
>> 
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Feature-Selection-using-example-tf3116329.html#a863998
> 3
> Sent from the udig-devel mailing list archive at Nabble.com.
> 
> _______________________________________________
> 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
> 
> 

-- 
View this message in context: http://www.nabble.com/Feature-Selection-using-example-tf3116329.html#a8640647
Sent from the udig-devel mailing list archive at Nabble.com.



Back to the top