Table of Contents for
Web Mapping Illustrated

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Web Mapping Illustrated by Tyler Mitchell Published by O'Reilly Media, Inc., 2005
  1. Web Mapping Illustrated
  2. Cover
  3. Web Mapping Illustrated
  4. A Note Regarding Supplemental Files
  5. Foreword
  6. Preface
  7. Youthful Exploration
  8. The Tools in This Book
  9. What This Book Covers
  10. Organization of This Book
  11. Conventions Used in This Book
  12. Safari Enabled
  13. Comments and Questions
  14. Acknowledgments
  15. 1. Introduction to Digital Mapping
  16. 1.1. The Power of Digital Maps
  17. 1.2. The Difficulties of Making Maps
  18. 1.3. Different Kinds of Web Mapping
  19. 2. Digital Mapping Tasks and Tools
  20. 2.1. Common Mapping Tasks
  21. 2.2. Common Pitfalls, Deadends, and Irritations
  22. 2.3. Identifying the Types of Tasks for a Project
  23. 3. Converting and Viewing Maps
  24. 3.1. Raster and Vector
  25. 3.2. OpenEV
  26. 3.3. MapServer
  27. 3.4. Geospatial Data Abstraction Library (GDAL)
  28. 3.5. OGR Simple Features Library
  29. 3.6. PostGIS
  30. 3.7. Summary of Applications
  31. 4. Installing MapServer
  32. 4.1. How MapServer Applications Operate
  33. 4.2. Walkthrough of the Main Components
  34. 4.3. Installing MapServer
  35. 4.4. Getting Help
  36. 5. Acquiring Map Data
  37. 5.1. Appraising Your Data Needs
  38. 5.2. Acquiring the Data You Need
  39. 6. Analyzing Map Data
  40. 6.1. Downloading the Demonstration Data
  41. 6.2. Installing Data Management Tools: GDAL and FWTools
  42. 6.3. Examining Data Content
  43. 6.4. Summarizing Information Using Other Tools
  44. 7. Converting Map Data
  45. 7.1. Converting Map Data
  46. 7.2. Converting Vector Data
  47. 7.3. Converting Raster Data to Other Formats
  48. 8. Visualizing Mapping Data in a Desktop Program
  49. 8.1. Visualization and Mapping Programs
  50. 8.2. Using OpenEV
  51. 8.3. OpenEV Basics
  52. 9. Create and Edit Personal Map Data
  53. 9.1. Planning Your Map
  54. 9.2. Preprocessing Data Examples
  55. 10. Creating Static Maps
  56. 10.1. MapServer Utilities
  57. 10.2. Sample Uses of the Command-Line Utilities
  58. 10.3. Setting Output Image Formats
  59. 11. Publishing Interactive Maps on the Web
  60. 11.1. Preparing and Testing MapServer
  61. 11.2. Create a Custom Application for a Particular Area
  62. 11.3. Continuing Education
  63. 12. Accessing Maps Through Web Services
  64. 12.1. Web Services for Mapping
  65. 12.2. What Do Web Services for Mapping Do?
  66. 12.3. Using MapServer with Web Services
  67. 12.4. Reference Map Files
  68. 13. Managing a Spatial Database
  69. 13.1. Introducing PostGIS
  70. 13.2. What Is a Spatial Database?
  71. 13.3. Downloading PostGIS Install Packages and Binaries
  72. 13.4. Compiling from Source Code
  73. 13.5. Steps for Setting Up PostGIS
  74. 13.6. Creating a Spatial Database
  75. 13.7. Load Data into the Database
  76. 13.8. Spatial Data Queries
  77. 13.9. Accessing Spatial Data from PostGIS in Other Applications
  78. 14. Custom Programming with MapServer’s MapScript
  79. 14.1. Introducing MapScript
  80. 14.2. Getting MapScript
  81. 14.3. MapScript Objects
  82. 14.4. MapScript Examples
  83. 14.5. Other Resources
  84. 14.6. Parallel MapScript Translations
  85. A. A Brief Introduction to Map Projections
  86. A.1. The Third Spheroid from the Sun
  87. A.2. Using Map Projections with MapServer
  88. A.3. Map Projection Examples
  89. A.4. Using Projections with Other Applications
  90. A.5. References
  91. B. MapServer Reference Guide for Vector Data Access
  92. B.1. Vector Data
  93. B.2. Data Format Guide
  94.  
  95. ESRI Shapefiles (SHP)
  96.  
  97. PostGIS/PostgreSQL Database
  98.  
  99. MapInfo Files (TAB/MID/MIF)
  100.  
  101. Oracle Spatial Database
  102.  
  103. Web Feature Service (WFS)
  104.  
  105. Geography Markup Language Files (GML)
  106.  
  107. VirtualSpatialData (ODBC/OVF)
  108.  
  109. TIGER/Line Files
  110.  
  111. ESRI ArcInfo Coverage Files
  112.  
  113. ESRI ArcSDE Database (SDE)
  114.  
  115. Microstation Design Files (DGN)
  116.  
  117. IHO S-57 Files
  118.  
  119. Spatial Data Transfer Standard Files (SDTS)
  120.  
  121. Inline MapServer Features
  122.  
  123. National Transfer Format Files (NTF)
  124. About the Author
  125. Colophon
  126. Copyright

Planning Your Map

Planning your map at the outset can save you tremendous amounts of time later. Evaluating what you want to do, what you have to work with, and what you need to collect will help you make realistic decisions about your project.

Choosing a General Scale and Extent

The size and scale of the map you are making will affect various parts of your project. If you want a wall-size map covering your neighborhood, you will have very different requirements than someone planning a world map for a small book. You need to ensure that the data you create will work well with your intended map. Here are some questions to consider:

What part of the world do you want your map to cover?

You may need global, regional, or local-scale data.

What size of map do you want?

The larger the size, the more detailed the information you will probably want. A small map doesn’t show a lot of detail. A large one does.

Will it be interactive or designed for a hardcopy print?

An interactive map gives the reader more options and flexibility. You have to make sure your data can support those options. If you have a global-scale map and the reader can zoom in to their town, will you have detailed data available at that scale? A hardcopy print is less flexible but easier to manage because you work with one scale all the time.

How accurate does the data need to be?

Will the product need to be used for precise navigation, or can you handle some error in your data? You need to know your limits so that you don’t disappoint your readers.

Identifying Data Requirements for Your Base Map

When creating new or customized data it helps to have a base map to start with. You need data in the correct scale, covering the right area. You can then draw features on top of the base to create custom data. The data itself is the goal of this chapter, not a final map product.

The base map gives you a reference to the real world. You may have an air photo you can scan or a topographic map image downloaded from the Internet. Your base data doesn’t necessarily need to look good if you are just using it as a reference for creating data. For example, highway data can be the reference for roughly locating towns. Since all highways won’t be visible at a country-wide map scale, they won’t end up on your final map.

When considering your base map requirements, keep in mind that global scale datasets are available but are often very coarse. There are a lot of detailed air photo and road line files available for the United States. You can probably even locate your house. Canada has a handful of satellite images available for most of the country but not to a scale you can use to locate a home. Other countries have varying levels of data available.

Chapter 5 has a list of data sources that can help you find useful base map data.

What Are Your Sources?

Once you’ve figured out your base map requirements, you need to find the appropriate data so, where do you go to get data? There are many options.

GPS

Global positioning system receivers can be an excellent source for getting locations of interest on to a map. However, receivers don’t always come with programs for getting data out of them in a digital form. If you can get your GPS data into a text file, or better yet a GIS shapefile, you can start using it pretty quickly in your maps. You can even read coordinates off the screen of a receiver and type them into a spreadsheet or text file. You’ll find some ways to access data from a GPS receiver in the O’Reilly book Mapping Hacks.

Tip

A comma-separated values (CSV) file can be converted using the GDAL/OGR utility ogr2ogr, or used in MapServer without conversion. However, it requires the use of the Virtual Data Source driver for OGR. See the Virtual Data Source section in Appendix B to learn how to do this.

See Chapter 7 for general data conversion examples using ogr2ogr and Chapter 10 for how to set up a MapServer application to access OGR data sources.

Air photo interpretation

Air photos can be an excellent source for both a base map or locating features of interest. Digital air photos are ideal for getting started quickly. If they aren’t available don’t despair; you might be able to just scan a printed air photo. A printed air photo can usually be obtained for a reasonable price from a local government map/photo sales office. Purchasing digital images (e.g., satellite imagery) is also possible but often at a premium price.

A digital photo doesn’t have to be sophisticated to be useful. You may find a photo or image of a scanned map on the Internet. If it provides a good frame of reference as a base, it can work.

Your photo image will need to be geo-referenced. Geo-referencing is the process of taking an image or other map data and giving it coordinates. You might specify what the coordinates of the corners of the image are. When you use it as a base map, your new data will be positioned somewhere in the real world. Other geo-referenced data will then be displayed in the same position. More on this is discussed in the “Preprocessing Data Examples” section later in this chapter.

Warning

Some photos are unsuitable for base maps. Oblique air photos (taken from an angle other than straight down) or those taken from the ground can’t be geo-referenced.

When creating new data using a photo base, you go through a process of digitizing a feature. Digitizing is the process of identifying features on the photo base by drawing points, lines, or polygons showing their location. Information is then assigned to those features to identify them later, such as a road name.

Derived products

Sometimes your data is almost exactly what you need, but it requires some modifications. For example, you might have data for all the counties in your state, but only need data for three. You need to remove the unwanted parts. Utilities such as ogr2ogr and gdal_translate allow you to select portions of data and put it into new files, which make your work more efficient and reduces computing resources required for the task. See Chapter 4 for more on these utilities.

Your information may also need further analysis. For example, you want to map features within a certain distance of a stream. If you already have the stream line data, you can create a buffer or area around them to show your area of interest. Two datasets might also be overlaid or intersected to create a new set of information. Deriving products from a more basic source is typical for custom mapping projects.

Tip

A powerful new mapping tool from Google has recently been unveiled that includes street level mapping and satellite imagery (http://maps.google.com).

Local knowledge

Sometimes the most satisfying map projects involve taking personal knowledge or experiences and putting them on a map. This is information that no one else may be able to map (or want to).

You can represent this information in several ways, including drawing on a photo, listing a set of coordinates, referring to place names, postal codes, etc.

For mapping street addresses, online street mapping applications such as MapQuest (http://mapquest.com) can serve as a useful point of orientation. MapQuest produces a map image showing you the location of a certain street address. There are limitations to using this in your own projects, but it is a great tool for getting your bearings or comparing one address to another. O’Reilly’s Mapping Hacks also has some great examples that use these kinds of data.

Ultimately, to map these locations you need some coordinates or a GIS data file. Compiling a list of coordinates can be as easy as putting them into a text file or spreadsheet. If you plan to use MapServer, you can also put coordinates right in the configuration map file. If you can do some programming, various tools are available that allow you to create GIS data files from other sources. For example, you could use MapServer MapScript and write a Python script to convert a text file into a shapefile.