[C#] get IRasterWorkspaceEx from IWorkspaceFactory

381
2
Jump to solution
03-25-2013 11:34 PM
oyleiste
Occasional Contributor
Hello

I need to create IRasterWorkspaceEx to use it for creating IMADtedLayer. This is how:
IWorkspaceFactory wsf = new RasterWorkspaceFactoryClass(); IRasterWorkspaceEx rasterwsEx = (IRasterWorkspaceEx)wsf.OpenFromFile(foldername, 0); //then create IRasterCatalog and etc.


Every time I get error on casting IWorkspace (output of OpenFromFile) to IRasterWorkspaceEx.
Is there anyone to answer this question? 😞

Thank you
0 Kudos
1 Solution

Accepted Solutions
oyleiste
Occasional Contributor
I was trying to pass .dt0 file.
Actually I solved my problem using this great guy's blog: Creating a Mosaic of FalconView DTED in the GIS Editor

But I'm a little sad, because I couldn't use IMADtedLayer for this purpose. I used IRasterLayer. When I add the layer to axMapControl, something like this appears:

By the way, is there any built-in function for get "Line of Sight" of a specific points?

Thank for your reply

View solution in original post

0 Kudos
2 Replies
NeilClemmons
Regular Contributor III
What path are you passing in?  This interface, as mentioned in the developer help, is only available for personal, file, and sde geodatabases.  So, if you're not passing in a path to a geodatabase then the cast will fail because the factory is not returning a class type that implements this interface.
0 Kudos
oyleiste
Occasional Contributor
I was trying to pass .dt0 file.
Actually I solved my problem using this great guy's blog: Creating a Mosaic of FalconView DTED in the GIS Editor

But I'm a little sad, because I couldn't use IMADtedLayer for this purpose. I used IRasterLayer. When I add the layer to axMapControl, something like this appears:

By the way, is there any built-in function for get "Line of Sight" of a specific points?

Thank for your reply
0 Kudos