Online Book Reader

Home Category

Mapping With Drupal - Alan Palazzolo [6]

By Root 334 0
can have fields, which are structured input mechanisms. Three possible fields for a restaurant entity could be names, addresses, and phone numbers. You can make almost any content in Drupal location-aware without any code, just by adding Drupal modules that provide geographic fields. With the right combination of modules, you can create maps that allow your users to find geographically relevant information.

We could go into more details as to why Drupal is a great option for web applications, but the assumption of this book is that you already want to use Drupal and are reading this to further your knowledge of how to map in Drupal.

NOTE

Mapping suites exist in other open source frameworks and languages. For a good alternative to Drupal for mapping and location data handling, check out GeoDjango, a geographical system for the Django framework. It is built on the Python programming language.

Mapping in Drupal


Drupal was one of the earliest content management systems to integrate with external mapping services. The first of these services to be integrated was the Google Maps API in 2005, through the Location and GMap modules. These modules have gained a lot of traction over the years and are still being developed in Drupal 7. In recent years, another approach to mapping in Drupal has centered around the OpenLayers and Geofield modules. The differences between these two approaches will be discussed in Chapter 3, and throughout the rest of the book the tutorials will cover both methods where possible.

Whichever of these methods you use for making maps, they both query spatial information from a database, then use JavaScript to display that information on a map. There are challenges in doing this with large amounts of data, since spatial database queries are slow and web browsers can only handle a limited amount of JavaScript. These challenges will be detailed in Chapter 2, and in the following chapters we will discuss ways of overcoming them.

Chapter 2. Web Mapping Basics


Many people making web-based maps do not come from a geographical information system (GIS) or traditional mapmaking background, and can go years without knowing what a map projection is. This chapter will introduce map projections, data storage, and the challenges of making maps online.

If you just want to start working through the tutorials and making maps, feel free to skim over this chapter and come back to it later. That said, even trained geographers often have to pause to remember which is latitude and which is longitude. While it is not necessary to understand these concepts to make maps with Drupal, there will be a time when it is really helpful. Is all the GPS data that you imported showing up a few meters out of place? You’re probably using mismatched projections. Is your map of Washington, DC, showing up in Antarctica? Your latitude and longitude are probably reversed. The first bug reported for the GMap module in Drupal in October 2005 was because the developer got this wrong.

NOTE

There are many mnemonics to help remember which is which. A common one is “lat is flat”: on a normal map, the lines of latitude run east-west across the map and look horizontal or flat.

Projections and Coordinate Systems


The world is roughly spherical, but computer screens are flat. How we represent the world on a two-dimensional surface and how we locate ourselves and objects on it are difficult problems, and there are many different ways to handle these issues. A map projection is a way of representing the Earth on a flat surface, and a coordinate system is a way of describing a place on a map. These are difficult concepts to fully understand, but they affect how your maps look, how they get used, and how you create maps from a technical standpoint.

Map Projections


A map projection is any method of representing the surface of a sphere or other three-dimensional body on a plane.

-- Wikipedia

This representation is not a simple task and it has consequences depending on the method used. Ideally, we want to depict the territory of,

Return Main Page Previous Page Next Page

®Online Book Reader