Using GIS in Postgres – Part 2 Real World Examples of PostGIS

Slides:



Advertisements
Similar presentations
Session 8 GPS Orientation II. RayNav 300 Vertical Datum F Select a unit of measure for water depth: –Feet, –Fathoms, or –Meters.
Advertisements

Navigation Fundamentals
Class #10 E6B Flight Computer. Content of lesson w Time-distance problems w Fuel consumption w Statute-to-nautical conversion w True Airspeed w True Altitude.
Global Positioning Systems (GPS) for Precision Farming
Alternate coordinate systems: Solutions for large-scale maps
1 What you will learn  What radian measure is  How to change from radian measure to degree measure and vice versa  How to find the length of an arc.
Aircraft Performance Charts Private Pilot Ground School
AVIATION MATHEMATICS. Training and Testing Training Resources and Guides Pilot Training Download: Pilot’s Handbook of Aeronautical Knowledge.
SABAL SHRESTHA SHERIF HALAWA SHAMA KHADPEKAR JIANWEI LAI SI TRAN GROUP A Tri-Airport Shuttle System.
Overview of Chapter 6 Douglas S. Cairns Lysle A. Wood Distinguished Professor.
Geographic Tools GPH 111. Tools to cover…  Latitude and Longitude  Projections  Map Scale  Conversions  Latitude and Longitude  Projections  Map.
RUNWAYS. Runway Length Requirements  Governmental regulations  Airport location  Critical aircraft  Sources:
Overview SQL Server 2008 Overview Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP, MCTS Microsoft Web Development MCP ITIL.
En Route Performance CPL Performance.
PILOT NAVIGATION Senior/Master Air Cadet. Learning Outcomes Understand the affects of weather on aviation Know the basic features of air navigation and.
The Boeing 777 can hold a max of 550 passengers on board and 2 crew members.
Starter The following times are all in hours. Change them into hours and minutes… a)0.5 hours b)2.5 hours c)3.5 hours d)1.25 hours e)3.75 hours How would.
AIR NAVIGATION Part 1 Distance & Speed. RECAP Latitude and Longitude lines divide the surface of the Earth into degrees and minutes. One minute of latitude.
Federal Aviation Administration Date: July 2011 Terminal Arrival Efficiency Rate (TAER) 101 Metric Explanation.
Twice as fast as Concorde: The supersonic jet that will fly from London to New York in TWO HOURS. Plans for the 20-seat craft were unveiled at the Paris.
By: Alix Davis History of Airbus A320  A320 program was launched in March  Originated in Europe.  First flight on February.
1 1 GG/Sales Support/ March 2013 ERJ 190 Sukhoi SSJ100 Embraer ERJ 190 Airbus A319 Operational and Economic Comparison A319 SSJ100.
By Capt Ab Manan Mansor Project Paper - DFOM. Objectives & Learning Outcomes To enable students to undertake a relatively major research work related.
PILOT NAVIGATION Part 1 Senior/Master Air Cadet. Learning Outcomes Understand the affects of weather on aviation Know the basic features of air navigation.
Word of the Day Nautical Mile: One minute of arc length of latitude or longitude at the equator, or 1852m.
Navigation Ground School CI Pesto. Topics of Discussion Today Time, Speed, and Distance Calculations Solving TVMDC Questions 1 in 60 Rule E6B Calculations.
 The biggest: Delta Air Lines, American Airlines, United Airlines and US Airways  There are over 300 airlines  Over defunct airlines.
Warm Up April 24 th 1.What is the formula for the inscribed angle? 2.What is the formula for a vector outside the circle?
THAT’S RIGHT FOLKS.... MATH! Navigation Calculations.
UNITS OF DISTANCE AND SPEED Statute Mile is a distance of 5,280 Nautical Mile (6,080 feet) is the average length of one minute of latitude. Kilometer is.
1 © 2010 Pearson Education, Inc. All rights reserved © 2010 Pearson Education, Inc. All rights reserved Chapter 1 Equations and Inequalities.
1 Chapter 3 Problem Solving. 2 Word Problems n The laboratory does not give you numbers already plugged into a formula. n You have to decide how to get.
Quantities, Variables, Units and T-Charts
LAB 1 Navigation Coordinate System on Earth
Lecture 6: CRUISE PERFORMANCE
DISTANCE BETWEEN TWO POINTS 8.G.8 Essential Question? How can you use the Pythagorean Theorem to find the distance between two points on a coordinate plane?
1 Press Ctrl-A ©G Dear 2009 – Not to be sold/Free to use Latitude and Longitude Stage 6 - Year 12 General Mathematics HSC.
10. Spherical geometry Cambridge University Press 1  G K Powers 2013.
GEOGRAPHY DATATYPES in SQL Server by jared nielsen linkedin.com/nielsendata.
Airline Industry Students will investigate the airline industry as it relates to logistics and supply chain management.
Objectives: To use speed, distance & time calculations to plan a rescue operation To perform calculations to minimise risk and casualties Speed, distance.
Airbus a380 The Airbus A380 is a double-deck, wide-body, four-engine jet airliner manufactured by Airbus.
A380 presentation L. EVAIN AIRBUS.
Using Ratio Reasoning to Convert Measurement Units
AIRCRAFT MASS (WEIGHT) & PERFORMANCE
Aircraft Sequencing Problem Near Terminal Area
3.07 E6B 1: Flight calculations
Plane Tracking for fun and profit (mostly fun) with ABS-B mode 1090 MHz transmissions For: PART Date: 10/17/17 KC1ELF Tom Kavanaugh.
Global Positioning Systems (GPS) for Precision Farming
Chapter 3 Problem Solving.
System Requirements Review
Commercial aircraft operation engine realibility & safety
Science and Measurement
Sdgsdg.

Aircraft Performance Charts Private Pilot Ground School
--Wendy Mocha Brain Nero Angus
מציאת 2 מטוסים מסוג AN2 מציאת טייס נוסף עם ניסיון מתאים מציאת מכונאי מוסמך לטיסה רכישת ציוד הכרחי + ציוד עזר מציאת סוכן שינוע לאישורי מעבר גבולות ונחיתה.
Using GIS in PostgreSQL
Degrees and radians.
AE 2350 Design Project David Eger Peter Pociask Pi - 42.
Chapter 3 Problem Solving.
777 Neptune Flight Planning.
Degrees and radians Unit 4.2.
LATITUDES AND LONGITUDES
©G Dear 2009 – Not to be sold/Free to use
13-3 – Radian Measures.
LATITUDES AND LONGITUDES
Research Methods: Instrument Accuracy
Embraer ERJ 135 VIP PHOTOS SPECIFICATIONS AIRCRAFT SPECIFICATIONS
Presentation transcript:

Using GIS in Postgres – Part 2 Real World Examples of PostGIS By Lloyd Albin Seattle Postgres Users Group (SeaPUG)

Common Use for GIS Data Many website need to find all of y within x miles of z. Examples: Groupon.com - Find all of ad’s within x miles of home/work/city. Limos.com - Find all of limo companies within x miles of pickup. Maps.google.com - Find all business’s within x miles of address/city. In this demo we will be using a charter airlines quoting system that uses the same math as the above examples.

Challenger 601-3A - Performance http://www.controller.com/listingsdetail/aircraft-for-sale/BOMBARDIER-CHALLENGER-601-3A-ER/1991-BOMBARDIER-CHALLENGER-601-3A-ER/1271959.htm http://e-ditionsbyfry.com/ActiveMagazine/getBook.asp?Path=WAC/2008/07/01&BookCollection=WAC&ReaderStyle=Gray&page=92 Runway length can vary based on temperature and weight. Sodona, AZ airport, while can support this aircraft, you can not take off during the heat of the day for a long flight. Max Fuel Range (nm) Max Payload Range (nm) Long Range Cruise Speed (nmph) Min Runway Length (ft) Fuel Max Pax Rate (hr) 3,370 2,182 425 2,850 Jet A 12 $10,000

The Math The great circle distance d between two points with coordinates {lat1,lon1} and {lat2,lon2} is given by: d=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2)) A mathematically equivalent formula, which is less subject to rounding error for short distances is: d=2*asin(sqrt((sin((lat1-lat2)/2))^2 + cos(lat1)*cos(lat2)*(sin((lon1-lon2)/2))^2)) Convert longitude and latitude to radians (multiply lat/lon by pi/180) Convert radians to nautical miles (multiply d by 180*60/pi()) http://williams.best.vwh.net/avform.htm#Dist http://www.gcmap.com/faq/gccalc

Normal SQL Query Airport Name Identifier Distance (nm) Hours Rate SELECT d.airportname, d.identifier, (2*asin(sqrt((sin(((o.lat*pi()/180)-(d.lat*pi()/180))/2))^2+cos((o.lat*pi()/180))*cos((d.lat*pi()/180))*(sin(((o.lon*pi()/180)- (d.lon*pi()/180))/2))^2)))*180*60/pi() AS distance_nm, ((2*asin(sqrt((sin(((o.lat*pi()/180)-(d.lat*pi()/180))/2))^2+cos((o.lat*pi()/180))*cos((d.lat*pi()/180))*(sin(((o.lon*pi()/180)- (d.lon*pi()/180))/2))^2)))*180*60/pi())/400 AS hours, ((2*asin(sqrt((sin(((o.lat*pi()/180)-(d.lat*pi()/180))/2))^2+cos((o.lat*pi()/180))*cos((d.lat*pi()/180))*(sin(((o.lon*pi()/180)- (d.lon*pi()/180))/2))^2)))*180*60/pi())/400*10000 AS rate FROM flights.airports AS o, flights.airports AS d WHERE o.identifier = 'KBLI' AND d.identifier <> 'KBLI' AND d.jet = 1 AND d.runwaylength > 5000 AND (2*asin(sqrt((sin(((o.lat*pi()/180)-(d.lat*pi()/180))/2))^2+cos((o.lat*pi()/180))*cos((d.lat*pi()/180))*(sin(((o.lon*pi()/180)- (d.lon*pi()/180))/2))^2)))*180*60/pi() < 3000 ORDER BY 3 http://www.chartersuitesoftware.com/updateairports.htm Airport Name Identifier Distance (nm) Hours Rate Las Vegas/Mc Carran Intl,NV KLAS 828.9384 2.072346 $20,723.46

Airports within Range of Bellingham We did not take into account the 2 hour fuel reserve that is required. I believe that there is also special fuel requirement when flying over water.

How to add geom to Database ALTER TABLE flights.airports ADD COLUMN geom public.geography; UPDATE flights.airports SET geom = ST_SetSRID(ST_Point(lon, lat),4326)::geography; 4326 Longitude/Latitude based on WGS 84 32661 Meter based on WGS 84 http://www.spatialreference.org/ref/epsg/4326/ http://postgis.net/docs/manual-2.0/ST_Point.html WGS 84 = World Geodetic System dated 1984

PostGIS Query SELECT d.airportname, d.identifier, ST_Distance(o.geom, d.geom)/1000 AS distance_km, ST_Distance(o.geom, d.geom)/1000*0.53996 AS distance_nm, ST_Distance(o.geom, d.geom)/1000*0.53996/400 AS hours, ST_Distance(o.geom, d.geom)/1000*0.53996/400*10000 AS rate FROM flights.airports AS o, flights.airports AS d WHERE o.identifier = 'KBLI' AND d.identifier <> 'KBLI' AND d.jet = 1 AND d.runwaylength > 5000 AND ST_Distance(o.geom, d.geom)/1000*0.53996 < 3000 ORDER BY 4 0.1881 nm difference between the two methods. http://postgis.net/docs/manual-2.0/ST_DWithin.html Airport Name Identifier Distance (km) Distance (nm) Hours Rate Las Vegas/Mc Carran Intl,NV KLAS 1535.533 829.1265 2.072816 $20,728.16

Airports within Washington State

True Rates with Taxes Item Rate Amount Flight $10,000 per flight hour $20,728.16 Federal Excise Tax 7.5% $1,554.61 Domestic Segment Tax $3.90 per passenger x 12 passengers $46.80 Grand Total $22,329.57 Most Quoting software bases the rates on per hour, nautical mile, or mile. The Federal Excise Tax is also applied to Food, Stewards, Ground Transportation, etc. No segment tax at rural airports International Segment Tax of $17.20 per passenger. http://www.irs.gov/pub/irs-pdf/i720.pdf

Other GeoSpatial Downloads http://geography.wa.gov/GeospatialPortal/index.shtml http://geography.wa.gov/GeospatialPortal/dataDownload.shtml

References Aircraft Photo http://www.controller.com/listingsdetail/aircraft-for-sale/BOMBARDIER-CHALLENGER-601-3A-ER/1991-BOMBARDIER-CHALLENGER- 601-3A-ER/1271959.htm Aircraft Specifications http://e-ditionsbyfry.com/ActiveMagazine/getBook.asp?Path=WAC/2008/07/01&BookCollection=WAC&ReaderStyle=Gray&page=92 Great Circle Math and other aircraft related math http://williams.best.vwh.net/avform.htm#Dist http://www.gcmap.com/faq/gccalc Airport Database http://www.chartersuitesoftware.com/updateairports.htm Spatial Reference: EPSG Projection 4326 - WGS 84 http://www.spatialreference.org/ref/epsg/4326/ IRS Publication 720 – Flight Taxes http://www.irs.gov/pub/irs-pdf/i720.pdf