Caching Feature Geometry

classic Classic list List threaded Threaded
5 messages Options
Mr Woo Mr Woo
Reply | Threaded
Open this post in threaded view
|

Caching Feature Geometry

Hello dear osgEarth fellows,

I use ogearth_viewer version 2.8 to display a vector world map (basically a shape file: Digital Chart of the World). As already mentioned in the following post
http://forum.osgearth.org/Caching-Feature-Geometry-tt7586631.html#a7586637 it displays in a very few seconds if only the verts are drawn, but takes more than 1 minute if the fill option is enabled within the style.

The same shape file is read very fast with QGis 2.18, with polygons filled-in.

Do you have any suggestions to speedup the rendering of objects?

Thank you very much.

Here is an excerpt of my .earth file:

<map name="TestMap" type="projected" version="2">
    <options>
        <profile>spherical-mercator</profile>
        <terrain color="#0000ff"/>
    </options>

...

<model name="world" driver="feature_geom">
  <features name="states" driver="ogr">
    <url>C:/earthmap-data/shp/Digital_Chart_of_the_World.shp</url>
    <ogr_driver>ESRI Shapefile</ogr_driver>                       
  </features>
  <styles>
    <style type="text/css"> default { stroke: #999999; stroke-width: 2.0; fill: #333333; render-lighting: false; render-depth-test: false; altitude-clamping: terrain; altitude-technique: drape; } </style>  </styles>
</model>
Mr Woo Mr Woo
Reply | Threaded
Open this post in threaded view
|

Re: Caching Feature Geometry

Extra information: the ticket #313 on GitHub Polygons with both fill and stroke are unusually slow corresponds to my situation, and the proposed solution does not solve the issue.

Besides, adding a <layout> section in the earth file was also a solution I explored, but rendering was still very slow.

Any comment would be greatly appreciated.
JD JD
Reply | Threaded
Open this post in threaded view
|

Re: Caching Feature Geometry

I think the tesselation is slow.
You can try to add this in your model :
<max_polygon_tiling_angle>45.0</max_polygon_tiling_angle>
Mr Woo Mr Woo
Reply | Threaded
Open this post in threaded view
|

Re: Caching Feature Geometry

Hi JD,

Thank you for your suggestion. At first glance, it doesn't help unfortunately. But to be honest I'm currently not able to perform a benchmark to estimate if there is an improvement or not.

However, I think you're on the right path; I should reduce the details of the map, since the coast line is very accurate and as such the filling is by far a very complex operation. I don't know if applying an intersection of the map and a filled polygon would be a lighter processing...
Mr Woo Mr Woo
Reply | Threaded
Open this post in threaded view
|

Re: Caching Feature Geometry

Progress update...

After benchmarking, I established it was clearly a tessellation problem, the method osgEarth::Tesselator::isEar() is time consuming, since the map I use is very detailed.

So I disabled tessellation by setting <max_polygon_tiling_angle>0</max_polygon_tiling_angle> in my earth file.

Now it renders very fast, but the polygons are not filled in anymore. I failed to find in the code where the polygon style is applied in this case. Have I missed something?

Thanks for your ideas