Stencil line with large datasets

classic Classic list List threaded Threaded
6 messages Options
JesseStimpson JesseStimpson
Reply | Threaded
Open this post in threaded view
|

Stencil line with large datasets

Hi,

I have a large dataset that when I create a stencil line ModelLayer from it, I get lots of warnings, visual artifacts, and bad performance.

I realize there are technical limitations to the stencil buffer approach for visualizing vector data, but I want to make sure that what I'm seeing is due to the limitations of my graphics card and not my misuse of osgEarth.

Here's one of the many warnings that get output to the console:

bufferOriginalPrecision failed (TopologyException: assigned depths do not match
at 324357 4.10628e+006), trying with reduced precision
recomputing with precision scale factor = 1e+011
Scaler: offsetX,Y: 0,0 scaleFactor: 1e+011
ReScaler: offsetX,Y: 0,0 scaleFactor: 1e+011

And here's the artifacts I see. These are supposed to be building outlines.


As for performance, I'm at single-digit frame rates on my NVIDIA Quadro NVS 160M.

I'm trying to find out if I can release the data to you guys. In the meantime is there anything obvious you can see I'm doing wrong?

I really appreciate all your help. Thanks,
Jesse
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Stencil line with large datasets

Jesse,

The TopologyException is a GEOS error message, and I admit that I do not understand its meaning.

Whenever I've encountered this error it is because my buffer distance is inappropriate for the SRS. The buffer distance is set based on the stroke-width you use in your style.

What is your shapefile SRS and stroke-width? Make sure they are in the same linear units.

(The visual artifacts and the bad performance are likely just a result of the geometry buffer operation failing.)

Sorry I cannot be of more help.
Glenn
Glenn Waldron / Pelican Mapping
JesseStimpson JesseStimpson
Reply | Threaded
Open this post in threaded view
|

Re: Stencil line with large datasets

Glenn,

Here's my earth file:

<map name="DATA" type="projected">

    <image name="georef" driver="gdal">
       
                <url>DATA_georef.tif</url>
    </image>
   
    <model name="DATA bldgs" driver="feature_stencil">
        <features name="bldgs" driver="ogr">
                        <url>DATA_bldgs.shp</url>
            <ogr_driver>ESRI Shapefile</ogr_driver>
        </features>
       
        <geometry_type>line</geometry_type>
       
        <extrusion_distance>1</extrusion_distance>
             
        <styles>
            <style type="text/css"> world { stroke: #ffff00; stroke-opacity: 0.5; stroke-width: 3; } </style>        </styles>
    </model>
</map>

osgEarth is a lot happier with me when I explicitly set the extrusion_distance to 1. The shapes look good from far away, but when I zoom in I start seeing the same artifacts.

Also, I have a projected map, so I assume the units of the stroke-width are meters, correct?

Unfortunately I cannot send the data, but I will look for a similar (and publicly available) dataset and see if I have the same results.

Thanks for your help,
Jesse
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Stencil line with large datasets

Jesse,

What is the SRS of your buildings shpfile?

Glenn
Glenn Waldron / Pelican Mapping
JesseStimpson JesseStimpson
Reply | Threaded
Open this post in threaded view
|

Re: Stencil line with large datasets

Oh, sorry:

PROJCS["WGS_1984_UTM_Zone_52N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",129.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Stencil line with large datasets

In reply to this post by gwaldron
Jesse,

Yes, the stroke-width units should be the same units as the features' SRS. In this case meters is correct.

The extrusion_distance is how far the stencil volumes extrude from 0 in either direction. If your terrain is projected and flat, 1 should work ok.

Does it look OK if you leave the geometry as polygons (i.e. comment out <geometry_type>)?

Have you experimented with other stroke-width values?

Sorry, off the top of my head I don't know the issue. I've never tried feature_stencil on a projected map.
Glenn
Glenn Waldron / Pelican Mapping