POST
|
I figthed the same war a few months ago and this is working for me: string sid="orcl_dbname"; // from tnsnames.ora IPropertySet connectionProps = new PropertySetClass(); connectionProps.SetProperty("SERVER", sid); connectionProps.SetProperty("SERVERINSTANCE", "sde:oracle11g:/;LOCAL="+sid); connectionProps.SetProperty("DATABASE", ""); connectionProps.SetProperty("DBCLIENT", "oracle"); connectionProps.SetProperty("db_connection_properties", sid); connectionProps.SetProperty("AUTHENTICATION_MODE", "DBMS"); connectionProps.SetProperty("USER", user); connectionProps.SetProperty("PASSWORD", password); So good luck!
... View more
08-07-2014
05:30 AM
|
1
|
0
|
1216
|
POST
|
Sorry for answering my own question. It's not so difficult as it seems. I just have to use the OpenAnnotationLayer-method of the FDOGraphicsLayerFactoryClass to get my layerobject: IAnnotationLayerFactory annotationLayerFactory = new FDOGraphicsLayerFactoryClass(); IAnnotationLayer annotationLayer = annotationLayerFactory.OpenAnnotationLayer(featureWorkspace, null, FCName);
... View more
06-04-2014
04:59 AM
|
0
|
0
|
254
|
POST
|
I have a FileGeoDatabase with a AnnotationFeatureClass (within 3 AnnotationClasses) that I programmatically want to load to my map. First I load the FeatureClass in order to get some Informations and then while creating the AnnotationLayer an error occurs. I've used some code from the Esri-help, but what could be wrong? Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory"); IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType); ws = workspaceFactory.OpenFromFile(pGdbSource.Dir + "\\" + pGdbSource.File, 0); if (ws != null) { IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)ws; IFeatureLayer featureLayer = new FeatureLayerClass(); string FCName = (pGdbSource.BrowseName != "") ? pGdbSource.BrowseName : pGdbSource.ItemName; featureLayer.FeatureClass = featureWorkspace.OpenFeatureClass(FCName); ILayer layer = (ILayer)featureLayer; if ((featureLayer.FeatureClass.FeatureType == esriFeatureType.esriFTAnnotation) && (featureLayer is FeatureLayerClass)) { // Get the GeometryDef from the feature class's shape field. String shapeFieldName = featureLayer.FeatureClass.ShapeFieldName; int shapeFieldIndex = featureLayer.FeatureClass.FindField(shapeFieldName); IFields fields = featureLayer.FeatureClass.Fields; IField shapeField = fields.get_Field(shapeFieldIndex); IGeometryDef geometryDef = shapeField.GeometryDef; IAnnotateLayerPropertiesCollection annotateLayerPropsCollection = (featureLayer as FeatureLayerClass).AnnotationProperties; // Create a graphics layer scale object. IGraphicsLayerScale graphicsLayerScale = new GraphicsLayerScaleClass(); try { graphicsLayerScale.ReferenceScale = mxDocument.ActiveView.FocusMap.MapScale; } catch (Exception ex) { graphicsLayerScale.ReferenceScale = 0.0; } graphicsLayerScale.Units = mxDocument.ActiveView.FocusMap.MapUnits; // Create the overposter properties for the standard label engine. IOverposterProperties overposterProperties = new BasicOverposterPropertiesClass(); ISymbolCollection symbolCollection = new SymbolCollectionClass(); ISymbolCollection2 symbolCollection2 = (ISymbolCollection2)symbolCollection; // Create the annotation layer factory. IAnnotationLayerFactory annotationLayerFactory = new FDOGraphicsLayerFactoryClass(); IDataset pDataset = (featureLayer as FeatureLayerClass) as IDataset; // Create the annotation feature class and an annotation layer for it. IAnnotationLayer annotationLayer = annotationLayerFactory.CreateAnnotationLayer (featureWorkspace, pDataset as IFeatureDataset, FCName, geometryDef, null, annotateLayerPropsCollection, graphicsLayerScale, symbolCollection, false, false, false, true, overposterProperties, "configKeyword"); // Get the feature class from the feature layer. featureLayer = (IFeatureLayer)annotationLayer; Thanks for any suggestions!
... View more
06-04-2014
02:52 AM
|
0
|
1
|
355
|
POST
|
Dear Neil, thank you for watching my problem. I knew that the Spatial References of the Map and the Layer are not the same, this is just the reason of my question. I access the correct SpatialReference (this from the Shape) over the Interface IGeoDataset, which should show me the underlying Datasource. But the member 'Extent' of the IGeoDataset doesn't show it in the right Spat.Ref. Could this be a bug? In an older Forum-Discussion is shown also the way over the IGeoDataset. I searched the FeatureClass and the FeatureClass.FeatureDataset but can't find an envelope there.
... View more
10-30-2013
06:48 AM
|
0
|
0
|
212
|
POST
|
Hello, I have a DockableWindow in my ArcMap 10.1, before Closing the Program I want to do some jobs. So in the Constructor of my DockableWindow I registered the Dispose-Event: public dwThemes()
{
InitializeComponent();
this.Disposed += new EventHandler(dwThemes_Disposed);
... But the application does not come through the Event-Routine. Is there a better way? Thanks EDIT: Found a Solution: the IDockableWindowDef.OnDestroy() Event
... View more
10-30-2013
03:29 AM
|
0
|
1
|
1958
|
POST
|
Hello, In ArcMap I have a SpatialReference EPSG 32633 of the Dataframe and a Layer(Shape) loaded with EPSG 31494. Now I want to get the Extent of the original underlying Data. So I take my Layer as IGeoDataset: ESRI.ArcGIS.Geometry.ISpatialReference spatialReference = (pLayer as IGeoDataset).SpatialReference; ESRI.ArcGIS.Geometry.IEnvelope envelope = (pLayer as IGeoDataset).Extent; The SpatialReference is 31494, but the Extent shows me the Coordinates in EPSG 32633. In the Properties-Dialog of the Layer the Extent shows the Coordinates in 31494. How can I get these Coordinates? Thanks for any idea.
... View more
10-30-2013
12:34 AM
|
0
|
4
|
503
|
Title | Kudos | Posted |
---|---|---|
1 | 08-07-2014 05:30 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|