StaticMapFetcher
From Fmepedia
The Google Static Maps API (http://code.google.com/apis/maps/documentation/staticmaps/) is a web service that serves Google Map tiles for arbitrary locations. Users calling the service provide a location in the form of a lat/lon coordinate, and the service responds with a map tile centered on the provided location. There are options to change the size of the tile, the zoom level, and even a rudimentary ability to place simple markers. Note: Google does not provide the bounding box for the tile, but it is possible to infer the bounding box from the centerpoint and zoom level.
The StaticMapFetcher transformer downloads a tile for a specified point, and georeferences it appropriately.
Note: This transformer requires Python to be installed.
| Table of contents |
Input
A feature with null, or non-null geometry. If the feature has null geometry, the tile center point must be specified via attribute values. Otherwise the transformer will use the center point of the feature's geometry as the tile's center point.
The transformer will retrieve one tile for each input feature; the feature's original geometry will be replaced with the tile's raster geometry.
Parameters
- Location: Latitude and Longitude in DD.DDDD format
- Zoom Level: An integer in the range of 0-19, where 0 is the entire world, and 19 is the closest to the earth.
- Tile Size: The width and height of the tile in pixels. 512 pixels is the maximum.
- Google API Key: Required for access to the service. Access keys are freely available; sign up (http://code.google.com/apis/maps/signup.html) at Google's site if you do not already have a key.
Output
A feature with raster geometry corresponding to the map tile. The raster CRS is SPHERICAL_MERCATOR. The transformer also adds a _static_map_url attribute containing the url of the tile that was downloaded.
Example
The URL fetching the image below looks as follows:
Note that the link uses a key issued for fmepedia.com. You have to use the key created for your domain with StaticMapFetcher.
Notice
Use of the Google Static Maps service is subject to the Google Maps Terms of Service. Safe Software provides this transformer solely as a technology demonstration, and makes no representation or warrantee regarding its usage. End users are individually obligated to ensure that their use of this transformer complies with the aforementioned Terms of Service.
Related
See also the StaticMapOverlayer transformer which will overlay arbitrary vector features on a mosaiked set of static map tiles.
