Reading subsample of data when zoomed out

For discussion of LizardTech's free Decode SDK for MrSID and JPEG 2000.

Moderator: jskiffington

Reading subsample of data when zoomed out

Postby STH » Mon Dec 21, 2009 12:34 am

Is it possible for an application to read a smaller subsample (or is it called overview?) of a large SID-file which consist of huge amounts of LIDAR-data? Loading each point is obviously possible - however the whole point is to load the data quickly - and it seems to work fast in the GeoViewer. Thanks for the help!
STH
 
Posts: 2
Joined: Fri Dec 18, 2009 5:49 am

Postby mpg » Tue Jan 05, 2010 1:31 pm

Yes -- this is covered in the "Specifying a Region of Interest" (on page 3 of the PDF). Specifically:

fraction = 1 / subsample rate

I don't think we have a fraction != 1.0 in the example code, but we will add one for a future release.

-mpg
mpg
 
Posts: 29
Joined: Thu Jan 24, 2008 1:50 pm
Location: LizardTech

Postby STH » Tue Jan 05, 2010 1:50 pm

Thanks for the quick reply, however I am not sure if you understood. I do not just want to read for instance one area - but I want to read a "low resolution" of that area. Instead of loading all lidar points within an area I want to read only x % of the points. I thought the SID files are similar to TIFF files with Overviews. Ie it contains one full resolution layer, one 50% resolution layer, 25 % layer, 12,25 % layer etc (maximum 10 layers I think). Then loading the less detailed level when viewing the complete dataset will be faster than loading the complete dataset.

Sorry for the bad English, its difficult to explain something in a foreign language.

Keep up the good work with the Lidar compressor, it is really needed with the large amounts of data nowadays.
STH
 
Posts: 2
Joined: Fri Dec 18, 2009 5:49 am

Postby msr » Tue Jan 05, 2010 3:32 pm

You expressing yourself quite adequately. You want a low resolution "subset" of a given bounding region. You want to be sure the SDK doesn't decode the entire dataset.

There are two ways to go about this.

A. You can specify a Bounds and a Fraction when you create a PointIterator. This is what GeoViewer does because it has the advantage of allow you to render partial results. Every time the PointIterator returns a new buffer you can render it.

B. You can setup a PointData buffer with a fixed number of points (say 1000) and then specify the Bounds when you ask the PointSource to read (populate the buffer). The PointSource will pick the best (...) 1000 points that cover the requested area.

Your code might look like this:
[code] Bounds bounds(xmin, xmax, ymin, ymax, -HUGE_VAL, +HUGE_VAL);
unsigned int nPoints = reader->read(bounds, pointdata, NULL);
[/code]

In either case the SDK will be smart abound decoding only the required resolution level. In neither case will the SDK decode the entire region and just down sample.

Page 16 of the PDF documentation has examples of both of these.
msr
 
Posts: 8
Joined: Wed Feb 20, 2008 2:20 pm
Location: LizardTech


Return to SDKs

Who is online

Users browsing this forum: No registered users and 1 guest

cron