Comments (6)
@pauldendulk Is it possible, for large geometry datasets, to use the GDI rendering interface and a TileLayer ?
from mapsui.
Yes, something like that could be possible. The Mapsui.Sample.Wpf project has a Shapefile sample that uses the RasterizingLayer. This uses the DefaultRenderer (in this case Mapsui.Rendering.Xaml) to create bitmaps from the shapefile vectors. You could create your own RasterizingTileLayer that works similarly. You could create a specific renderer instead of the default renderer.
Some notes:
- The GDI renderer is not used in any of the projects that I work on and I am not sure if it works properly atm.
- Threading might be an issue. Rendering on a background thread is often problematic. You might need to invoke it on the UI thread.
- I don't see much future for GDI. I see a trend towards more hardware accelerated rendering. For Xamarin I now focus on OpenGL (through OpenTK) for Windows I would like to use DirectX (through SharpDX).
- The current OpenGL renderer has no implementation for IRenderer.RenderToBitmapStream :(
- A RasterizingTileLayer wil need a TileSchema. This could be created on the fly. Take the map extent. Calculate the square that contains that extent. Take that as the top tile. Split is in fours going down a number of levels.
from mapsui.
I just committed an update to ShapeFileSample to fix the Mapsui.Samples.WinForms sample. This uses GDI rendering.
Also I did a quick test with GDI rendering in the RasterizingLayer. In Mapsui.Samples.Wpf.Window1.xaml.cs.ShapeFileClick I added this as first line:
DefaultRendererFactory.Create = () => new Rendering.Gdi.GdiMapRenderer();
And added a reference to Mapsui.Rendering.Gdi. To my surprise this just worked :). Performance was actually not that much faster. The main benefit of your suggestion is the rasterization. Which platform you use for rasterization is less important, but it helps if it's fast.
from mapsui.
A RasterizingTileLayer would only be advantageous if you can query your data spatially or cache tiles.
Which platform you use for rasterization is less important, but it helps if it's fast.
Yes, I hadn't looked closely at your library and I hadn't seen the RasterizingLayer!
Threading might be an issue. Rendering on a background thread is often problematic. You might need to invoke it on the UI thread.
GDI rendering would not have this issue.
from mapsui.
A RasterizingTileLayer would only be advantageous if you can query your data spatially or cache tiles.
True, but I see spatially querying data (fetching just the data you need for the tile) as a separate issue. Others report this problem here: https://mapsui.codeplex.com/discussions/554838. Basically the problem in this case is the implementation of the ShapefileProvider. The IProvider.GetFeaturesInView has a BoundingBox parameter which could be used to fetch just that box from disk or database.
from mapsui.
I am closing this issue. I added some more specific issues: #16, #17 and #18.
There are no plans to improve the performance of the WPF polygon rendering itself. If needed the RasterizingLayer can be used.
from mapsui.
Related Issues (20)
- [Uno] Using mapsui with .NET 8 causes invalid targets resolution on Windows HOT 2
- UserControl on a pin HOT 3
- Add ZoomToBoxWidget
- Add SliderWidget
- MbTiles not load An error occurred while fetching data. Exception: no such table: tiles HOT 5
- Documentation improvements for v5
- WPF: Set background color of MapControl if no map (TileLayer) is active HOT 1
- PNG images not optimised
- Add WidgetEventargs.KeyModifiers
- Allow adding EventHandlers
- Website/documentation high CPU usage HOT 1
- How to modify ZOrder of IFeature ? HOT 4
- Animations freeze in WPF under heavy load. HOT 2
- How to use EditingWidget HOT 1
- Can use RasterizingLayer and open IsMapInfoLayer=true,performance degradation HOT 1
- Replacement of map.home function in 5.0 Beta HOT 3
- Maui performance issues under Android HOT 20
- Wrong attribution link after switching map layer HOT 2
- Performance collapse with many Refresh calls and zooming out HOT 2
- Layer is not updated after fetches because the Delayer hangs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapsui.