O man. Epic 3D on its way. I could drone on and on about #postgis

Still working furiously on final edits for the PostGIS Cookbook.  My last chapter is the last one that the Packt editors and managers are waiting for, but it will be the best I’ve contributed to the book, so I think it will be worth everyone’s time.

The trick with this chapter is that when I first wrote it, it was before the heavy lifting the Oslandia folks have done on SFCGAL and all the nifty 3D integration work, so I have spent a few days reviewing their work and figuring out some novel applications for their work to date (FOSS moves so quickly, I’m having to write new stuff just to keep up…).

Also, for those of you who ooh’d and ahh’d at Bobby Sudekum’s exciting drone mapping post on the MapBox blog, I’ll be showing you some of the post-processing steps you can do in PostGIS of drone imagery.  The whole workflow isn’t in place yet (now that Bborie has made raster faster, we’re waiting on some image draping utilities), but I predict we’re less than a year away from being able to replace that proprietary stack (that can cost between $4-20,000 per annum in licensing fees) with a PostGISful stack.  The 3D chapter will take you halfway there.

Now for some drone scribbles:

Path for drone (uas flight) with overlapping dots representing uas drone picture locations
Drone Scribbles

7 thoughts on “O man. Epic 3D on its way. I could drone on and on about #postgis

    1. BTW, are you planning to be the first package manager to wrap up and put a bow on SFCGAL? It’s not too bad to get going on Ubuntu, but it’s not exactly a picnic either… . It’d be awesome to see it in the Windows builds.

      1. That’s in my plans. I was close I think — got sfcgal to compile, cgal 4.2 to compile, but got stuck getting postgis to be happy with the sfcgal and cgal connection (that was a while ago and oslandia had made some fixes since then at my request). I’m planning to have it packaged with PostGIS 2.2. Too late for 2.1, but once I have the kinks worked out will have available on winnie PostGIS 2.2 buildbot builds for people to try.

  1. Any plans on making the scripts and data available? I’m mostly interested in testing (valgrind, callgrind, etc.)…

    1. Data can be found here:

      although expect these datasets to be in flux for the next couple of days.

      PostGIS is used at the beginning and end:

      1) PostGIS can be used to optimize the ordering of the images that go into the sparse bundle adjustment by looking at likely 3D viewshed overlap based on GPS location, pitch, roll, and heading (assuming the step I haven’t tested yet of calculating 3D intersections just works…). In this way, pairwise comparisons of matches can be optimized, and the number of cross comparisons minimized. A simpler method might be to just ORDER BY ST_GeoHash.

      2) Point cloud creation is in bundler/PMVS, i.e. https://www.cs.cornell.edu/~snavely/bundler/ This step could be partially done in PostGIS too (importantly, the part with patent encumbered code) with the addition of OpenCV and sift: http://docs.opencv.org/modules/nonfree/doc/feature_detection.html?highlight=sift )

      3) Finally, PostGIS works as a tool for creating the DTM (so far as written with GEOS– hope to complete with SFCGAL as well in the next couple of days) and also rendered as a raster using a voronoi diagram as a cheap interpolater. Once ST_Drape (or whatever) is in place, then this could be done as a drape of the original images on the DTM, then rendered back as a raster.

      Code will be in the private PostGIS Cookbook GitHub repo in the next few hours, and on Packt’s site http://www.packtpub.com/support when the time comes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.