Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active developed #14

Open
BergChristian opened this issue Apr 18, 2020 · 13 comments
Open

Active developed #14

BergChristian opened this issue Apr 18, 2020 · 13 comments

Comments

@BergChristian
Copy link

Hi Ali

Ran into your project and I think this is a great one and I can't see any other on the Internet doing what you do. I can see that there is some time ago it was actively developed. I am happy to contribute to the project if you are interesting in taking it active. I can see HW rendering is one thing to achieve as well as spending some time on that function to draw street names...

All the best
Christian

@AliFlux
Copy link
Owner

AliFlux commented May 2, 2020

Hi, Thanks for the interest. Contributions are certainly welcome for this project. Let me know which part/feature are you interested in.

@BergChristian
Copy link
Author

Hi

I am interested in getting performance up. Either HW accelerated drawing using Direct2D or maybe just see if there is other things to do

@charlenni
Copy link

I assume, that drawing isn‘t the bottle neck. I draw all lines and polygons in 5-10 ms with GPU backend of Skia. The problem is reading the data, decoding it and than, one of the biggest part, evaluating the filter of each style layer with each feature of the data.

Another big part is the placing of symbols and text on the tile. For this you need the symbols and text of the surrounding 8 tiles (read data, decode and filter for all 8 tiles). I assume, that this costs the most time at the end.

@AliFlux
Copy link
Owner

AliFlux commented May 2, 2020

A couple of days ago, I was porting this renderer to Cesium JS library for vector tile rendering on the fly. I did some extensive tests and figured out that the biggest bottleneck is the filter.

The filter system is essentially a function evaluator. One way to speed it up would be to generate a filter code (in C#) for each layer as soon as the style is loaded. Then execute that filter code in run-time for faster performance (see this for runtime execution of C# code).

@charlenni
Copy link

I’m not sure, if this approach (runtime execution of C# code) runs on all platforms (.Net, iOS, Android and so on).

I made the filter system with special objects, that all implement an evaluation function (see here). I tried to optimize it. One big point was to go away from Json objects. They are flexible, but slow. Now it is acceptable fast. Perhaps it could be made faster, if some feature sorted out before filtering, because line or fill layers aren’t interested in points.

Perhaps someone has another idea to speed it up.

@AliFlux
Copy link
Owner

AliFlux commented May 6, 2020

That's some nicely organized code. I'm experimenting with web-based vector rendering, and so far the best way to go about it is to dynamically compile filters.

@CBergAccount
Copy link

Hi!

I have tried this https://openmaptiles.com/
It works nicely with your code but it is insanely fast on the web. Any idea how they make it so fast?

@charlenni
Copy link

How did you tested OpenMapTiles with this code?

@CBergAccount
Copy link

Hi,

You could download a trial from there web page which I used directly with your code and GMAP.Net. Worked straight out of the box.

I just the Winform example you provide.

@AliFlux
Copy link
Owner

AliFlux commented May 7, 2020

On the web, it uses WebGL and some extreme optimization techniques to render the vector tiles. Can you test your openmaptiles with the tileserver-gl in raster mode? (it uses a similar technique of rendering)

@CBergAccount
Copy link

I am sorry, I don't have the time right now to test it and since I am not familiar with Java it would take me a lot of time... If you want to try it, just download the vector tiles, just download it from their webpage.

@AliFlux
Copy link
Owner

AliFlux commented Sep 9, 2021

Hi. I was implementing vector tiles for web using javascript and HTML5 canvas. Turns out the biggest performance bottleneck is the filtering operations. I'll be testing it further and posting results

@AliFlux
Copy link
Owner

AliFlux commented Sep 9, 2021

I've updated the repo with some performance improvements. Here are a few of these:

  • Shared sqlite connection between threads
  • Marked sqlite connection as readonly
  • Deferred disk cache to a delayed event that doesnt bother rendering thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants