Multilines to Polygons with GRASS and Quantum GIS

Tonight I had a set of GPS forestry block line features to convert into polygons for a friend. The file had been created using a merge tool in QGIS and incidentally made multiline features. That might have been fine, until we wanted to convert them to polygons. The ftools vector conversion in QGIS broke the polygons at the start of each new line feature. Hmm…

Time for topology tools. I created a simple mapset using the GRASS tools in QGIS, imported the line_in.shp into a new GRASS layer. I then used the snapping generalisation tool with a 5m tolerance to make sure my line features “closed” properly for polygon building. Then I used the line to boundary conversion tool to get the final step done. After loading the layer into my view, I was able to save it as a new shapefile for sending on to the client.

Bang, done. In 20 minutes, including trial and error, I was done. That was quicker than it took me to try to write up the problem for QGIS bug tracker 😉

Here’s a quick (and rough) video showing what I did (even a couple mistakes). Go full screen to see the detail at full res.

Open Data in BC? TRIM Data – Open It Up!

The British Columbia government’s Terrain Resource Information Mgmt Program – (TRIM) mapping program of the late 1990/early 2000’s was one of the first GIS projects I worked on (from a distance). With a comprehensive aerial photography collection programme in place (and awesome guys in Victoria managing it all), we held out breath for several years waiting for good enough weather to finish our Cariboo Region photo coverage. (I’ve stopped cursing the mountains now)

Watching my colleagues digitising from photos and seeing the huge contracts being let to photogrammetry outfits was mind-numbing at best. The sheer volume of data was astounding and the detail (at a 1:20,000 scale) was superior to anything I had ever seen in a GIS. Of course the orthophotos and elevation models were the best eye candy, but the detailed attribution of vectors with innumerable feature codes was really cool. Sure there were limitations, but if I recall correctly, it was limitations with the GIS at the time, not the data. We spent a lot of time working with Safe Software’s FME to arm wrestle this info into submission – but it was actually kind of fun 🙂

Private users had to pony up some good cash to get access to the data – and at the time it seemed well justified as copying DVDs of data around was still new. FTP transfers were still the norm, but you needed a Data Sharing Agreement with the Province to get that level of access. In essence you had to be big business (or working for them) doing work related to government resources (forest management, utilities, etc.) to get that level of access.

All that to say, not too long ago a Few Good Men stood up a WMS to share the TRIM resources (using MapServer, I do believe). This revolutionised my little universe. As a GIS consultant in forestry it meant we could do our job a lot better. For example, no more waiting for DVDs or FTP transfers. But most of all it meant quick access to data we needed on a daily basis – not having to make a choice based on whether it was worth the bother to ask for the data, instead we just used it! Once ArcGIS finally supported WMS, we were able to pull up some background photos and just get the job done reviewing/editing our clients’ data.

How much did we help reduce backlogged data access requests by using this service instead? With this more efficient distribution I thought eventually the data would just be blown open and we could start getting easier access to lower levels of the vector data we really needed (rural roads, elevation models/contours, etc).

So when I saw the announcement this week about the release of a new Open Data policy and catalog at the BC Government, you can guess what I went searching for first.

In short, my searches for elevation, terrain, and contour all provided unrelated results. I did found one for “TRIM” and it sounded very promising: “Topography, Planimetry, Elevations, and Toponymy (place names) for all of British Columbia” – doesn’t that sound like pretty fundamental geodata? But it was precisely the same data source I’ve been using for years, available in KML and WMS only.

Reviewing the metadata shows business as usual (aka “cost recovery”):

I’m not going to judge this “open data” move as pure hype, because I don’t think it is. I assume there are many, many other great datasets released this week – I will enjoy going through more of them eventually. But so far I’m disappointed that this foundational set of base mapping data is still truly locked up. Please open it before it’s so out of date that it’s not usable!

Thanks again to those who got us to having WMS access – my recommendation: put them in charge of getting us vectors or some sort of raw data access and they’ll find a good solution.

Next up, I’ll check on the state of VRI & Forest Cover – the inventories of one of our great Crown timber assets. Are they open now? Or not?

(Hit me on twitter: @spatialguru with your comments)

3D Rendering in the Cloud – Revit Architecture 2012

I’ve been learning Autodesk’s Revit Architecture 2012 along with my kids and we are really enjoying it. We’ve used the open source Blender project and Sketchup a lot in the past but wanted to stretch our wings a bit more seriously.

With architectural smarts, Revit’s really fun to use actually. You don’t just draw masses and meshes (though you can!) and extrude standard shapes. Instead you deal with floors, walls, ceilings and you place components (desks, people, cars) and define materials, costs and more.

The built-in Seek family search tool gives broad access to detailed content, but I also use revitcity.com and you can also import Sketchup models. Sky is the limit really. By the way, it’s not just about 3D visuals, but about the infamous BIM: planning, scheduling, parts lists and more.

Enough intro… (it’s worth a try if you like this kind of stuff).

A labs.autodesk.com project called Neon recently came out that allows you to easily add a toolbar item for sending your projects to a cloud service for rendering. Neat idea, so I gave it a try tonight.

My little study project is a marina design. To render it locally in “best” quality mode took me just over 16 minutes.

To have the web service do it took 1 minute to “upload” and only 45 seconds to do the render (with similar settings). But it did sit in the queue for quite a while – I’m guessing I didn’t get all 64 of their cores working on my project, but it was interesting. I ran several tests earlier that got much better times, I’ll have to dig into how to optimise for performance at some point I guess. It would be nice to see if you are stuck in a queue or not though – that’s my only complaint.

You also get a nice online catalogue of sorts so you can review past renders and easily access them elsewhere. I can go out of the house and see what the kids might have been working on!

Good work on the Neon labs project. Two thumbs up!

A New Venture: Book Publishing

Behind the scenes in my spare time, I’ve been picking away at getting the structure in place for publishing new books with a particular focus on open source geospatial projects.

We are getting close to rolling out our first two books – you can read more information on our motivation and read our invitation for joining us in a recent blog post on the Locate Press site:

http://bit.ly/hMVxo3

Hope to hear from you about books you or your clients, users, students need!

p.s. This is really a side-job experiment done in my spare time – rest assured, I have no desire to quit my day job! 🙂

Ready, Set, FOSS4G!

Close to 300 presentation abstracts submitted! Stay tuned.

Inkscape Batch Mode – Convert SVG to PNG tip

I’m so used to using ImageMagick’s convert command that I felt somewhat cornered when I couldn’t get a decent SVG->raster conversion. I do all my SVG work in Inkscape which can output raster files directly, but I was looking for a batch solution.

Thanks to this ubuntu forum post I realised Inkscape has a batch mode – Imagine that foresight! Bravo. This snippit did the trick, including resizing:

for i in *.svg; do inkscape -f "$i" -e "${i%%.svg*}.png" -w 640x; done

I imagine there are a bunch of other command line options but this was the first I saw, or thought, of them. That’s what happens when we use GUIs too much. I’ll now switch back to using Turtle from the command line for my graphics!

See you in Denver, Sept 2011

For the past 6+ years that I’ve been involved, it’s been awesome to watch the FOSS4G conference grow, along with the (still relatively young) OSGeo mission. As with the past several years, this year the FOSS4G conference promises to be a little different yet very similar on the key points that make it a great place to meet likeminded friends, businesses, researchers and other users.

Our sponsorship program has been officially kicked off today, so for those who were waiting for more info: here it is. Our website is just starting to take form at http://2011.foss4g.org.

Note that there is a low (lower than last year at least) level for sponsors who just want to get their logo out there, with higher levels for those seeking even more great benefits.

Hope to see you there!

p.s. This year I can finally promise to have several copies of my book available for giveaways!

Quick graticule in QGIS

It’s been a long time since I tried QGIS Map Composer, but thought I’d give it a try since I needed a graticule/measured grid graphic. I was surprised at how well the grid feature worked, along with labels and including several label placement options. The scalebar tool is also very nifty. I had my map, grid, etc. all laid out in a couple minutes.

Bonus feature: exported to SVG and (despite warnings from QGIS) had perfectly usable SVG to play with in Inkscape. Nice work folks!

Convert CSV text into a shapefile

This is a brief video I made the other night to show someone how to take basic lat/lon text data and load it into QGIS. As a bonus feature I show how to automate creating a simple line feature as well. Basic stuff, but when asked for the simplest way, I froze 🙂 What’s your simplest way for a new user?

p.s. sorry, it’s flash

OpenStreetMap book out – Be Your Own Cartographer

I had the pleasure of thumbing (virtually) through Jonathan Bennett’s book on OpenStreetMap recently. The paperback edition must be nice and hefty at over 230 pages, but it was thoroughly readable.

He does a good job introducing background material needed for understanding what OSM is all about, but also gently eases you into the tools and services you’ll need to know. Here are a few of my observations while reviewing it.
I particularly appreciated the chapter on Gathering Data Using GPS. This would have helped me the first time I ever used GPS. It’s a good primer in general GPS use along with a few tips – the remainder of the chapter focused on GPS’ing with OSM tools in mind.

Many of us GIS folks might still be asking “What’s a way” anyway? He breaks down the internal structure of OSM XML features as well, so you can get your hands as dirty as you’d like.

Naturally the various editors and renderer options are described well – Potlach, JOSM, Merkaartor, etc. Super in-depth data cleaning and troubleshooting is discussed.

The only thing I felt that was missing from the discussion were other non-OSM apps that provide support for OSM in some way (thinking here of OSM plugins for QGIS for example). But that’s balanced by a brief introduction to using PostGIS as part of the toolchain, so I won’t complain 🙂

I wish I had this when I first started OpenStreetMapping! It’s great that another open source mapping title is now available and that it’s well written is a nice bonus! Thanks Jonathan and Packt Publishing.

http://www.packtpub.com/openstreetmap/book

%d bloggers like this: