Contents
Preface
Conventions Used in This BookUsing Code ExamplesSafari® Books OnlineHow to Contact Us1. Node.js
Getting Started with Node.jsAsynchronous CallbacksUsing Node.js on the WebExpressJSRoutesTemplatesStatic Files2. Geographic Data
Geo DatasetsGeoJSONExample GeometriesGDALInstallingGrab Some DataOgrinfoOgr2ogrGeohash3. CouchDB
How Does CouchDB Work?ReplicationIndexes and ViewsGetting Started with CouchDBCreating a DatabaseCreating a ViewView OptionsUsing ReduceUsing CouchApps…For Fun and ProfitLoad Shared CodeGeoCouchImporting DataUsing Cradle to Talk to GeocouchAdd the CouchappBounding Box QueriesDisplaying the Data Using Node.jsCouchDB Hosting Options4. MapChat - Example Project
Realtime ChatSocket.ioSetting Up the ProjectMaking chat subscriptionsHandling Chat MessagesUsing Google MapsGetting User LocationGrab browser locationCenter and BoundsCustom OverlaysChat Messages from CouchDBClusteringUsing a List FunctionNotify Clients of Cluster UpdatesDisplay List of Clusters in the Client
Overview
Today's mobile devices have GPS and standard APIs to give you access to coordinates—but what can youdo with that data? With this concise book, application developers learn how to work with location data quickly and easily, using Node.js, CouchDB, and other open source tools and libraries.
Node.js makes it simple to run event code on the Web, and the CouchDB document-oriented database lets you store location data and perform complex queries on it quickly. You'll learn how to get started with these tools, and then use them together to build an example project called MapChat, using HTML and JavaScript code samples.
- Learn how to serve dynamic content with Node.js, and use its asynchronous IO to handle several requests at once
- Become familiar with GeoJSON, Geohash, and the Geospatial Data Abstraction Library (GDAL) for working with spatial data
- Build geospatial indexes using the GeoCouch branch of CouchDB
- Combine these tools to build a project that lets users post real-time chat messages tagged with their current map location
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access