Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

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: , , , , , | 1 Comment »

Airspace is complicated — and so I abuse PostGIS once again

Posted by smathermather on October 25, 2014

Let’s ignore for a moment the drone hobbiest / enthusiast. What is the shape of airspace for airplanes and commercial and government unmanned aircraft flying under Certificates of Authorization, and how can we visualize it?

Thanks to Anita in the last post, we have the Class B,C,D,E Airspace Shape Files which helps us define the overall shape of controlled airspace.

Map of Detroit, Cleveland, and Pittsburgh Class B Airspace

Map of Detroit, Cleveland, and Pittsburgh Class B Airspace

But, these are 3D things. I want to visualize them thus. Let us put some constraints on the problem. Let’s do it all in PostGIS, that way we can see it in QGIS or on the web. Let’s not use full PostGIS 3D (i.e. the SFCGAL library), not because it isn’t awesome (it truly is) but because it can be hard to install at the moment (although see https://github.com/vpicavet/docker-pggis for an easy way with docker). Finally, true 3D with unconstrained viewing angles and 100% flexibility is… is… well it usually sucks. So, we’ll stick to isometric viewing (thanks to Seth Fitzsimmons of Stamen http://stamen.com/ for his PostGIS isometric code which will be released upon his word). (Update — all the code is there…):

-- 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;

Ok, now let’s rock some geometries with this bad function:

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;

And what do our controlled airspaces look like?

Isometric view of Cleveland controlled airspace

Isometric view of Cleveland controlled airspace

Kind of conical, in this case with some “wings” that serve as approaches. It makes sense, I guess. At the center, where the airport is, controlled airspace goes from the ground up. As we get further from the airport, a set of concentric rings starting at higher elevations provide a controlled space that allows for landing and taking off.

Image of Cleveland airspace with Stamen Toner map as backdrop

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

There are more complicated ones, naturally. We need look no further than Detroit for additional complexity:

Visualization of Detroit controlled airspace

Visualization of Detroit controlled airspace

airspace_detroit_toner

No wonder every time I fly through Detroit, no matter where I’m going, I end up flying over Lake Erie.

If we want really complicated, we need look no further than Cincinnati:
airspace_cinci

What is going on there? Is that due to shape of the hills, or city boundaries?

Finally, what does airspace look like over Ohio, West Virginia, and Pennsylvania (etc.), overall?
airspace_is_complicated_regional

And while the following map isn’t quite right, here is a figure including many of the small airports sans controlled airspace:

View of all controlled and uncontrolled airspace across Ohio and neighbors.

View of all controlled and uncontrolled airspace across Ohio and neighbors.

May an aeronautical pox be upon you!
The above line was not intended in bad taste, but just an homage to the “red dot fever” of early neo-geography (neo-geography which I’m informed definitionally doesn’t exist). Only a few minutes ago, it dawned on me that the deleted phrase could be misinterpreted these days… .

On a related note, if you want an interesting analysis of ebola, read Zeynep Tufekci’s analysis.

(for the record, all heights are exagerated by 5x, for clarity of reading).

Also, in case it wasn’t obvious: Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.

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

Someone is wrong on the internet…

Posted by smathermather on October 23, 2014

Ok @Mapbox, I’ve given you enough grace. I pulled the grumpy-old-man thing with Kenneth Field from ESRI a couple of weeks ago, and ended up apologizing. If i only give ESRI a few hours of grace, 3 months of grace for you is more than fair.

Now, to raise my foot up. We’ll see if it ends up in my mouth again.

Ok, so Mapbox and drones. Mapbox and drones. Those folks are excited about drones. They’ve got a toolchain their working on, and integration into their existing services, and lots of posts about drones. Downright giddiness I say:

https://duckduckgo.com/?q=site%3Amapbox.com+drones&t=canonical

And then this:

Really? 3 months ago, you launch “Don’t Fly Here”, create a repo for feedback and improvements to the data, but the biggest problem that you haven’t even tried to fix is the map really under represents the restrictions on where you should fly if you are trying to stay out of controlled air space, and the major update you do is adding temporary flight restrictions. Glitz and glory over getting the fundamentals right.

Here’s the current Mapbox no fly zones:

not_quite_right

But, we are missing a lot of smaller airports that also have controlled airspace. Let’s be considerate to our hobbiest drone friends and put them in with 3-mile buffers and refine our 5-mile buffers on medium and large airports to include the edges of the airport, just to be on the safe side:

a_little_righter

Well, that’s a bit less inviting. But hey, still plenty of places to fly, right? Uh, no. We forgot, according to the Aeronautical Information Manual, in certain busy airspace, there is a Mode C requirement for all craft flying in the airspace. This means you need to have a transponder to fly in this space between ground and 10,000ft above mean sea level. This is a transponder that weighs several times what your drone can lift — in otherwords a “non-starter”, effectively making these zones no-fly zones as well. What does Hopkins look like with it’s 30 nautical mile Mode C requirement?:

even_righter

Now, to be fair, this is murky legal territory at best and I am not a lawyer. How much applies to hobbiests given the 1981 Advisory Circular I can’t say I know. But, if we are to propose a map to clarify where we can and cannot fly as hobbiests, then we should be including as much information (in a simple and easy to use way) as we can. On these grounds, “Don’t Fly Here” fails.

It’s cool though. It’s an open source data project in an open source community. Community contributions and knowledge will fix all mistakes in time, so my pull request to get to the second map will be reviewed and rejected on solid grounds or integrated, right?

https://github.com/mapbox/drone-feedback/pull/40

Three months later, I’m still waiting… . Fix your map please. Engage your repo users. Do this right. Please.

Posted in Drone, UAS | Tagged: , , | 11 Comments »

Government 2.0 is not the platform

Posted by smathermather on October 8, 2014

(In which Steve vehemently disagrees with a major thought leader on the nature of Civic Technology… .)

(TLDR: Open Data is the platform. Governance participates in, contributes to, and benefits from Open Data, but government is not the platform, Open Data is the platform.)

Tower of people standing on each others shoulders

I’m sorry, Tim O’Reilly. You are a brilliant man, have some truly great ideas, and some successes I hear as a publisher and VC, but on Gov 2.0, you are wrong, or at least 90 degrees away from right.

I like Open Data. I hate Government as a Platform. Why? Two reasons. First (selfish reason), being a platform as your default position does not always have the best views.

To be fair, though, it’s deeper than just the views. Public servants are, after all, like all good persons, servants, so we can’t whine too much about platform / infrastructure services. This is part of what we signed up for.

Counterpoint: historically, government is not just about infrastructure (roads, bridges, sewers, data), but also has a role to play in services. Great Open Data is served not just in raw form, but with great APIs, great interfaces, great front ends. I think this is particularly true (or should be) in the Parks and Recreation sector. Domain expertise matters, and we should be leveraging the domain expertise of our hard working public servants where we can.

But, I can’t win this on selfish arguments alone. Perhaps that is our role in the public sector. We do the pedantic, boring work, we provide the data, and clever, brilliant people who are necessarily outside in the private sector do the value added work.

Let us start with the Classic Example — Google and Portland’s Trimet put together the GTFS standard that allows for transit agencies across the US to share their transit information and thus make it available through services like Google Maps. Thus it is that the platform is governments serving GTFS feeds, private industry (Google) does their magic in creating a common mapping interface for people to easily navigate complicated transit systems, and an angel gets it’s wings.

I would not suggest that this arrangement is bad. Is it a commodification of the commons by means of Open Data? Yes? Do we all benefit from it? Ya. Mostly (although use the transit app for Seoul, Korea for truly great transit software). It’s an acceptable trade (ignoring the commodification of all of our private lives in the trade, but that’s a separate issue from Trimet and GTFS). (The trade works in part, too, because Google derives value from being it’s own privatized Commons, but that’s an analysis for another time, and perhaps a PhD or two)

But if this is the only model we put forth as our Open Data model, we are missing some really important elements. Succinctly, it is not Government that is or should be the platform, any more than OpenStreetMap’s public domain inputs are the most valuable. Open Data is the platform. Governance participates in, contributes to, and benefits from Open Data, but within the context of data, government is not the platform, Open Data is the platform.

It is easy to loose sight of this within the context of Open Data as a new Commons. We have come to some terms with Open Source Software as a Commons. We understand, sometimes with large swaths of apocryphal sociological analysis, elements of the value of Commons within the context of Open Source Software. It is now time to understand Open Data with similar breadth and depth.

When I think of Open Data, I do not want Transit! I want transitivity. Transitivity between legal structures (private and public) and between sectors (health, education, technology, human services, etc.). I want Open Data to be a new Commons that we all contribute to from multiple sectors and structures.

Tonight, as we discussed the future of Open Data in Cleveland, I was refreshed by the interest in placing Open Data as that hub, as that Commons, within the context of the verticals and plays that we seek to engage in a “loosely coupled coalition of the willing”. Bravo to Lev Gonick and others at the meeting who articulated those interlacing pieces of the coalition as follows:

#OpenEd
#OpenGov
#OpenHealth
#OpenEcology
#OpenSustainability

And so, it bears repeating: Open Data is the platform. Governance participates in, contributes to, and benefits from Open Data, but government is not the platform, Open Data is the platform. A new Commons. These are exciting times.

 

 

Posted in Other | Tagged: , , | Leave a Comment »

Public Sector GIS done extraordinarily well

Posted by smathermather on September 28, 2014

Today I’ll highlight the work of Photo of Mr. Yu, B.J. Jang, and Stephen Mather at Smart GeoSpatial Expo 2014Mr. Byeong-Hyeok Yu, one of two GIS people at Korea National Park Service (KNPS). The other GIS person is (if memory serves) in the research branch of that institution.

I’ll highlight a few of Mr. Yu’s projects. To start with, we have the classic natural resource management projects — you remember — those analyses that you did in your college GIS programs that were the promise of what was to come, what you were to do in a career of GIS? Ya. He gets to do those for his real job.endangered_species_mapping

In fairness, based on all he does, I suspect he doesn’t sleep many hours each night.

What else though — that is what you’d hope a parks GIS guy would do. Mr. Yu has piloted KNPS’s drone program, flying a variety of sites which require high resolution aerial imagery with 8 rotor UAS’s.

drones

One of the great gaps in understanding natural resource management is getting both synoptic and detailed spatially explicit information. Drones promise to do both in projects from a few acres to adrones1

few square miles. It’s really refreshing to see KNPS leading the way in this category.

naver_trail_view

There are just two more projects I want to touch on. The first, like drones, is address the question of how do we, as managers of parks, steward high resolution info, in this case both for operations and park users. To this end, Mr. Yu has a small army of park rangers wandering around with backpack camera units mapping out trail view (like streetview) imagery for Naver Daum, (one of Korea’s Google equivalents). I like projects like this, as they leverage existing work within the organization (a small army of park rangers hiking the trails of KNPS and interacting with and helping visitors), and external partnership, in this case Naver to achieve an exceedingly useful product that has the following benefits: documentation of the state KNPS trail system (these data become historical some day), addresses recreational needs and questions of the public, and likely aids in operational and planning questions that would be difficult to address otherwise. (As a side note, for application in the US, I’d be interested in the licensing of the resultant data — I’m an advocate of such data being as liberally licensed as possible, something difficult to accomplish with some of our native tech giants).

OK.  One last project. My organization has been working for a few years on really great online mapping products to ensure that we engage people on the platforms that they occupy, i.e. the physical world, and that embodied in their phone. It is a project of which I am most proud. Not surprisingly, I’m going to steal some ideas from KNPS equivalent. Many ideas, actually… . Mr. Yu has initiated something similar (and in usual fashion, of highest quality) in rolling KNPS native trails app (shown here on a Samsung phone :)

trails_app

This app serves two purposes.

The first is that engagement piece I reference above — the app is an exercise in how to use the smart phone as a platform for engaging, educating, and making comfortable park users.

The second purpose is simple. The app becomes a tool for connecting injured hikers with rescue personnel. To this end, it has already been used twice.

trails_app_rescue

So. Is this public sector GIS as you think of it? Bravo Mr. Yu. For the record, Mr. Byeong-Hyeok Yu has been in his position 3 Years.

Posted in FOSS4G Korea | Tagged: | 3 Comments »

FOSS4G 2015 — reasons you should go

Posted by smathermather on September 27, 2014

I know what you’re thinking. I spoke with you at FOSS4G 2014. You are a vendor who makes his or her money customizing free and open source software for geospatial, or maybe you also do core FOSS4G software development, and you are not sure of the benefits of sacrificing time and energy to go to FOSS4G 2015 in Seoul.

Korea? I’m sure it’s really nice, but I’ll lose a week of productivity for the sake of contracts I may not win. I’d have to take it as vacation. Our hourly rates are so much higher, it would be hard to compete for contracts.

et cetera.

Put it all aside. This, like the first time you started working with OSGeo projects is a long game. It may pay off in 2015 (I think it will), but it may take longer. And like FOSS, it’s worth it.

As Paul Ramsey put it: “I’m anticipating seeing some truly outstanding work that would otherwise be very hard to discover, it’s going to be a must-attend event.” This is an opportunity to discover what Southeast Asia is doing in FOSS. There will be a large Korean contingent. While I haven’t written up the work yet, there’s great private and public sector work happening in Korea. There will be a large OSGeo Japan contingent. I heard tell it’s cheaper to fly to Seoul than between some islands in Japan, so we can expect great participation. And we will see India, Malaysia, Indonesia, the Phillipines, China, Singapore, etc..

Come to FOSS4G in Seoul next year. Yes, the country: people, sea, and mountains are beautiful. The food is delicious to the point of being precious. The hospitality is all enveloping. But, I know that as a contributor to free and open source software, you are a cold-hearted pragmatist. The long game in free and open source software? I’ve got my money on Asia.

Posted in FOSS4G, FOSS4G2015 | Tagged: | 4 Comments »

Thanksgiving

Posted by smathermather on September 23, 2014

It is probably apropos that the week after I left Korea was a holiday everyone in Seoul described as “Korean Thanksgiving” or “Asian Thanksgiving”. This brief post is a celebration of some of the elements of thanksgiving that occur to me as I return from Ohio GIS conference, after recent trips to FOSS4G and FOSS4G Korea. No matter what I do, this will be too short a list… .

So let’s start off with this latest conference, as this is the genesis for this post. And let’s start with Fred Judson. Fred Judson is the Certificate of Authorization Manager for Ohio and Indiana UAS Center and Test Complex. This means that amongst his many roles, he helps Ohio state entities navigate the Certificate of Authorization process that allows them to fly small unmanned aerial vehicles / systems.

It is from conversations with Fred that I can attribute the initial inspiration for OpenDroneMap (Fred blessed the original napkin sketches of my “Here’s what I think we can build with existing open source tools for point cloud generation”) to the genesis of our Park District’s UAS program, a program which will really deepen our ability and inventory, assess, and manage our cultural and natural resources. He’s also a nice guy. Most recently, Fred also invited me to speak on his ‘3D Technology in Your Pocket “A Panel on Image Derived Point Clouds”’ panel today at Ohio GIS, which was an excellent mix of academia, private sector, and public sector practitioners of image derived point clouds.

More thanksgivings: before I go any further, I need to do a shout out to my patient family — my lovely wife April and two nuggins, who have been so patient with my travels of late.little girl hiking on trail I’m headed home now and will be home for a few weeks. They have been kind enough to show their support with hugs, and food, and laundry, as well as amazing conversation.

For my Korea travels, I’ve shown some of my thanksgiving, but let’s name names Jihye Hwang, BJ Jang, Seoin Kim, Heegu Park, and Sanghee Shin (and countless others) for their hospitality and conversation, love for FOSS geospatial technology, and warmth.

For FOSS4G in Portland, special thanks to Darrell Fuhriman and all the FOSS4G 2014 organizers (especially Kristen Kristin Bott), to Paul Ramsey for continuing to encourage and challenge me, to Martin Davis for spending so much of his precious time talking geospatial and life / work balance, to Daniel and Angel and family for hosting me for a night, and for Mele Sax-Barnett for letting me play Vanna for a morning and feeding me Ethiopian at lunch.

Finally, thanks to my GIS crew at the park district. You are my professional and personal inspiration, and tie me, more than any other factor, to that space and that place and that mission. I compare you every day to others at these wonderful global and local conferences, and I can only conclude that I could not be luckier.

I’m sad to say, I’m too tired to remember many more at the moment, many more who should be here, and should be named. Next time I do a tour like this, maybe I can set aside a half hour an evening to name and detail the thanksgivings that should be named.

Cheers all. Home again for a few weeks.

Posted in Other | Leave a Comment »

OpenDroneMap — The MOVIE

Posted by smathermather on September 22, 2014

Apparently travelling for 20 days straight back and forth through 3 time zones across 13 hours of time difference  makes me calmer, more rational, and a better presenter than normal. All 27 minutes and 35 seconds.

And then don’t forget to check out the rest: http://vimeo.com/foss4g

Posted in 3D, Bundler, Camera Calibration, Conference, FOSS4G, FOSS4G 2014, Image Processing, OpenDroneMap, Optics, Photogrammetry, PMVS | Tagged: , , , , , | Leave a Comment »

OpenDroneMap and the art of sneakernet packet making

Posted by smathermather on September 20, 2014

Current scene in the smathermather household — OpenDroneMap sneakernet packets being produced for training 53 people in OpenDroneMap on Monday.
image

(Yes, I’m using rsync, not tar. Old dog. New tricks.)

edit: let’s throw some code up there, ugly though it may be:


START=$(date +%s) && cd /media/user/USB\ DISK/ && rsync -avz /home/user/Desktop/* . && cd .. && \
END=$(date +%s) && DIFF=$(( $END - $START )) && echo && echo "Processing took $DIFF seconds" & \
START=$(date +%s) && cd /media/user/USB\ DISK1/ && rsync -avz /home/user/Desktop/* . && cd .. && \
END=$(date +%s) && DIFF=$(( $END - $START )) && echo && echo "Processing took $DIFF seconds" && \
cd .. &

 

Posted in 3D, Bundler, Camera Calibration, Conference, FOSS4G, FOSS4G 2014, Image Processing, OpenDroneMap, Optics, Photogrammetry, PMVS | Tagged: , , , , , | 6 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 791 other followers