Leverage the Spatial Extender: Creating an automatically maintained spatial table from latitude-longitude column data (DB2 Edition)

With instructions for performing distance-based queries and using federated source data

From the developerWorks archives

Robert Uleman

Date archived: January 13, 2017 | First published: April 13, 2006

If you have location information in your database in the form of separate latitude and longitude (or X and Y) columns, the value you get from that information is limited. To take full advantage of the spatial intelligence in your data, you need to turn the separate numeric columns into a single spatial column, so you can display the locations on a map and analyze spatial relationships, using a Geographic Information System (GIS) or the spatial functions provided by the IBM® DB2® Spatial Extender. This article shows you how to create and maintain such a column, using a step-by-step approach that covers all the aspects that complicate this simple process, including map projections, spatial indexing, and error handling. As an application example, it shows how to perform simple, distance-based queries. A separate appendix covers how to use a federated table from another DB2 instance as a source (including those on iSeries™ and zSeries® hosts). Sample code included.

This content is no longer being updated or maintained. The full article is provided "as is" in a PDF file. Given the rapid evolution of technology, some steps and illustrations may have changed.



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management, IBM i
ArticleID=107758
ArticleTitle=Leverage the Spatial Extender: Creating an automatically maintained spatial table from latitude-longitude column data (DB2 Edition)
publish-date=04132006