Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Monday, June 29, 2015

Book Review: PostGIS Essentials

I decided to teach myself PostGIS/PostgreSQL.  The other option was returning to GeoServer, which I started last summer, but I will leave the latter for the fall.

After shopping around and reading reader reviews, I purchased PostGIS Essentials, April 2015 by Angel Marquez. I got a Kindle copy which was $22 on Amazon.  Overall, I recommend it for those, like me, who want to learn PostGIS as a beginner. Having even a little SQL knowledge is also very helpful.  However, the later chapters are for much more advanced users and developing web and desktop applications.

The book covers downloading and installing PostGIS and gives a good quick background on its uses. Next, it illustrates three ways to create a spatial database using: 1) the command prompt, 2) the toolbars or GUI in PostGIS, and 3) a SQL script.  

A great way to learn PostGIS/PostgreSQL
Before covering how to insert data into these tables, the book goes into discussion of projections and how to include these in spatial tables.  It then shows how to manually add this information and also extract it from shapefiles and import it into PostGIS.

Next, we get down to business with creating non-spatial and spatial queries/functions and accessing information from more than one database.  Of course, connecting to PostGIS databases in QGIS is also covered as well as doing spatial queries in QGIS using PostGIS using DB Manager toolbar in QGIS.

Going from PostGIS to QGIS is a snap!
Using DB Manager from the database toolbar in QGIS.

You will also find information on GDAL, working with raster files.  The last few chapters cover advanced features including performance tuning and spatial indexes, developing web and desktop GIS applications.  The latter uses NASA World Wind.  (Note: I have only had time to skim these chapters.)

A few quick pointers

  • Early on the book assumes the reader knows where to execute SQL queries..If you are a novice like me it takes a minute to realize it is the magnifying glass 
  • ...and how to switch to a different database table when running code on several different ones. 

  • Be sure to check the column names in data from OpenStreetMap, particularly the id column: osm_id vs. id.
Overall, the book is a great resource to have. Like all of Packt's books the code is available to download on their website, or you can type it in yourself, which is my preference.

Disclosures
I bought the copy of this book on my own.  I served as a reviewer for another Packt publication.

Tuesday, December 2, 2014

Review of the Spatial Computing Class on Coursera

From GPS and Google Maps to Spatial Computing was the first geospatial Coursera course that I took and my second Coursera class. Below, I describe the course, what you'll learn, and key takeaways.  Overall, the course is a unique offering that you should check out!

Overview

The eight-week course is taught by Shashi Shekar and Brent Hecht from the University of Minnesota's Department of Computer Science and Engineering.  The goal of the course is to:
"introduc[e] concepts, algorithms, programming, theory and design of spatial computing technologies such as global positioning systems (GPS), Google Maps, location-based services and geographic information systems."
The class has a workload of 4-10 hours per week depending on which of the three tracks you decide to complete (scroll to the bottom of this post to learn more about the different tracks). The majority of the weeks are close to the four hour end. Week 3's workload was heavy.  Be sure to set aside enough time to watch all of the video lectures each week.

Topics Covered

You will learn why SQL requires extensions for spatial queries as well as how to understand the results from basic spatial queries.  How spatial data are stored, accessed, and algorithms used to solve basic spatial problems (i.e. shortest-path, routing) will be discussed.

You'll also learn about volunteered geographic information, different types of positioning, and even how position can be tracked underground. There are interesting lectures about implicit and explicit spatialization--being able to visualize and analyze spatial information in different ways than you might normally think about. Lastly, you will briefly cover cartography (mainly for those new to GIS and/or computer science focused).

Course Schedule

Week 1: Introduction to Spatial Computing and Overview of Course
Week 2: Spatial Query Languages
Week 3: Spatial Networks (e.g. road networks)
Week 4: Spatial Data Mining
Week 5: Volunteered Geographic Information
Week 6: Positioning
Week 7: Cartography and Geographic Human-Computer Interaction
Week 8: Future Directions in Spatial Computing 

Platforms used: WikiBrain API and briefly TileMill


You will learn about WikiBrain - accessing data from Wikipedia and Atlasify (soon to be released).

Miscellaneous

In addition to lectures/videos and slides, you will see taped/videoconference interviews with leading geospatial professionals. In the first few weeks, I felt this worked well but got a little old as the course went on. Hopefully, future sessions will shorten the interview segments--which can be quite lengthy--and occasionally feel burdensome on top of the other coursework.  You will also have a few required readings that are directly related to the coursework and include interesting real world applications.

Tracks

  • Curiosity:  come as you want! no requirements
  • Concept:  Short quizzes and a Statement of Accomplishment
  • Technical: Harder quizzes and assignments for a Distinguished Statement of Accomplishment
    • For the Technical Track, you will need to complete quizzes for both the Concepts and Technical Track. Having programming experience is recommended for the Technical Track's programming homework.

Signature Track available: Yes.  To learn more about Coursera's signature track visit: https://www.coursera.org/signature/guidebook

You will want to sign-up now for e-mail reminders about future sessions, since Coursera offerings are typically spaced several months apart.  For other geospatial classes on Coursera, visit my earlier post: http://opensourcegisblog.blogspot.com/2014/08/free-online-mapping-classes-from-psu.html.  I will be updating this list in the months to come.  (Please note, like other Coursera classes, it will take several weeks for your Statement of Accomplishment to be posted.)