0% found this document useful (0 votes)
26 views26 pages

Geolocation in Drupal (Nodes & Users)

This document discusses geolocation concepts and implementations in Drupal. It defines GIS, geolocation, and geocoding, then reviews options for mapping and locating users in Drupal including OpenLayers, Geofield, Geocode, and Smart IP modules. The goal is to introduce basic mapping and allow geocoding users by IP or device location. Both free and paid IP services are presented for determining user locations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views26 pages

Geolocation in Drupal (Nodes & Users)

This document discusses geolocation concepts and implementations in Drupal. It defines GIS, geolocation, and geocoding, then reviews options for mapping and locating users in Drupal including OpenLayers, Geofield, Geocode, and Smart IP modules. The goal is to introduce basic mapping and allow geocoding users by IP or device location. Both free and paid IP services are presented for determining user locations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

Geolocation in Drupal

(nodes & users)


By Andrew M. Riley
Mediacurrent Consultant
@andrewmriley
Goal

Introduce users to basic mapping concepts, OpenLayers


configuration in Drupal and Geocoding users based off of IP
address or device location.

Disclaimer: Getting fancy may require some type of programming knowledge.


Mapping in General
GIS

A geographic information system, geographical information


science, or geospatial information studies is a system designed
to capture, store, manipulate, analyze, manage, and present all
types of geographically referenced data. In the simplest terms,
GIS is the merging of cartography, statistical analysis, and
database technology.
Source: http://en.wikipedia.org/wiki/GIS
Geolocation

Geolocation is the identification of the real-world geographic


location of an object, such as a cell phone or an Internet-
connected computer terminal. Geolocation may refer to the
practice of assessing the location, or to the actual assessed
location.
Source: http://en.wikipedia.org/wiki/Geolocation
Geocoding

Geocoding is the process of finding associated geographic


coordinates (often expressed as latitude and longitude) from
other geographic data, such as street addresses, or zip codes
(postal codes). With geographic coordinates the features can
be mapped and entered into Geographic Information Systems
Source: http://en.wikipedia.org/wiki/Geocoding
Recap

GIS - System for mapping points and interacting with points.

Geolocation - Real world location of an object represented as


coordinates. Could be the action of looking up or the stored
values.

Geocoding - The action of looking up coordinates to map real


world objects.
Creating a map
The GMap Way

Location Module + GMap


The OpenLayers Way

OpenLayers
+
Geocode
+
Geofield
OpenLayers (map display)

Manages information about the maps (not points)


Displays Maps
Integrates with views
Geofield (storage)

Creates a new field type


Flexible Output
Ties in with Geocode module
Can display a map for users to select a location
Geocode (lookup)

Converts addresses into lat/long


Uses the Geofield field type for storage
Pulls information from other fields
Can use different geocoding engines
Good user experience
Geocoding can be wonky outside of the U.S.
OpenLayers Proximity

***There is currently no D7 version***


Lets users search by distance
Uses view as its interface
Locating your users
Why?

Hide/Change options depending on which country the user


is in
Redirect the user to a different version of the site
Better user identification
Better user experience
How?

1. Find out the users IP Address


2. Lookup the IP Address somehow and find out the location
data.
3. ???
4. Profit
Three Questions

1. Will I be using this on mobile?

2. How much money do I want to spend?

3. Can I process the data at a later date? (and how much data)
Google Loader

Pros: Cons:
Free Not always reliable
Returns more than just Lat Requires an external
& Long source
Unlimited Queries Mobile & International
2-4-1 Loading of JQuery results unreliable
HTML5 Geolocation

Pros: Cons:
Works great on mobile Browser support is
Uses GPS if possible unreliable*
Free Asks the user if you can
use their location
Only returns Lat & Long
Pay Databases & Services

Pros: Cons:
Can be internal or external Can cost a lot of money
Doesn't ask the user to Could have limited number
use their location of queries
Might have the wrong
location for mobile
International data varies
on levels below country
Which one to use?

The right tool for the job + a backup method

or

Use the Smart IP module w/ Device Geolocation

($_SESSION['smart_ip']['location'])
Modules
OpenLayers
http://drupal.org/project/openlayers

Geocode
https://github.com/fillerwriter/geocode

Geofield
http://drupal.org/project/geofield

Smart IP
http://drupal.org/project/smart_ip

Device Geolocation
http://drupal.org/project/device_geolocation
Pay IP Services

MaxMind
http://www.maxmind.com

IP2Location
http://www.ip2location.com

IPInfoDB
http://ipinfodb.com/register.php
More Info

OpenLayers (D6) Presentation by Patrick Hayes


(Far more technical than my talk)
http://yadadrop.com/drupal-video/gis-mapping-drupal-openlayers-geo

OpenLayers (D7) Docs


http://drupal.org/node/595872

OpenLayers (JS Library)


http://openlayers.org/
http://j.mp/rrpq2R

Geolocation in Drupal
(nodes & users)
By Andrew M. Riley
Mediacurrent Consultant
@andrewmriley

You might also like