Google Groups Home
Help | Sign in
Recent pages and files
Using Databases With Gmaps Apps    

Many people use databases to store large amounts of geo-located data. The following are links to sites that provide sample server-side scripts for interacting with databases, or provide some library that makes it easier.

Definition:

Database 

"A database is a collection of information stored in a computer in a systematic way, such that a computer program can consult it to answer questions. The software used to manage and query a database is known as a database management system (DBMS). The properties of database systems are studied in information science."

Database Management System (DBMS)

"Software that manages, manipulates and retrieves data in a database.

source: Google Search Define:Database, http://en.wikipedia.org/wiki/Database

 

Official Document: 

Pamela Fox, Google Geo Team has written and documented a very helpful and useful tutorial.

"This tutorial is intended for developers who are familiar with PHP/mySQL, and want to learn how to use Google Maps with a mySQL database"

http://code.google.com/support/bin/answer.py?answer=65622&topic=11369

 

 

 

Links:

Google Maps API along with DB2® or Informix®, PHP, JavaScript, and XML let you create an easy-to-use map with your data on it.

http://www.ibm.com/developerworks/db2/library/techarticle/dm-0602lurie/ -  Google Maps API, DB2/Informix, and PHP on Linux


Google Maps using Java and PostGIS 


MySQL Google Maps API


Google Maps AJAX and .NET Tutorial on retrieving overlays from an SQL Server using this control. 

 

Google Maps Database Chunker 

GMDC is a library for downloading and displaying information from a database inside Google Maps in an efficient manner

 

(Mapki) AJAX with PHP and MySQL
 

PHP/mySQL + GMaps Tutorial

 

Official and Documented 'Using PHP and MySQL to create KML'  *recommended

 

 

Google Maps with a MySQL Database  (This is not the best way to use PHP/mySQL with GMaps. The two previous tutorials are suggested instead)


GeoServer - Displays data from PostGIS, MySQL, ArcSDE, DB2, and Oracle Spatial on Google Maps, with a WMS javascript connector, or through OpenLayers.  Also automatically outputs same data as KML


Free Databases

Oracle Free Edition 10g

MySQL

PostgreSQL 

MaxDB

FireBird 

MS SQL Server 2005 Express Edition (Service Pack 2 Released 18/02/07)

GigaBASE 

DB2 Express-C 

Google Spreadsheets

EnterpriseDB (EnterpriseDB substantially enhances PostgreSQL)

 

Cheap DB/Web Storage

Amazon S3 


Google Speadsheet Examples

http://spreadsheets.google.com/pub?key=pAxR-aN5DCiWvv9qkJtz-Xw 

get a txt output

http://spreadsheets.google.com/pub?key=pAxR-aN5DCiWvv9qkJtz-Xw&output=txt

csv output

http://spreadsheets.google.com/pub?key=pAxR-aN5DCiWvv9qkJtz-Xw&output=csv 

selecting a range

http://spreadsheets.google.com/pub?key=pAxR-aN5DCiWvv9qkJtz-Xw&output=csv&gid=0&range=A2:C26 

http://spreadsheets.google.com/pub?key=pAxR-aN5DCiWvv9qkJtz-Xw&output=csv&gid=0&range=A2:C12

 


 

Examples of SQL Commands useful in Google Maps:

 

PostgreSQL

 

Find a polygon that contains a point:

 

select * from mygeotable where point'(35,-90)' @ polygonfield ;

 

Example site: USPS Zip Code Map 

 

Find the closest line segment to a point and the closest point on that line segment to the point:


select *, point '(35,-90)' ## linesegfield as closestpoint,point '(35,-90)' <-> (point '(35,-90)' ## linesegfield) as distance from mygeotable order by distance limit 1 ;


Example site: Reverse Geocoder



MySQL

 

MySQL Spatial Extension (in 5.0)

 

SELECT
  c.cab_driver,
  ROUND(GLength(LineStringFromWKB(LineString(AsBinary(c.cab_loc),
                                             AsBinary(a.address_loc)))))
    AS distance
FROM cab c, address a
WHERE a.address = 'my street 110'
ORDER BY distance ASC LIMIT 1;

 

SQL Server 2005 (with the SQL Server Integration Assembly)


Find polygons containing a point: SELECT location_Shape FROM tbl_Shapes WHERE dbo.LineEncloses(location_Shape, 1, '55.6,12.55') = 1

Find points within a distance: SELECT location_Point FROM tbl_Points WHERE dbo.Distance(location_Point, '55.6,12.55') < 10

Find points within bounds: SELECT location_Point FROM tbl_Points WHERE dbo.BoundsContains(SqlBounds, location_Point)


With Ruby on Rails and GeoKit

GeoKit adds distance finders directly to your ActiveRecord models, with optional integrated geocoding. Examples:

  Store.find(:closest, :origin=>[37.792,-122.393])

  Store.find(:all, :origin=>'100 Spear St, San Francisco, CA', conditions=>'distance<10')

GeoKit also has integrated IP-based geolocation, as well as Ruby wrappers around multiple geocoding services.

 

I found the following site giving the server and client code for
Virtual Earth, it is easy enough to use with google map.

http://www.devfish.net/downloads.aspx

I used a version of the virtual earth starter kit, and adapted it for
google map to get it up and working.

 

data driven navigation/breadcrumb php class w/ mySQL and mod_rewrite

http://gl.obalicio.us

demo

http://gl.obalicio.us/demo/

 

 

 

 

 

 

 

Version: 
Latest 3 messages about this page (16 total) - view full discussion
Dec 13 2007 by mapperz@googlemail.com
EnterpriseDB substantially enhances PostgreSQL

Mapperz
http://mapperz.blogspot.com/

Click on http://groups.google.com/group/Google-Maps-API/web/using-databases-with-gmaps-apps
- or copy & paste it into your browser's address bar if that doesn't
work.
Apr 24 2007 by mapperz@googlemail.com
Added Pamela's excellent tutorial
Official Document:
Pamela Fox, Google Geo Team has written and documented a very helpful
and useful tutorial.
"This tutorial is intended for developers who are familiar with PHP/
mySQL, and want to learn how to use Google Maps with a mySQL database"
http://code.google.com/support/bin/answer.py?answer=65622&topic=11369
Apr 24 2007 by pb734
geospatial data driven navigation/breadcrumb site template using php
class w/ mySQL and mod_rewrite
http://gl.obalicio.us
demo
http://gl.obalicio.us/demo/
Click on http://groups.google.com/group/Google-Maps-API/web/using-databases-with-gmaps-apps
- or copy & paste it into your browser's address bar if that doesn't
13 more messages »
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google