Building mapping applications with QGIS create your own sophisticated applications to analyze and display geospatial information using QGIS and Python Westra - Quickly download the ebook to read anytime, anywhere
Building mapping applications with QGIS create your own sophisticated applications to analyze and display geospatial information using QGIS and Python Westra - Quickly download the ebook to read anytime, anywhere
or textbooks at https://ebookultra.com
_____ Follow the link below to get your download now _____
https://ebookultra.com/download/building-mapping-
applications-with-qgis-create-your-own-sophisticated-
applications-to-analyze-and-display-geospatial-information-
using-qgis-and-python-westra/
https://ebookultra.com/download/qgis-and-applications-in-territorial-
planning-1st-edition-nicolas-baghdadi/
https://ebookultra.com/download/pyqgis-programmer-s-guide-extending-
qgis-2-x-with-python-1st-edition-gary-sherman/
https://ebookultra.com/download/create-your-own-website-using-
wordpress-in-a-weekend-1st-edition-moore/
https://ebookultra.com/download/invent-your-own-computer-games-with-
python-early-access-al-sweigart/
Create Your Own Website 4th Edition Scott Mitchell
https://ebookultra.com/download/create-your-own-website-4th-edition-
scott-mitchell/
https://ebookultra.com/download/build-your-own-ajax-web-
applications-1st-edition-matthew-eernisse/
https://ebookultra.com/download/create-your-own-employee-handbook-a-
legal-and-practical-guide-lisa-guerin/
https://ebookultra.com/download/teaching-with-digital-video-watch-
analyze-create-1st-edition-glen-l-bull/
https://ebookultra.com/download/building-node-applications-with-
mongodb-and-backbone-1st-edition-mike-wilson/
Building mapping applications with QGIS create your
own sophisticated applications to analyze and display
geospatial information using QGIS and Python Westra
Digital Instant Download
Author(s): Westra, Erik
ISBN(s): 9781783984671, 1783984678
Edition: Online-Ausg
File Details: PDF, 5.59 MB
Year: 2014
Language: english
Building Mapping Applications
with QGIS
Erik Westra
BIRMINGHAM - MUMBAI
Building Mapping Applications with QGIS
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78398-466-4
www.packtpub.com
Credits
Reviewers Proofreaders
David McDermott Cathy Cumberlidge
Pablo Pardo Ameesha Green
Heegu Park Sonia Sanghera
Christopher Wesson
Indexer
Commissioning Editor Monica Ajmera Mehta
Pramila Balan
Production Coordinator
Acquisition Editor Conidon Miranda
Sonali Vernekar
Cover Work
Content Development Editor Conidon Miranda
Rikshith Shetty
Technical Editor
Shruti Rawool
Copy Editors
Alfida Paiva
Vikrant Phadkay
About the Author
Erik Westra has been a professional software developer for over 25 years, and has
worked almost exclusively with Python for the past decade. Erik's early interest in
graphical user interface design led to the development of one of the most advanced
urgent courier dispatch systems used by messenger and courier companies
worldwide. In recent years, he has been involved in the design and implementation
of systems that match seekers and providers of goods and services across a range of
geographical areas. This work has included the creation of real-time geocoders and
map-based views of constantly changing data. He is based in New Zealand, and
works for companies worldwide.
I would like to thank Ruth, the love of my life, for all her support
and encouragement. I would also like to thank my two children,
Anneke and Oscar, for reminding me what is important in life.
About the Reviewers
His first GIS position was for a UK-based unaddressed mail company. He spent 18
months working with address data, promoting the use of GIS, redesigning delivery
maps, and creating Python scripts to automate common repetitive tasks.
He currently works in the GIS team for a local authority in the UK. Along with
working in GIS, he is the Local Land and Property Gazetteer Custodian and Street
Naming and Numbering Officer. In this role, he has expanded his knowledge of
database management, programming, and web GIS. He has also presented at the
QGIS South East user group, and was part of the panel at GeoUtilities London 2014.
I would like to thank James Rutter for allowing me the time to peer
review this book.
Pablo Pardo is a geographist from Spain. He has studied MSc in GIS, and
specialized in natural risk assessment, focusing his MSc thesis on open data quality.
He also received a certificate of higher education in software development.
After several years of working as a GIS technician, he is now starting his freelance
career, mixing GIS consulting with data analysis and programming.
This is the first book he has helped review. He likes open data, free software,
and geo stuff. You can find more about him at www.pablopardo.es.
A five-year work experience drove him to get a higher degree in business and
management, so he went to the Korean Advanced Institute of Science and
Technology for his MBA (Master's degree in Business Administration), and to the
University of Southern California for his MSBA (Master of Science in Business
Administration). During his time at two graduate schools, KAIST and USC, he
mainly focused on IT and the creative industry. His studies have given him great
opportunities to enhance his cooperation and management skills of various teams
and people, and his knowledge, along with this work experience, has driven him
to pursue successful IT business and efficient marketing strategies.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub
files available? You can upgrade to the eBook version at www.PacktPub.com and as a print
book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
[email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
TM
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book
library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
[ ii ]
Table of Contents
[ iii ]
Table of Contents
[ iv ]
Preface
As software applications become more and more a part of people's lives, the
concepts of location and space become more important. Developers are regularly
finding themselves having to work with location-based data. Maps, geospatial data,
and spatial calculations are increasingly becoming just another part of the everyday
programming repertoire.
A decade ago, geospatial concepts and development was limited to experts in the
Geographic Information Sciences. These people spent years working with maps
and the complex mathematics that underlie them. Often coming from a university
background, these specialists would spend years becoming familiar with a particular
Geographic Information System (GIS), and would make a career of using that system
to draw maps and process geospatial data.
While the ever-popular Google Maps meant that anyone can view and manipulate
a map, the more advanced custom display and processing of geospatial data was
still limited to those who used a professional GIS system. All this changed with
the advent of freely available (and often open source) tools for manipulating and
displaying geospatial data. Now, anybody can learn the necessary concepts and start
building their own mapping applications from scratch. Rather than being limited to
the minimal capabilities and restrictive licensing terms of Google Maps, developers
can now build their own mapping systems to meet their own requirements, and
there are no limits to what can be done.
While the necessary tools and libraries are freely available, the developer still needs
to put them together into a workable system. Often, this is a rather complex process
and requires a lot of understanding of geospatial concepts, as well as how to compile
the necessary wrappers and configure the tools to work on a particular computer.
Preface
Chapter 2, The QGIS Python Console, explores the QGIS Python Console window,
and explains how it acts as a useful tool while building your own custom mapping
applications. It also gives you a taste of what can be done with Python and QGIS,
and improves your confidence and familiarity with the QGIS environment.
Chapter 3, Learning the QGIS Python API, introduces the Python libraries available
for the QGIS Python developer, and shows how these libraries can be used to
work with geospatial data and create useful and interesting maps based on
your geospatial data.
Chapter 4, Creating QGIS Plugins, introduces the concept of a QGIS plugin, and
explains how to write a plugin using Python. We take an in-depth look at how
plugins work, and how to create a useful geospatial application as a QGIS plugin.
We also look at the possibilities and limitations of QGIS plugins.
Chapter 6, Mastering the QGIS Python API, delves once more into the PyQGIS library,
looking at some more advanced aspects of this library, as well as various techniques
for working with QGIS using Python.
Chapter 7, Selecting and Editing Features in a PyQGIS Application, looks at how Python
programs built using PyQGIS can allow the user to select, add, edit, and delete
geospatial features within a map interface.
[2]
Exploring the Variety of Random
Documents with Different Content
CHAPTER XLVI.
NOTIFICATION AND ISOLATION.
ISOLATION.
Both the patient and his attendant need to be isolated in diseases
like scarlet fever, diphtheria and small-pox. The rule is less absolute
in enteric fever. In the following description the standard of
requirements taken is that of the most dangerous infectious disease,
small-pox. The first point to decide is whether the patient may be
safely isolated at home. For small-pox this ought never to be allowed
in a town. For other diseases, this may be permitted, if the following
conditions can be fulfilled.
For Isolation at Home a couple of rooms are required,
preferably on a higher floor or in a detached wing of the house. The
w.c. used for the dejecta of the patient must not be used by any
other members of the household. All linen, towels, handkerchiefs,
etc., should be immersed in actually boiling water containing some
washing soda, before leaving the sick-room. Other articles to be
washed, if they will be deteriorated by soaking in boiling water or a
chemical disinfectant, must be tightly wrapped in bundles, and
covered with a clean wet sheet saturated with a strong disinfectant
solution (page 331). Solid and liquid excreta, expectoration and
other discharges must be treated as described on page 331. The
nurse should not eat her meals in the patient’s room. She should
wear a cotton dress to be changed before going out for a walk. Her
hands must be thoroughly washed and brushed after handling or
helping the patient, particularly in enteric fever. It is advantageous if
the nurse has previously had the patient’s complaint. Attention on
the part of the nurse to minute detail is essential, especially in view
of the possibility of receiving infection from infected articles as well
as directly from the patient. The measures required for the
subsequent disinfection of the sick-rooms and of clothing, bedding,
books, etc., are given on page 332.
The use of hospital isolation has rapidly increased in recent
years, thus releasing private families from a serious burden. The
number of beds which a Local Authority should supply for their
district is usually stated as one for every 1,000 inhabitants, but in
poorer districts this does not suffice. The site of the hospital should
be well removed from houses. There must be a minimum zone of 40
feet between all infected buildings and the boundary walls, and the
same distance between neighbouring buildings. A wall at least 6 ft. 6
in. high should enclose the hospital site. The hospital is divided into
separate detached pavilions for the treatment of different infectious
diseases. A floor space of 156 square feet should be allowed for
each bed. The height of the ward should be about 13 feet, its width
from 24 to 26 feet, and the total cubic space for each patient should
be 2,000 cubic feet for scarlet fever, 2,500 for diphtheria. The
lavatories and water-closets are separated from the main ward by a
cross-ventilated lobby. In an isolation hospital every surface should
be washable; all corners should be rounded off, and all projections
on which dust can lodge avoided. The proportion of window space
should be about 1 square foot to every 70 cubic feet. Special
isolation pavilions are required for cases of doubtful diagnosis. The
ventilation and warming of wards must be carefully regulated. Cross-
ventilation by windows open on opposite sides of the ward can be
maintained in nearly all weathers. The temperature of the ward
should be maintained at 55°-60° F.
Ambulances are usually provided by the Local Authority for the
removal of infectious patients. The ambulance should be cleansed
and disinfected after each journey. The use of private conveyances
for infectious patients is forbidden, except under special limitations.
The hospital isolation of small-pox is beset with special
difficulties. There is a considerable body of evidence indicating that
small-pox may be aerially carried from patients in hospitals to people
living within a zone of half a mile, or possibly further. Without
accepting the view that aerial dissemination of small-pox to
considerable distances from the patient frequently occurs, it still
remains true that, either by this means or by errors in the
administration of small-pox hospitals, they do frequently constitute a
source of danger to persons living in the vicinity. The Local
Government Board recommended that a Local Authority should not
contemplate the erection of a small-pox hospital. (a) On any site
where it would have within a quarter of a mile of it as a centre either
a hospital, whether for infectious diseases or not, or a workhouse, or
any similar establishment, or a population of 150-200 persons; (b)
on any site where it would have within half a mile of it as a centre a
population of 500-600 persons, whether in one or more institutions
or in dwelling-houses.
QUARANTINE.
This term has been chiefly employed to denote the limitation of
the movements of vessels coming from infected ports, for a term
which, as the name indicates, was formerly forty days, but is now
shorter. It may be conveniently employed, however, to signify the
restriction of the movements of all persons who have been
apparently exposed to infection, or who continue to live in infected
dwellings. In this sense we may speak of:
1. Domestic Quarantine.
2. Scholastic Quarantine.
3. National and International Quarantine.
Domestic Quarantine, to a varying extent, is desirable for the
members of a family of which one member has been attacked by an
infectious disease. For small-pox every member of a household
should be kept under strict watch until sixteen days have elapsed
since the last contact with the case of small-pox, or until successful
vaccination has been secured. For enteric fever this strict watch
would be unnecessary, but the remaining members of the household
should be warned to call in a doctor on the first symptom of malaise.
Quarantine is specially indicated for certain occupations. Thus if
the child of an out-door labourer had been removed to a hospital
with scarlet fever, it would be unnecessary to keep the latter away
from work during the following week. If, however, he were a milk-
carrier, or a tailor, or an assistant in a sweet-stuff shop this would be
a desirable measure.
The Quarantine of School Children is more necessary than
that of adults, because the former are more susceptible to infection.
Children are kept from school:
(a) Because the infectious patient still remains in the house. In
this case the healthy children must be kept from school until the
patient has ceased to be infectious and disinfection has been
thoroughly carried out; and for a further period longer than the
longest known period of incubation of the disease in question (page
287), a margin being left for contingencies. It would probably be 8
plus 2 weeks for scarlet fever.
(b) Children are kept from school for a period exceeding the
longest period of incubation when the patient has been removed to
hospital.
The table on page 322, modified from the Author’s School
Hygiene, is introduced as furnishing a convenient summary of the
subject.
Objection is sometimes taken to the exclusion of children under
the above circumstances from school, on the ground that they
continue to mix with others in the street or in neighbouring houses.
Clearly, however, in a school-room, a suspected child may
communicate infection to children coming from widely scattered
streets, while out-of-doors the danger is comparatively slight, and
among neighbours the danger is very limited in area.
It is assumed in the following table that all infected articles have
been disinfected before the termination of the period of quarantine.
DURATION OF
DATE AT WHICH
QUARANTINE OF
DURATION OF SCHOOL
DISEASE. CHILDREN
INFECTION. ATTENDANCE MAY
EXPOSED TO
BE RESUMED.
INFECTION.
Scarlet From 5 to 8 weeks; Not less than 8 weeks 14 days.
fever ceases when all peeling 14 days. from the
of the skin has been beginning of the rash,
completed, and when and then only if no sore
the child is free from throat or sore places.
discharge from the nose
or ear or sore places.
Diphtheria At least 21 days; often Not less than 2 months, 12 days.
much longer. Absence of and not then if strength
infection should be not recovered, or if any
confirmed by sore throat or any
bacteriological tests. discharge from nose,
eyes, ears, etc.
Small-pox About 4 to 5 weeks When every scab has 18 days.
and fallen off.
Chicken
pox
Measles From 3 to 4 weeks; Not less than 4 weeks 21 days.
when all cough and from beginning of rash.
branny shedding of skin
has ceased.
Rötheln 2 to 3 weeks From 3 to 4 weeks from 21 days.
(German beginning of rash.
measles)
Mumps About 21 days from the 4 weeks from the 24 days.
beginning. beginning.
Whooping 6 weeks from the In about 8 weeks 21 days.
cough beginning of whooping,
or when the cough has
quite ceased.
Typhus and 4 to 5 weeks When strength 28 days.
enteric sufficient.
fevers
Influenza 2 to 3 weeks 1 month 10 days.
CHEMICAL DISINFECTANTS.
A chemical disinfectant should fulfil the following conditions: 1. It
must be an efficient germicide. 2. Its germicidal power should not be
destroyed by the fæcal or other polluting matter, with which the
bacteria of infection are associated. 3. For many purposes, it must
not be destructive to or liable to stain the skin, or fabrics, or other
articles to which it is applied. 4. It should preferably not be a virulent
poison; and should be moderately cheap. The search for a
completely non-poisonous disinfectant is a chimera.
There are three great classes of chemical disinfectants.
1. Oxidising agents, as the halogens (chlorine, etc.) and
permanganates.
2. Deoxidising agents, as sulphurous acid (SO₂) and formic
aldehyde (CH₂O).
3. Other disinfectants, which act by coagulating protoplasm or
otherwise, as carbolic acid, corrosive sublimate.
The number of disinfectants is legion. Only the chief ones can be
mentioned and their chief properties described. It is a good rule to
eschew the use of all disinfectants of which the exact composition is
not given; and all disinfectants which are described by “fancy”
names, which are not descriptive of their composition.
A. Oxidising Agents.
B. Deoxidising Agents.
C. Other Disinfectants.
Tar Acids.—When coal tar is treated by acids and alkalies in
succession, it becomes separated into (1) hydrocarbons, (2) phenols
or tar acids, carbolic, cresylic, etc., (3) aniline and other basic
substances. The hydrocarbons are known in commerce as “neutral
tar oils.” They are brown and syrupy, turning milky with water, and
feebly disinfectant. The two most important “tar acids” are phenol or
carbolic acid (C₆H₅OH) and methyl-phenol, also called cresol or
cresylic acid (C₆H₄(CH₃)OH). The higher members of this same
group yield milky emulsions with water, and are less poisonous than
phenol. Various mixtures of them are used as disinfectants, and sold
as creolin, Jeye’s and Lawes’ fluids. Izal belongs to the same series.
Carbolic Acid (phenol) did not kill anthrax spores until a 3 per
cent. strength of its solution was used for 7 days (Koch), but
sporeless anthrax bacilli were destroyed in a few minutes by a 1 to 2
per cent. solution. The disinfecting power of carbolic acid is greatly
increased by adding mineral acids. Carbolic acid and lysol are
superior to creolin for disinfecting stools. A 5 per cent. solution of
carbolic acid destroys tubercle bacilli in sputum in 24 hours. Carbolic
acid powders are in common use. In my opinion quicklime is more
valuable.
Cresol is obtained from “crude carbolic acid” by fractional
distillation at a temperature between 185° and 205° C. A one-half
per cent. solution has equal disinfecting power to a 2 or 3 or
sometimes a 5 per cent. of phenol (carbolic acid).
Creolin consists of cresol emulsified in a solution of hard soap.
Behring classifies the comparative germicidal power of phenol,
cresol, and creolin on bacteria in broth as 1, 4, and 10 respectively.
When albumen is present, creolin loses a part of its disinfectant
power.
Lysol contains 50 per cent. of cresol, dissolved by means of
neutral potash soap. It is completely soluble in water and does not
turn milky as creolin does when water is added. It is more effective
than creolin, and still more than HgCl₂ in albuminous liquids.
Soap has, owing to its alkalinity, disinfectant as well as cleansing
action. A temperature of 55°-75° C. greatly aids its action. Antiseptic
soaps possess no special value as germicides, but carbolic soap is a
useful insecticide.
Lime in a one-tenth per cent. solution destroys typhoid and
cholera microbes.
Mercuric Chloride (HgCl₂, corrosive sublimate) was found by
Koch to destroy anthrax bacilli in a dilution of 1 in 20,000. Others
have obtained less favourable results, but it is certainly a powerful
germicide. The germicidal effect is greatly diminished by contact
with organic matter, an insoluble albuminate of mercury being
produced. For this reason HgCl₂ is not the best disinfectant for
fæces unless mixed with acid, as in the following solution: HgCl₂ ½
oz., HCl 1 oz., aniline blue 5 grains to three gallons of water. This
gives a solution of 1 in 960. The colouring is added to avoid
accidental poisoning. HgCl₂ is not a good disinfectant for linen.
Stains are apt to be fixed by it, and if linen soaked in it is
subsequently washed with soap, without first carefully washing out
the HgCl₂, it is darkened in colour. It attacks metals, and must not
therefore be placed in metal receptacles.
Chloride of Zinc in a solution containing 25 grains to the fluid
drachm is known as “Sir William Burnett’s solution.” It is a good
deodorant, but an inefficient disinfectant.
Chinosol (C₉H₆NKSO₄) belongs to the quinoline group. It is an
almost inodorous powder, very soluble in water, noncorrosive, and
does not stain. A solution of 1 in 1200 forms an efficient germicide.
DISINFECTION BY HEAT.
Heat may be applied in various ways: (1) Prolonged boiling in
water of materials which are not spoilt by this means. (2)
Destruction by fire of infected articles. (3) Dry hot air. (4) Steam.
Boiling kills most pathogenic microbes. The cholera vibrio is killed
in four minutes at a temperature of 52° C. (126° F.); the typhoid
bacillus at 59°.4 C. (138°.8 F.) in ten minutes. If boiling be continued
for five minutes, the spores of pathogenic microbes are killed. The
addition of one to two per cent. of washing soda to the water
hastens this effect. For infected linen nothing beyond this is
required.
Destruction by Fire is to be recommended for comparatively
worthless articles, such as toys, straw from beds, rags, old clothing
and bedding.
Dry Hot Air has been largely used in the past in ovens, for the
disinfection of bulky bedding. It is now entirely superseded by
steam. Its disadvantages are that (a) heat penetrates very slowly
into the interior of bedding. Disinfection in test experiments was not
accomplished in the interior of small bundles of clothes in three or
four hours. (b) Scorching of articles often occurs. The sole
advantage of this method is that bound books and leather goods are
less liable to be damaged by it than by steam. If no other apparatus
is available a baker’s oven will serve to kill the non-sporiferous
microbes of cholera, enteric fever, and diphtheria, as well as animal
vermin. If, however, we accept the proper test proposed by
Buchanan of the efficacy of disinfection, the “destruction of the most
stable known infective matter,” dry heat is unsatisfactory.
Steam may be employed as a disinfectant either (a) superheated,
or (b) saturated, i.e. close to the temperature at which condensation
occurs. This temperature depends upon the pressure under which
the water has been boiled. At ordinary atmospheric pressure it is
100° C. (212° F.). The temperature of boiling is raised by subjecting
the water to pressure. Consequently boiling water and the steam
produced from it may be at any temperature. Thus steam may be
Fig. 57.
Equifex Saturated Steam Disinfector.
Fig. 58.
Equifex Spray Disinfector in Use.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com