1) I’ve seen references to a GdalRasterLayer class in this forum, but I cannot find it in the API documentation (and compiler doesn’t recognize it). Does it currently exist?
2) I’m having trouble getting a jpg with associated aux.xml file to display on a shapefile. I believe it is correctly georeferenced (also, it displays correctly with SharpMap).
GdalRasterLayer
I also converted the aux.xml to a jpeg world file (.jgw) and it still didn’t show up. I tried both GdiPlusRasterLayer and Jpeg2000RasterLayer.
Hi Ryan,
You need to reference this dll C:\Program Files (x86)\ThinkGeo\Map Suite Desktop Full Edition 7.0\Developer Reference\Spatial Extensions\Fdo Extension\FdoExtension.dll, and you will find the GdalRasterLayer class.
Please try to use this class to render your jpeg file.
If it still don’t works, maybe you can sent us a simple sample with your image and jgw, so we can help you to find why it not be rendered.
Regards,
Don
I added FdoExtension.dll, but I’m getting a FileNotFoundException “Could not find MapSuiteFdoExtension.dll assembly”
Hi Ryan,
Would you please follow the following coditions to sort it out?
Condition1:
If your OS is x86
then copy Folders “MapSuiteFdoExtensionX64” and “MapSuiteFdoExtensionX86” from “C:\Program Files (x86)\ThinkGeo\Map Suite Desktop Full Edition 7.0\Developer Reference\System32” to “C:\Windows\System32”
Condition2:
If you Os is X64
If your project’s Build PlatForm Target is x86 then copy Folder “MapSuiteFdoExtensionX86” from “C:\Program Files (x86)\ThinkGeo\Map Suite Desktop Full Edition 7.0\Developer Reference\System32” to “C:\Windows\SysWOW64”
Condition3:
If you Os is X64
If your project’s Build PlatForm Target is x64 then copy Folder “MapSuiteFdoExtensionX64” from “C:\Program Files (x86)\ThinkGeo\Map Suite Desktop Full Edition 7.0\Developer Reference\System32” to “C:\Windows\System32”
If the problem is still there would you please provide us the data for a further test?
Waiting for your further information.
Summer
Thanks that fixed the problem. However, now I’m getting another exception. I’ve tried 2 different jpegs. My code is:
LayerOverlay worldOverlay = new LayerOverlay();
GdalRasterLayer worldLayer = new GdalRasterLayer(“C:\ResultImage.jpg”);
worldLayer.DrawingException += new EventHandler<drawingexceptionlayereventargs>(worldLayer_DrawingException);
worldOverlay.Layers.Add(worldLayer);
m_Map.Overlays.Add(worldOverlay);
Exception detail is:
System.Reflection.TargetInvocationException was unhandled
Message=Exception has been thrown by the target of an invocation.
Source=WpfDesktopEdition
StackTrace:
at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.<>c__DisplayClass6.<drawexception>b__4()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at xxx.App.Main() in xxx.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Message=Can not read the image file.
Source=MapSuiteFdoExtension
StackTrace:
at MapSuiteFdoExtension.GeoFdoRasterSource.GetScaledBitmap(Double centerX, Double centerY, Int32 overlapWidth, Int32 overlapHeight, Int32 returningWidth, Int32 returningHeight)
InnerException:
</drawexception></drawingexceptionlayereventargs>
Hi Ryan,
Could you send us the data or demo project you are using to reproduce the error.
thanks,
Jack
Hi Ryan,
Thanks for your detailed example, the problem is that the loading “.Jpg” files doesn’t have the corresponding world file “*.jgw”, the attached is one we created with a demo coordinates, please check it and do some changes based on your requirement following the world file instruction at en.wikipedia.org/wiki/World_file.
Btw, seems like the “.jpg” file is just a windows native normal “jpg” file, if in that case, I guess you can try “GdiPlusRasterLayer”.
Thanks,
Johnny
ResultImage.zip (169 Bytes)
Thanks, it works now. I had already tried a .jgw file, but the data must have been in the wrong format. Do you know if a jpg.aux.xml file will work instead of a jgw?
Hi Ryan,
I don’t think we support .aux.xml file, but I’ll check in with product team.
The work around is: If you know the Extent of the your data Or can read the Extent from the jpg.aux.xml file, you can use one of the GdiPlusRasterLayer constructor to pass-in the jpg file path and extent.
Thanks,
Jack
Hi Ryan,
Would you please provide us your data, we will check if there are anything that we could do?
Best Regards
Summer
Thanks, please let me know when you find out.
Hi Ryan,
Thanks for your post but sorry to say that we don’t support jpg.aux.xml file for now. You can vote this enhancement to helpdesk.thinkgeo.com/EnhancementTracker. This captures the enhancement request and provides visibility to the customer letting them know that the enhancement is on a list somewhere and that popularity of the enhancement helps set the priority of when the enhancement would be added to the product. This option doesn’t carry any cost for you.
Or if you need this function immediately, your account rep can contact you for a professional services.
Best Regards
Summer