
Beginning MapServer Open Source GIS Development ■■■ Bill Kropla Beginning MapServer: Open Source GIS Development Copyright © 2005 by Bill Kropla All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN (pbk): 1-59059-490-8 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Jason Gilmore Technical Reviewers: Howard Butler and Stephen Lime Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis, Jason Gilmore, Jonathan Hassell, Chris Mills, Dominic Shakeshaft, Jim Sumser Associate Publisher: Grace Wong Project Managers: Tracy Brown-Collins and Beckie Stones Copy Edit Manager: Nicole LeClerc Copy Editor: Damon Larson Assistant Production Director: Kari Brooks-Copony Production Editor: Kelly Winquist Compositor: Susan Glinert Proofreader: Linda Seifert Indexer: Carol Burbo Artist: Kinetic Publishing Services, LLC Cover Designer: Kurt Krames Manufacturing Manager: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or visit http://www.springeronline.com. For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit http://www.apress.com. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com in the Downloads section. For my children. Contents at a Glance Foreword . xiii About the Author . xv About the Technical Reviewers . xvii Acknowledgments . xix Introduction . xxi ■CHAPTER 1 Building MapServer . 1 ■CHAPTER 2 Simple MapServer Examples . 15 ■CHAPTER 3 Creating the Mapping Application . 31 ■CHAPTER 4 Modifying a Map’s Look and Feel . 55 ■CHAPTER 5 Using Query Mode . 103 ■CHAPTER 6 Using Perl MapScript . 167 ■CHAPTER 7 Using Python MapScript . 187 ■CHAPTER 8 Using PHP/MapScript . 207 ■CHAPTER 9 Extending the Capabilities of MapScript with MySQL . 231 ■CHAPTER 10 Utility Programs . 291 ■CHAPTER 11 MapServer Reference . 309 ■APPENDIX . 369 ■INDEX . 391 v Contents Foreword . xiii About the Author . xv About the Technical Reviewers . xvii Acknowledgments . xix Introduction . xxi ■CHAPTER 1 Building MapServer . 1 Planning the Installation . 1 Selecting Supporting Libraries . 1 Getting the Software . 4 Building and Installing the Software . 5 Building and Installing zlib. 6 Building and Installing libpng . 7 Building and Installing libJPEG . 7 Building and Installing FreeType. 8 Building and Installing GD . 9 Building and Installing Proj.4. 9 Building and Installing GDAL . 9 Building and Installing shapelib . 10 Building and Installing MapServer . 11 Configuring MapServer and Apache . 12 Online Resources . 13 Summary . 14 ■CHAPTER 2 Simple MapServer Examples . 15 Basic Concepts . 15 Building a “Hello World” Application . 16 Creating the Mapfile . 16 Creating the Initialization File and HTML Template . 20 vii viii ■CONTENTS Building the First Map . 23 Creating the first.map Mapfile. 24 Building the HTML Template for the First Map . 28 Summary . 30 ■CHAPTER 3 Creating the Mapping Application . 31 Mapfile Concepts . 31 The Structure of the Mapfile . 32 The LAYER Object . 33 The CLASS Object. 34 Mapfile Syntax . 34 The Mapfile . 35 Layer 1: Urban Areas . 37 Layer 2: Water Features. 39 Layer 3: State Boundaries . 41 Layer 4: Road Network. 41 The HTML Template . 43 The Initialization File. 43 The Template File . 44 Summary . 50 Code Listings . 51 ■CHAPTER 4 Modifying a Map’s Look and Feel . 55 The Graphic Design of Maps . 61 Labeling for Clarity . 66 Fonts . 66 Color. 67 Orientation . ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages23 Page
-
File Size-