Installing QuantumGIS in Ubuntu

One can install QGIS  either directly through Ubuntu Software Center or through terminal.

I did it through terminal. One just need to give four commands to install it.

 
gurpinder@gurpinder:~$ sudo apt-get install python-software-properties

gurpinder@gurpinder:~$ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable

gurpinder@gurpinder:~$ sudo apt-get update

gurpinder@gurpinder:~$ sudo apt-get install qgis



Screenshot from 2013-07-01 01:20:04










 

Introduction to GIS

GIS is wonderful technology with great tools that help to grasp our data in better way.

GIS or Geographical Information System is a collection of software that allows you to create, visualize, query and analyze geospatial data.

You can say it is a computer-based tool for mapping and analyzing geographic phenomenon that exist, and events that occur, on Earth. Geospatial data refers to information about the geographic location of an entity. This often involves the use of a geographic coordinate, like a latitude or longitude value. One can perform variety of functions using geospatial data like computing distances between two points, or calculating particular area.

GIS has four main functional subsystems:

1. Data Input:  allows to capture, collect, and transform spatial and thematic data into digital form

2.Data Storage and Retrieval:  organizes the data in form which helps user to retrieve data easily

3.Data Manipulation and Analysis :  allows  to define and execute spatial procedures to generate derived information

4. Data Output : allows the user to generate graphic displays, normally maps, and tabular reports

Geospatial data is of two types: Raster data and Vector Data.

We can say that raster data is usually a digital satellite imagery or air photos. Raster data make use of grid-cell data structure where the geographic area is divided into cells identified by row and column.

Vector data is has some qualities which we studied in our trigonometry and coordinate geometry classes. Vector storage implies the use of vectors (directional lines) to represent a geographic feature. Vector data is characterized by the use of sequential points or vertices to define a linear segment. Each vertex consists of an X coordinate and a Y coordinate.

The range of GIS application is very large. You can use it for anything.

Take Crime Mapping. Mapping crime, using GIS, you can identify the crime hot spots. There are many similar examples where you can use GIS.

GIS is even useful to businessmen. One in Real Estate can make strong use of GIS.

Now,I must end with saying “GIS is just AWESOME “.

My thoughts on OpenStreetMap

 

OpenStreetMap is the project that creates and distributes free geographic data for the world.

OSM is a collaborative project to create a free editable map of the world.

OpenStreetMap is the Wikipedia of maps. Everyday thousands of people edit map.

Here I must say – “everyday thousands of people improve map, fix mistakes and are adding new data”.

 

Now, a question comes in mind, What makes OpenStreetMap great ?

There may be different views from different people.

 

There is less chance of mistake or wrong mapping in OpenStreetMap. For the first time, anybody viewing the map can suggest correction. If by mistake one person marked some location wrong, then there would be ten more to pick it.

 

OpenStreetMap project has amazing amount of geodata made available to the world for free. OSM data is even used by many known names on web like Foursquare, Craigslist, Wikipedia, Mapquest, and Apple’s iOS Maps app. It is used in humanitarian operations also, as now many contributers are working together to mark the havoc caused by rain in Kedarnath, India.

 

You can add notes on OSM by just clicking ‘Add a note’ in the bottom right corner.

OpenStreetMap is a map for the people, by the people, and made with personal local knowledge.

Personally, OpenStreetMap is very special to me. Working in OSM project made me feel for the first time that I can love Computer Science as much as I love Civil Engineering. Thank You Rai Sir for you gave me such a awesome project to work.

 

“He that can have patience can have what he will.” ― Benjamin Franklin

Though this post has nothing to do with my training, but still I learned a big lesson from my experience.On Tuesday, while coming back from Kamal’s home, wasp (or some poisonous insect)  stung me on eye. It hurts so bad you want to cry but instead I went to doctor , got a treatment in about one minute.

My eye, however, swelled shut and the whole side of my face swelled to the size of an watermelon.
Even my other eye got swelled too. I was unable to see anything from my one eye and it was irritating too.

I again went to doctor again and asked him to do something for my swelling.But he replied calmly that we don’t have a medicine for swelling (that was really more irritating) but has a weapon to fight with it, that’s the patience.He further said that you can thank GOD  for you are not born like this.Be patient and enjoy every moment of your life.
 

Though this wasn’t a good experience but from I learned a big lesson from it.

Today me and Parbhdeep went to Kamal‘s home. We together  did our work. We made changes in our osm.xml, layeramenity-points.xml.inc,rendred.conf. Then we deleted our cache.

Then we did rendering and got changes in fonts colors and background. Today we got little success and we are going to complete our work soon.

 

Today, day started with new hope,though we were bit worried for our work.

Kamal has some problem with her tiles. So we stared reading bash scripts of my packages.

While reading scripts,we found some files are missing in her file system. In /usr/share/munin/plugins/mod_tile*, Kamal don’t have mod_tile_fresh,mod_tile_zoom,mod_tile_response.

We found that tile server set up with packages and manually have entirely different paths for their files.

Then we all five  sat in circle and discussed about various things like mapnik,rendering processes,apache etc.It was a kind of hot debate.

In evening, we had two presentations. From them, I got to know about many new things

Commands For Package Management

To manage debian packages in ubuntu, we need few commands.

Here are my notes about  various commands :

  1. sudo apt-get install packagename :    Installs a package
  2. sudo apt-get purge packagename: Removes a package,dependencies and its
                                  configuration files
  3. sudo aptitude clean packagename:Deletes downloaded files which were necessary for
                                  installation
  4. sudo aptitude show packagename : Show details about a package name
  5. sudo aptitude dist-upgrade : Updates the Ubuntu system to the next version
  6. sudo dpkg -L packagename : Lists all files and their location in a package
  7. cat /var/log/dpkg.log | grep "\ install\ " :To search for the installed packages use the following command.
  8. sudo apt-get --reinstall install packagename :  If you somehow damage an installed package, or simply want the files of a
    package to be reinstalled with the newest version that is available,use this command.
  9. sudo apt-get -u upgrade :Run this command with the -u option.  This option
    causes APT to show the complete list of packages which will be upgraded.
    Without it, you'll be upgrading blindly.  APT will download the latest versions
    of each package and will install them in the proper order.  It's important to
    always run apt-get update before you try this.
  10. apt-get -u dselect-upgrade : dselect is a program that helps users select Debian packages for
    installation.dselect knows how to make use of the capacity Debian
    packages have for "recommending" and "suggesting" other packages for installation

 

Debian Package Structure

One can find lots of .deb files in directory ‘/var/cache/apt/archives/.

From there I'm taking package “youtube-dl_2012.02.27-1ubuntu0.1_all.deb” to explain structure of Debian package.

As you can see, the package further contains two folders: DEBIAN and usr.

DEBIAN has two files:md5sums and control.

'md5sums' contains for each file in data.tar.gz the md5sum.

The MD5 protection that exists in dpkg is really only useful for accidental corruption, and not necessary to protect the installation path.

You might be interested in the debsums package, but since it uses MD5s, it also is only useful for checking for accidental corruption.

In our example the content looks like this:

....................................................................................................................................

43678cad6a1b4ff3330c2fada3206894 usr/bin/youtube-dl 
2fcb94a9ce36afaeecf4265b19244727 usr/share/doc/youtube-dl/NEWS.Debian.gz 
77da787ff167347b77383440c31891c1 usr/share/doc/youtube-dl/changelog.Debian.gz 
705df117892f3fd870fb153fb3a530a8 usr/share/doc/youtube-dl/copyright 
33ccd4dcbefa3eb9daf7d3774d7734fa usr/share/man/man1/youtube-dl.1.gz

.............................................................................................................................................

Control file : Each Debian package contains the master `control' file, which contains a number of fields, or comments when the line starts with '#'. Each field begins with a tag, such as Package or Version (case insensitive), followed by a colon, and the body of the field. Fields are delimited only by field tags. In other words, field text may be multiple lines in length, but the installation tools will generally join lines when processing the body of the field

Here are contents of control file from my example:

Package: youtube-dl 
Version: 2012.02.27-1ubuntu0.1 
Architecture: all 
Maintainer: Ubuntu Developers  
Installed-Size: 205 
Depends: python (>= 2.5) 
Recommends: ffmpeg, ffmpeg (>= 4:0.6) | ffprobe, rtmpdump 
Section: web 
Priority: extra 
Homepage: http://rg3.github.com/youtube-dl/ 
Description: downloader of videos from YouTube and other sites 
 youtube-dl is a small command-line program to download videos from 
 YouTube.com and other sites that don't provide direct links to the 
 videos served. 
 . 
 youtube-dl allows the user, among other things, to choose a specific video 
 quality to download (if available) or let the program automatically 
 determine the best (or worst) quality video to grab. It supports 
 downloading entire playlists and all videos from a given user. 
 . 
 Currently supported sites are: CollegeHumor, Comedy Central, Dailymotion, 
 Facebook, Metacafe, MyVideo, Photobucket, The Escapist, Vimeo, Yahoo!, 
 YouTube, blip.tv, depositfiles.com, video.google.com, xvideos, Soundcloud, 
 InfoQ, Mixcloud, OpenClassRoom. 
Original-Maintainer: Rogério Brito 

............................................................................................................................................

'man deb-control' has more information about it.

'postinst' and 'prerm' files are not mandatory for your first package. But every proper official Debian package has them for good reasons.

‘prerm’ and ‘postinst’ seem to take care of removing old documentation files and adding a link from doc to share/doc.

Here are contents of prerm file from package “python-apt_0.8.3ubuntu7.1_i386.deb”.

……………………………………………………………………………………………………………………….

#!/bin/sh
set -e

# Automatically added by dh_python2:
if which pyclean >/dev/null 2>&1; then
pyclean -p python-apt
else
dpkg -L python-apt | grep \.py$ | while read file
do
rm -f "${file}"[co] >/dev/null
done
fi

# End automatically added section

……………………………………………………………………………………………………………………………….