This project has moved and is read-only. For the latest updates, please go here.

Google Earth and SharpMap

Topics: Data Access, General Topics, SharpMap v0.9 / v1.x, Web Controls, WinForms Controls
Sep 14, 2007 at 5:00 PM
Dear All,
Is it possible to implement Google Earth using SharpMap ?

Sep 14, 2007 at 5:56 PM
That's crazy!

Well... for now it is. One of the benefits of layering the rendering (as is being done in SharpMap v2.0) is the ability to implement a DirectX (or, I suppose, OpenGL) rendering engine which receives the geometry and renders it so a DirectX (or OpenGL) view can display it. If someone had sufficient time and skill, it could be done. It might be possible to use the WPF 3D capabilities, as well. I'm currently reading Petzold's "3D Programming for Windows" to see how WPF does 3D (short answer: it's not too different from DirectX). Since I currently plan on implementing the WPF renderer and view, I'll try to leave the door open for a 3D renderer and view as well as 2D.
Sep 14, 2007 at 9:51 PM

Have a look at Adam Nathan's book, Windows Presentation Foundation Unleashed, although it does not go into the depth of 3D parts that I would like, it makes good reference to performance with WPF, and talks about using certain types of implementation (Visuals) with referance to creating a Virtual Earth, google map, mapping applications where large numbers of visual objects will be used.
Sep 14, 2007 at 10:52 PM

Is it possible to implement Google Earth using SharpMap ?

"Implement Google Earth using SharpMap", well... not yet. But "Integrate SharpMap with Google Earth", yes, you can right now. See this sample by Morten Nielsen. See another similar integration sample for Virtual Earth. Also you can use SharpMap with any WMS client, such as NASA WorldWind.

Best regards,
Ricardo Stuven.
Sep 14, 2007 at 11:50 PM
@Cairn -

I agree, Nathan's book is good, but leaves much to be desired regarding treatment of 3D. Petzold's work more than makes up for it, taking us to task to learn the principles and mathematical techniques behind 3D. When combined with Essential Mathematics for Games and Interactive Applications: A Programmer's Guide, a fairly solid foundation for practical 3D development can be attained.

In terms of implementation, there is enough of a difference between 2D and 3D in WPF (1.0, anyway) where they would require almost completely different rendering engines (see p. 419 in WPF Unleashed). Whereas in 2D you'd use a StreamGeometry for the lightest-weight representation of a geometric shape, in 3D, you'd need to use a Geometry3D (like MeshGeometry3D). It's pretty much the same as the difference between GDI+ and DirectX: in GDI+ you use GraphicsPath and in DirectX you use a Mesh. Both use vertex data (GraphicsPath.PathData and Mesh.VertexBuffer), but with different syntax and in different formats. Too bad, really, that these haven't been unified more closely, so a single vertex buffer could serve both 2D and 3D.