Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

And now for something completely different… (guitarmaking by a geo-geek)

Posted by smathermather on December 15, 2014

Guitarmaking (a subset of lutherie) has been an alleged hobby of mine for quite a few years– from the moment I started my first guitar in 1996 or 1997. Over the years, I’ve continue to acquire tools and wood, and started a couple more guitars. I had lots of fire behind my workshop work 7 years ago. And then I got a new and wonderful job. And had a new and wonderful baby boy. And a few years later a new and wonderful baby girl.

Welp, been getting back in the shop in the last few days, and have some pics from assembly. I will build these out over time with explanations, and probably in a separate blog, but for now, you must suffer with unexplained photos re: the mysteries of lute making.

Curly Redwood Top -- jointed and sanded to thickness. This is the face of the future tenor guitar.

Curly Redwood Top — jointed and sanded to thickness. This is the face of the future tenor guitar.

 

Curly Claro walnut back -- unjoined. This will be the back of the tenor guitar.

Curly Claro walnut back — unjoined. This will be the back of the tenor guitar.

 

Joining the curly claro walnut back by cutting along the tops of the board with a plane.

Joining the curly claro walnut back by cutting along the tops of the board with a plane.

 

Curls of walnut from the German E.C. Emmerich Primus Plane.

Curls of walnut from the German E.C. Emmerich Primus Plane.

 

Jointed claro walnut boards reunited.

Jointed claro walnut boards reunited.

 

Animal hide glue, one syringe at a time. Animal hide glue can be a pain to use, but get a cheap hot pot like this, some syringes, and make your hot hide glue on the fly. It works beautifully, saves on lost glue, and gives the ideal joint. Animal hide glue is permanent (lasts hundreds or thousands of years) but will come apart with heat and water, and thus can always be repaired.

Animal hide glue, one syringe at a time. Animal hide glue can be a pain to use, but get a cheap hot pot like this, some syringes, and make your hot hide glue on the fly. It works beautifully, saves on lost glue, and gives the ideal joint. Animal hide glue is permanent (lasts hundreds or thousands of years) but will come apart with heat and water, and thus can always be repaired.

 

Sophisticated clamping devices (a pile of wood with a toolbox on top), framed nicely by a disgusting basement wall.

Sophisticated clamping devices (a pile of wood with a toolbox on top), framed nicely by a disgusting basement wall.

 

And... it was a bad joint, or badly assembled. Some parchment paper and an iron lets me separate and start over with no drama.

And… it was a bad joint, or badly assembled. Some parchment paper and an iron lets me separate and start over with no drama.

And that’s it. I hope you enjoyed. If not, back to Geo posts anyway… .

Posted in Other | Tagged: , , , | 2 Comments »

Korean and Hangul

Posted by smathermather on December 10, 2014

As I am contemplating FOSS4G 2015 (save the date! Seoul, South Korea | SEPTEMBER 14TH – 19TH, 2015) I contemplate what it means to be functionally illiterate for the first time in 30 years.

You see, when, if you are an American born, English and Spanish (kinda) speaking guy and you get dropped into East Asia, there is no alphabet for you to rely on for even the slightest clue about street signs and restaurant names, and everything else.

Now, to be fair, my experience in Seoul this year was not too bad — many signs are written both in English and Korean. But, as I encourage the FOSS4G world to descend upon Korea (especially prompting the Europeans and Americans to go out of their comfort zone a little), I highly encourage a little study of Hangul, the phonetic alphabet of Korea.

Hangul is pretty easy to learn, it’s phonetic (unlike if you try to read Japanese or Chinese), and it will serve you well to study it even a little bit, so you can recognize patterns.

hangul

So, learn some hangul, save the date, and I hope to see you there.

Posted in FOSS4G, FOSS4G2015 | Tagged: , , | Leave a Comment »

And I will fly ten thousand miles…

Posted by smathermather on December 7, 2014

Contemplating FOSS4G 2015, Seoul, South Korea | SEPTEMBER 14TH – 19TH, 2015. It’s only 18 cents a mile to get there from Cleveland, but only 0.11 dollars a kilometer, because the metric system is more economical.

If you need inspiration for your own travels to Korea, Mr. Sanghee Shin has that for you. He starts with technology, food, arts, culture, economic potential, but also solicits your love of booze as incentives to go. I think he might know his audience.

http://www.slideshare.net/endofcap/7-reasons-why-you-should-come-to-foss4g-2015-seoul

Posted in FOSS4G, FOSS4G2015 | Tagged: , , | Leave a Comment »

Landscape Position using GDAL — PT 3

Posted by smathermather on November 25, 2014

More landscape position pictures — just showing riparianess. See also

http://smathermather.wordpress.com/2014/11/22/landscape-position-using-gdal/

and

http://smathermather.wordpress.com/2014/11/24/landscape-position-using-gdal-pt-2/

valleyz3 valleyz2 valleyz1 valleyz

Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL

Posted in Analysis, Ecology, GDAL, Landscape Position, Other, POV-Ray | Tagged: , , , , , , , , , , | Leave a Comment »

Landscape Position using GDAL — PT 2

Posted by smathermather on November 24, 2014

Just pretty pics today of estimated riparianess. If you prefer a bit of code, see previous post http://smathermather.wordpress.com/2014/11/22/landscape-position-using-gdal/

valleys_improved valleys_improved_1 valleys_improved_2 valleys_improved_3 valleys_improved_3.1 valleys_improved_4 valleys_improved_5

Posted in Analysis, Ecology, GDAL, Landscape Position, Other, POV-Ray | Tagged: , , , , , , , , , , | 4 Comments »

Landscape Position using GDAL

Posted by smathermather on November 22, 2014

Hat tip again to Seth Fitzsimmons. I’ve been looking for a good, easy to use smoothing algorithm for rasters. Preferably something so easy, I don’t even need to write a little python, and so efficient I can run it on 30GB+ datasets and have it complete before I get distracted again by the next shiny project (a few hours).

Seth’s solution? Downsample to a low resolution using GDAL, then sample back up to a higher resolution in order to smooth the raster. My innovation to his approach? Use Lanczos resampling to keep location static, and get a great smooth model:

Unsmoothed DEM

Unsmoothed DEM

Smoothed DEM

Smoothed DEM

Code to do this in gdal follows. “-tr” sets our resamping resolution, “-r lanczos” sets our resampling algorithm, and the “-co” flags are not strictly necessary, but I’ve got a 30GB dataset, so it helps to chop up the inside of the TIFF in little squares to optimize subsequent processing.

gdalwarp -tr 50 50 -srcnodata "0 -32767" -r lanczos  -co "BLOCKXSIZE=512" -co "BLOCKYSIZE=512" oh_leap_dem.tif oh_leap_dem_50.tif
gdalwarp -tr 10 50 -srcnodata "0 -32767" -r lanczos  -co "BLOCKXSIZE=512" -co "BLOCKYSIZE=512" oh_leap_dem_50.tif oh_leap_dem_10-50.tif

At first this excited me for cartographic reasons. We can use this to simplify contours, and then use simplified contours at different zoom levels for maps:

But, we can also use this for analyses. For example, if we difference these smoothed images with our original digital elevation model, we get a measurement of local elevation difference, the first step in establishing where valleys, ridges, and other land forms are.

# Resample to lower resolution
gdalwarp -tr 328.0523587211646 328.0523587211646 -srcnodata "0 -32767" -r lanczos  -co "BLOCKXSIZE=512" -co "BLOCKYSIZE=512" oh_leap_dem.tif oh_leap_dem_328.tif
# Upsample again to get nicely smoothed data
gdalwarp -tr 3.048293887897243 3.048293887897243 -srcnodata "0 -32767" -r lanczos  -co "BLOCKXSIZE=512" -co "BLOCKYSIZE=512" oh_leap_dem_328.tif oh_leap_dem_3-328.tif
# Merge two datasets together into single image as separate bands to ensure they are the same dimensions
# (gdal_calc, as a wrapper for numpy requires this)
gdal_merge -separate -o oh_leap_dem_3-328_m.tif oh_leap_dem.tif oh_leap_dem_3-328.tif
# And now we'll use gdal_calc to difference our elevation model with the smoothed one to get relative elevation 
gdal_calc -A oh_leap_dem_3-328_m.tif -B oh_leap_dem_3-328_m.tif --A_band=1 --B_band=2 --outfile=oh_leap_dem_lp_328.tif --calc="A-B"

So, if we want a good proxy for riparian zones, we can use a technique like this, instead of buffering our streams and rivers a fixed distance (in this case, I’ve used 4 different distances:

Map of landscape position estimated valleys in Cuyahoga County, Ohio

Map of landscape position estimated valleys in Cuyahoga County, Ohio

Pretty snazzy riparian finder. It seems to also find upland headwater wetlands (most of them historic and drained for Cuyahoga County). I am now running on 4 million acres of Ohio at a 10ft (~3 meter) resolution. It’s that efficient.

Addendum: It also finds escarpment edges, like the Portage Escarpment in the above, so it is a mix of a few landforms. Darn handy nonetheless.

Posted in Analysis, Ecology, GDAL, Landscape Position, Other, POV-Ray | Tagged: , , , , , , , , , , | 2 Comments »

Quick (and likely apocryphal) post on versioning and databases

Posted by smathermather on November 15, 2014

This is a quick blog post about technologies that I don’t know well… so please comment if you know better. GeoGig and dat are great tools for addressing versioning in data, so what’s the difference?

Screen shot of GeoGig website

GeoGig is built on Java and meant for any “simple features” geometry (points, lines, polygons).

It’s strength is that it is built from the ground up to handle geometries well, going beyond CRUD functions to specifically address geospatial problems in versioning. Think of it as git for geospatial data.

There’s a hosted version in pre-release from BoundlessGeo called Versio and meant to be the GitHub for geospatial data. You can run your local version from http://geogig.org/

From the website:

“Users are able to import raw geospatial data (currently from Shapefiles, PostGIS or SpatiaLite) in to (sic) a repository where every change to the data is tracked. These changes can be viewed in a history, reverted to older versions, branched in to sandboxed areas, merged back in, and pushed to remote repositories.”

—————————————————————————
Ok, so how about dat?

Screen shot of dat website

dat is built on javascript, meant to do streaming data and some other cool features and does CRUD versioning. Think of it as git for data built by web people. Therefore, it “defines an API for reading, writing and syncing datasets”, as opposed to a repository into which one would import data.

“Dat is an open source project that provides a streaming interface between every file format and data storage backend.”

A cursory look indicates it will work for geospatial data, but effectively as blobs, with no special handling for changes within features like GeoGig. But, it does what GeoGig does not, and that is to make datasets automatically syncable.

Like all projects, each has its strengths. Choose your project wisely.

Posted in dat, Database, GeoGig, git, Versio | Tagged: , , , , | 9 Comments »

ICCM — International Conference of Crisis Mappers

Posted by smathermather on November 9, 2014

Screen shot of Crisis Mappers landing page

Screen shot of Crisis Mappers landing page

The mark of a great conference is one that not only is well run and orchestrated, interesting from a content perspective, and full of bright minds, but also one that experiments with elements of interactions to maximize the value delivered to attendees. By these measures, the International Conference of Crisis Mappers (ICCM) succeeds. Normally, I struggle with the call to attend sessions vs. the conference hallway conversations which can be of such great value. ICCM provided enough context and structure for enjoying both, plus a number of other participatory structures in which to interact with and learn from other ICCM attendees.

For attending ICCM, I had plans to only hallway chat about http://OpenDroneMap.org, in order to get a measure of the culture and needs, and also of the interest for such a project from digital humanitarians in an effort to get enough interest to begin to garnish users and contributors. Thanks to some last minute slots opening up, and on the kind recommendation of Jen Ziemke, I was able to show OpenDroneMap at the Tech & Analysis Fair at Google at the start of the conference and also do a well attended deep dive session on Saturday. In each, I got great questions and recommendations, did a brainstorming session on use in the deep dive session, and had a thoroughly great time.

More later, but I will end with this — if you like technology, have empathy and a desire to apply empathetic design, development, and sweat equity to humanitarian needs, then get signed up at http://crisismappers.net, become a participant in HOT, join the Standby Task Force, and / or all the other work done by digital humanitarians, and make your way to Boston next year for the next ICCM.

Bravo, all.

Posted in 3D, International Conference of Crisis Mappers, OpenDroneMap | Tagged: , , | Leave a Comment »

Airspace — A deep rabbit hole

Posted by smathermather on October 25, 2014

In previous maps we looked at Class B, C, and D airspace. Let’s add in Class E0 and E5… (not yet in 3D):

(Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL)

Map showing Class B, C, D, E0, and E5 airspace

Map showing Class B, C, D, E0, and E5 airspace

Previous posts:

http://smathermather.wordpress.com/2014/10/25/airspace-is-complicated-and-so-i-abuse-postgis-once-again/

and

http://smathermather.wordpress.com/2014/10/25/airspace-is-complicated-and-so-i-abuse-postgis-once-again-reprise/

Posted in 3D, Cartography, Database, Drone, PostGIS, PostgreSQL, SQL, UAS | Tagged: , , , , , | Leave a Comment »

Airspace is complicated — and so I abuse PostGIS once again — Reprise…

Posted by smathermather on October 25, 2014

In the previous post: http://smathermather.wordpress.com/2014/10/25/airspace-is-complicated-and-so-i-abuse-postgis-once-again/ we explore the 3D shape and complexity of controlled airspace.

Now here’s the rest of the code. We’ll add our affine transformation ala Seth Fitsimmons:

    SELECT 
        ST_Affine(
            ST_Rotate(geom, -pi() / 2),
            -- isometric
            cos(pi() / 6), -cos(pi() / 6), 0,
            sin(pi() / 6), sin(pi() / 6), 1,
            0, 0, 0,
            0, 0, 0
        )
    AS geom

And integrate that into our original function:

-- Inputs are a geometry and an elevation to move the geometry to
CREATE OR REPLACE FUNCTION threed_iso(footprint geometry, elevation numeric)
  RETURNS geometry AS
$BODY$

-- Force 3D, then translate to the input elevation
WITH floor AS
(
    SELECT ST_Translate( ST_Force3DZ(footprint), 0, 0, elevation ) AS geom
),
-- Now make isometric (and begin Seth Code)
iso AS
(
    SELECT 
        ST_Affine(
            ST_Rotate(geom, -pi() / 2),
            -- isometric
            cos(pi() / 6), -cos(pi() / 6), 0,
            sin(pi() / 6), sin(pi() / 6), 1,
            0, 0, 0,
            0, 0, 0
        )

    AS geom
    FROM floor
)
-- We'll force it back to 3D so QGIS is happy
SELECT ST_Force2D(geom) FROM iso
;
$BODY$
  LANGUAGE sql VOLATILE
  COST 100;

And voila!

DROP TABLE IF EXISTS class_c_isoc;

CREATE TABLE class_c_isoc AS
	SELECT gid, airspace, name, lowalt, highalt, threed_iso(geom, lowalt::numeric * 5) AS geom
	FROM class_c_subset;

Let’s take a look at Washington, DC and surrounds, another nice complicated example:

3D Figure of DC controlled airspace

3D Figure of DC controlled airspace

And again with map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL:

3D Figure of DC controlled airspace

3D Figure of DC controlled airspace

 

Posted in 3D, Cartography, Database, Drone, PostGIS, PostgreSQL, SQL, UAS | Tagged: , , , , , | 3 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 832 other followers