tirsdag den 16. marts 2010

Make your own map-based mashup


Her er stumperne til din egen mashup applikation ...
/Sik


Mash your own applications ...
/Sik


Quote

Summary: Map-based mashups abound these days. Mashups require services that can be mashed up. Location-based mashups need services that provide boundary information. With Web-based mapping providers, you can easily create a map-based mashup with little or no capital investment. In this article, learn how to create a KML boundary service from an ESRI shapefile to be used in mashups.

Introduction

Map-based mashups are omnipresent nowadays, largely because services that can be mashed up are widely available. For a map-based mashup, you need services that provide cartographic boundaries. The U.S. Census Bureau releases data on state, county, and ZIP code boundaries in Environmental Systems Research Institute (ESRI) shapefile format. In this article, learn how to create a simple service to deliver KML files from ESRI shapefiles using open source software.

Technology and software products

GIS — Geographical information systems

KML — Keyhole markup language

Mashup — A Web hybrid application that combines data from more than one source into an integrated experience

TIGER — Topologically integrated geographic encoding and referencing

There are many tools and products, both commercial and open source, that you can use to work with spatial data and create mashups. The example in this article uses open source software: PostGIS as the database, GeoTools Java™ library, the OpenLayers mapping library, and Apache Tomcat as the application server.

PostGIS
A spatial extension to the open source relational database PostgresSQL. PostGIS supports spatial data types and functions as described by the OpenGIS Simple Features Specification for SQL standard.
GeoTools
A Java library to perform manipulation of spatial data. GeoTools includes:
  • Support for various spatial data formats (such as ESRI shapefile, Geography Markup Language (GML), MapInfo Interchange Format (MIF)), and spatial transformations.
  • Java Topology Suite (JTS) from Vivid Solutions that defines Java classes to represent spatial data.

The example solution uses GeoTools for spatial transformations and JTS for converting the binary large object (BLOB) data from the database to a geometry.

OpenLayers
An open source JavaScript mapping library that lets you add dynamic maps to Web pages. You can overlay markers, lines, and polygons on top of base maps. The example in this article uses OpenLayers' capability of adding a layer on top of a base map from a KML file.
Apache Tomcat
An open source J2EE JSP and servlet container used in the example to deploy the service.

Download the sample code used in this article. See Resources for the software used in the example.

Getting ready

This section explains what you need to prepare to create the example application in this article.

Logical architecture

Figure 1 shows the logical architecture of the example solution.


Figure 1. Logical architecture
Image showing logical architecture

Ingen kommentarer:

Send en kommentar