Categories
All

FOSS4G Seoul – Direct Flights

FOSS4G Seoul is accessible via a direct flight from 42 countries.

Why not visit?

See 2015.foss4g.org

SEOUL FOSS4G 2015

For a list of airports see the Google doc:
https://docs.google.com/spreadsheets/d/116M_HfmKRNqK7Ji89zOcHFpjb7c0F3WDmQ15wu_QQK8/edit?usp=sharing

Categories
All Scotland

X Percent of the Population of Scotland Lives Within Y Miles of Edinburgh

Follow up from the Glasgow post by request.

This is a pretty easy question to answer, using the 2011 Scottish Census population results and the Census Output Area Population Weighted Centroids. Then we get the extents of Edinburgh City Council from OS Boundary Line.

The results are:

,Pop. Count:,%
Scotland, 5295403, 100
Edinburgh , 476626, 9
25 km, 1276757, 24.1
50 km, 2500093, 47.2
50 miles, 3919910, 74
100 km, 4310869, 81.4
100 miles, 4812421, 90.9

So we see more than people live close to Glasgow, but with 50 miles + they are closer to the capital.

To see how these boundaries look on a map:

Population buffers around Edinburgh

A few caveats:
We are using the population weighted centroids, which will produce some minor inaccuracies, but is a very good generalisation.
Also we are using euclidean buffers on the British National Grid plain, so these are not geodesic buffers. The difference will likely be small at these distances.

Categories
All Mapvember OSGEO PostGIS QGIS Scotland

Mapvember 2014

Mapvember: A map/tutorial a day for every day in November.

Some days had more than one map, some had tutorials, one just had a photo. Some were very easy, others would have take a couple of days of work.

Excellent experience, good learning experience and an opportunity to post previous projects that were a bit short of being great. A little time consuming at times though. I started making the maps around half way through October, so I had almost the first week ready when November began, but the days ticked by quickly. Happy to have done it. I encourage everyone to join in next year, or any other month.

Visitor Statistics:

Total views: 3047
Uniques: 2289
Pageviews: 4327

Top 10 Countries:
United Kingdom: 1147
United States: 363
Germany: 183
France: 120
Canada: 85
Italy: 67
Spain: 66
Australia: 56
Switzerland: 42
India: 39

Mapvember Countries

Top 10 Cities:

Glasgow: 340
London: 212
Edinburgh: 122
Rostock: 45
Aberdeen: 42
Stirling: 35
San Jose: 31
Vienna: 28
Berlin: 28
Zagreb: 26

Mapvember Cities

Other Months:
August Visitors: 303
September Visitors: 641
October Visitors: 523
November Visitors: 3047

Most popular posts:
X Percent of the Population of Scotland Lives Within Y Miles of Glasgow – 521
Glasgow Subcrawl Map – 400
Polygon Outlines in QGIS – 276
Setting up PostgreSQL and PostGIS on Linux Mint (Not posted in November) – 258
Glasgow 3D Residential Property Density QGIS2threejs – 218
Georeferencing Vector Data Using QGIS and ogr2ogr (Not posted in November) – 173
Great Circle Flight Lines in Postgis – 171
London Bus Route Maps – 154
Centroid Within Selection in QGIS – 114
QGIS Inverse Shapeburst Fills – 109

Referrals:

Reddit.com: 747
OSGeo.org: 381
Twitter: 122
GIS.StackExchange.com: 71
Facebook: 70
Flickr: 15

Top SubReddits:

/r/glasgow: 200
/r/scotland: 120
/r/london: 46
/r/gis: 19
/r/QGIS: 4

Thanks for visiting.

Categories
All Mapvember

New Zealand Flights

Inspired by: WorldMapsWithout.nz

New Zealand Flights

Categories
All Mapvember

Global Flights Connections

One of many visualizations on this topic, but brings together the previous posts to a nice conclusion.

World flights

Categories
All Mapvember OSGEO QGIS

Clipping Datasets to the Dateline in ogr2ogr

If you want to visualise a global flight great circle dataset in QGIS it needs to be clipped to the dateline.

This is extremely easy to do using ogr2ogr.

The command is simply:

ogr2ogr -wrapdateline output_file.shp input_file.shp

With the results.

Dateline wrapping

Categories
All Mapvember OSGEO PostGIS QGIS

Great Circle Flight Lines in PostGIS

There is an excellent post by Anita Graser about creating Great Circles in PostGIS.

However as of PostGIS version 2.1 this can be done in a different (better) way, using the geography functions.

PostGIS Great Circles

For more information about geography, see:
Introduction to PostGIS – Geography

This allows us to create the great circles without having to add in a new projection.

So we first need to create our three tables in PostGIS:

CREATE TABLE airlines

(Airline_ID integer,Name varchar,Alias varchar,IATA varchar,ICAO varchar,Callsign varchar,Country varchar,Active varchar, uid Serial);
CREATE TABLE routes

(Airline varchar,Airline_ID integer,Source_airport varchar,Source_airport_ID integer,Destination_airport varchar,Destination_airport_ID integer,Codeshare varchar,Stops varchar,Equipment varchar, uid Serial);
CREATE TABLE airports

(Airport_ID integer,Name varchar,City varchar,Country varchar,IATA varchar,ICAO varchar,Latitude double precision,Longitude double precision,Altitude double precision,Timezone double precision, dst varchar, tz varchar, uid Serial);

The data itself can be found at: openflights.org/data.html

We can then load our data through PGAdminIII. You can just right click on a table and select import. Remember to not load the “uid” column, because it is our primary key which will be populated automatically and not in the original data. You will also want to define it as the primary key.

Now we need a geometry column in the airports dataset.

ALTER TABLE airports ADD COLUMN geom geometry(POINT,4326);

We can define our geometry in the airports dataset from the Latitude and Longitude columns.

UPDATE airports SET geom = ST_SetSRID(ST_MakePoint(longitude,latitude),4326);

And create a spatial index.

CREATE INDEX idx_airports_geom ON airports USING GIST(geom);

Then we can create a flights table.

CREATE TABLE flights AS

SELECT

  air1.geom AS source_geom, 

  air2.geom AS destination_geom, 

  airlines.name, 

  routes.equipment, 

  routes.destination_airport_id, 

  routes.source_airport_id, 

  routes.destination_airport, 

  routes.source_airport

FROM 

  public.routes, 

  public.airlines, 

  public.airports air1, 

  public.airports air2 

WHERE 

  routes.airline_id = airlines.airline_id AND

  routes.source_airport_id = air1.airport_id AND

  routes.destination_airport_id = air2.airport_id;

This table will have a source geometry and a destination geometry along with a few other attributes. I added a primary key to this table as well.

To filter out a specific airport, for example Honolulu we use the “Airport ID”.

CREATE TABLE honolulu_flights AS

SELECT * FROM flights

WHERE destination_airport_id = 3728 OR source_airport_id = 3728;

Then we add in the actual line geometry column.

ALTER TABLE honolulu_flights ADD COLUMN line_geom geometry(LineString,4326);

And populating the great circle geomtrey:

UPDATE honolulu_flights

SET line_geom =  

  (ST_Segmentize(

  (ST_MakeLine(source_geom, destination_geom)::geography)

  ,100000)::geometry)

;

This is works great to an extent, but QGIS still has some trouble with lines that cross the date-line.

Screenshot[32]

We can fix this using a Pacific centered projection like EPSG:3832.

Screenshot[33]

We can either set QGIS to the projection. Or we can set our geometry to this projection when creating the flight lines.

ALTER TABLE honolulu_flights ADD COLUMN line_geom geometry(LineString,3832);
UPDATE honolulu_flights

SET line_geom =  

  ST_Transform((ST_Segmentize(

  (ST_MakeLine(source_geom, destination_geom)::geography)

  ,100000)::geometry), 3832)

;

Thanks to:
The World Is A Village – PostGIS: using latitude and longitude to create geometry
http://gis.stackexchange.com/questions/84443/what-is-this-postgis-query-doing-to-show-great-circle-connections

Categories
All Finland Mapvember

Helsinki Airport the Gateway to the East

The shortest route between two points on the earth is a great circle. This is a straight line on a globe, but ultimately looks like half-circle when projected.

Due to Helsinki Airports location, it is an ideal hub for East Asia travel. Starting at practically any European city and travelling to Far East Asia via Helsinki. The final route will almost be a straight line.

Helsinki Flights

Categories
All Mapvember OSGEO PostGIS Scotland

Population of Scotland Mapped

An updated version can be found at: Every Person in Scotland on the Map

One random point on the map for each person within a postcode in Scotland.

Workflow:
OS Code-Point Open points.
>
Voronoi polygons from the postcodes.
>
Join 2011 Scottish Census postcode population counts to Voronoi polygons.
>
Clip the resulting polygons to the Scottish coastline (using PostGIS for time saving).
>
Intersect the lakes out of the resulting polygons.
>
Random point in polygon into the postcode Voronoi polygons (minus lakes), using the census counts.
>
Output:

Population of Scotland Mapped

An easier approach would have been to use the NRS supplied postcode areas for Scotland mentioned in previous posts. A better display of this data would be through a web mapping environment, which is working on my home environment but lacking hosting.

Categories
All Mapvember OSGEO QGIS Scotland

Scotland Azimuth Orthographic Projection

Thanks to the excellent tutorial by Hamish Campbell at: http://polemic.nz/2014/11/21/nz-azimuth-orthographic/

Quick Scotland centric view of the world.

QGIS Azimuth Orthographic Projections