Saturday, October 31, 2015

Boundless Geospatial Opportunities

A few weeks ago in GGS 692: Web-based GIS we were assigned a set of exercises writing spatial SQL queries on a spatially enabled database. The reading material for the lesson consists mainly sections from an Introduction to PostGIS tutorial produced by a company named Boundless.

It wasn't until I began reading the tutorial that I realized just how much of the curriculum of our course comes directly from the Boundless materials.  By providing high quality, classroom ready learning materials, Boundless has changed the curriculum in the GIS program GMU from one using proprietary software to one built on free software tools.

I only wish other projects in the free software movement could take this valuable lesson from Boundless and find a way to get their tools into classrooms. If we want to change the world, this is an important part of how we have to do it!

Sunday, October 4, 2015

A Geospatial Werewolf

I've been contemplating a post with the tile "Seduced by the Dark Side - Or Why I Love My MacBook Air".  I decided not to devote a whole post to such evil things, so I'll restrict myself to a few paragraphs and then move on to better things.  Let me just admit it.  I really like using the MacBook Air that I was given at work.  I didn't buy it.  I know it's evil (really, really evil, in fact, since it is sooo seductive), and I will certainly do all I can to resist its evil temptations.  I've already removed all the Apple Store paid for applications that were on it, and I've installed Homebrew and a host of free software (things like QGIS and pgAdmin3).  I also installed VirtualBox and set up a Lubuntu 14.04 VM on it, which I use most of the time. In spite of all that, I have to admit that I really like using it.  I like the way it looks.  I like the way it feels in my hands and under my fingers as I type on it.  I like the way it responds so smoothly and quickly. There, I've come clean and got that out of my system.  The last thing to mention is that when I told my friend Kevin Cole that I had been seduced by the dark side, he knew without being told what I was going to say, and sent me this link, which pretty much hits the nail on the head...

Lubuntu 15.10 - A Geospatial Werewolf

Moving back into the realm of freedom, the upcoming release of Lubuntu 15.04, which I am running now on a few different machines but which will have its official release on October 22nd, offers new Python 3 versions of the geospatial libraries I described in a post back on April 19th. It also comes with QGIS version 2.8, which is a good thing indeed, since the version 2.4 that came with previous versions did not work properly (I couldn't get it to create layers using the DB Manager).  Here are the Python 3 GIS packages I installed on this new version, code named Wily Werewolf:
  • python3-gdal
  • python3-pyproj
  • python3-shapely
  • python3-mapnik
The last one in particular was not available in previous releases. And as if a sign of its strong GIS support, the default background on the Lubuntu version features a TIN pattern.  Here is a screenshot with QGIS running:
I've been tasked this week with looking into how to use mapnik.  Thanks to Wily, I'll be able to do this in Python 3.

Saturday, October 3, 2015

Getting an Arlington Bounding Box of PBF Data

The best source for a current, relatively small data set for OSM PBF data I could find is the Geofabrik website, specifically the Virginia page, which has a PBF file for the state that weighs in at less than 230 MB. After downloading the virginia-latest.osm.pbf file, my next task will be to use osmosis to extract data from within a bounding box containing Arlington County.  The web application BoundingBox provides a nice visual way to do this.

Here is a screenshot of the Arlington County bounding box:
An interesting little curiosity I observed from looking at this bounding box is that little Andrew Ellicot Park lies within Arlington County, Fairfax County, and the city of Falls Church:
After Googling it, it is listed as the originial Western cornerstone of the District of Columbia:
Anyway, enough distraction, back to work.  With osmosis installed and the Virginia data on hand, I ran this command to get just the Arlington data:
$ osmosis --read-pbf file=virginia-latest.osm.pbf --bounding-box top=38.9342803955 left=-77.1723251343 bottom=38.8272895813 right=-77.032081604 --write-pbf file=arlington.osm.pbf
Only a few more steps to create a database and load this data into it:
$ createdb map_arlington $ psql -U postgres -d map_arlington -c 'CREATE EXTENSION postgis' $ imposm --read arlington.osm.pbf $ imposm --write -d map_arlington -U postgres
A database user other than postgres should be used, but this at least documents the process.