4

I'm trying to programmatically do what's explained here. ('Focus on Image' to display an image in the Image Coordinate System.

I'm using a mosaic Layer to load an oblique dataset. Currently I'm able to access a selected feature by getting the feature with:

ICompositeLayer compositeLayer = mosaicLayer as ICompositeLayer;
IFeatureLayer featureLayer = compositeLayer.Layer[1] as IFeatureLayer;

IFeatureSelection featureSelection = featureLayer as IFeatureSelection;
ISelectionSet2 selectionSet = featureSelection.SelectionSet as ISelectionSet2;

ICursor cursor = null;
selectionSet.Search(null, true, out cursor);

IFeatureCursor featureCursor = cursor as IFeatureCursor;
IFeature feature = featureCursor.NextFeature();

and zooming to it with the answer from zoom to geometry

From here I would like to now view the selected feature's image in ICS.

This is currently only one aspect of what I'm trying to do with ArcObjects, which is make an add-in for Oblique display for Desktop.

Anything that would be helpful to first, display an image in ICS or to navigate an display Oblique Imagery using ArcObjects for ArcMap would be helpful

Using a selected footprint of a mosaicLayer How can I display the associated image in the Image Coordinate System?

Also, do I need to first load the raster from the selected footprint/FeatureLayer?

4
  • For help with code we need you to provide a code snippet that illustrates what you have tried and where you are stuck.
    – PolyGeo
    Jan 26 '17 at 23:29
  • By "Oblique" do you mean you have oblique images, or is Oblique a brand name for a tool you've used to create ortho images? If the previous, then I would take a look at implementing IPictureElement2 or look at doing a hyperlink assuming you have an external viewer you can launch via a uri, if the latter, then perhaps ask where the sdk is to develop wrappers for unsupported raster datatypes (I can't remember where that is documented). Jan 27 '17 at 14:41
  • I have oblique imagery. We currently have a Oblique Viewer widget for web. Think this and this. We are working to have something similar using ArcMap for Desktop. Jan 27 '17 at 15:03
  • After "Focus on Image" it's setting the SpatialReference of the map to "AMD_'mosaicLayerName'_CAT\Raster.OBJECTID= 'oid'" I'm beginning to think that I will have to get the raster and then somehow set the map to use it as it's SpatialReference. Jan 27 '17 at 22:26
3
+50

If you're using an Image service you can use IImageServer5's function "GetImageCoordinateSystem(int OID)"

https://desktop.arcgis.com/en/arcobjects/latest/net/IImageServer5_GetImageCoordinateSystem.htm

IMap map = ArcMap.Document.FocusMap;
IImageServer imageServer = GetImageServer(serviceUrl, serviceName);
IImageServer5 server5 = imageServer as IImageServer5;
map.SpatialReference = server5.GetImageCoordinateSystem(OID);
IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
1
  • This does work for ImageServers. I guess ESRI doesn't have support for doing this with ArcObjects for Mosaic datasets. Now I just need to re-learn everything I just learned for mosaicLayers and learn it for ImageServers... I'll accept this answer just because I dont think there's any other way in ArcObjects. [without transforming it manually] Feb 1 '17 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.