OGR Google Maps Engine API driver
Google Maps Engine was lights out as of January, 2016. -Kurt Schwehr (goatbar)
This project aims to implement an OGR driver for the Google Maps Engine API (GME API), to access the GME API vector table data as a vector file format. I'm also developing this driver as part of my course work for GIS Application Development course (Maa-123.3550 ) at Aalto University.
The GME API gives access to data stored in GME. In addition to vector data you can also store imager and KML files in GME. We'll deal with those later in this project (maybe).
The HTTP requests are of the form:
The API itself is a RESTfull API with a simple URL scheme. The data is delivered as GeoJSON, so the driver uses libjson from the GeoJSON driver. It will also use the OAuth2 code from the Google Fusion Tables Driver.
Using the GME Driver
This section will contain the most recent options for the driver. The driver honors these config params:
|GOA2_CLIENT_ID||The Apiary project Client ID|
|GOA2_CLIENT_SECRET||The client secret from your Apiary project|
|GME_APIKEY||The API key from your Apiary project|
|GME_REFRESH_TOKEN||Generate the GME refresh token by running the swig/python/scripts/gdal_auth.py script|
|GME_ACCESS_TOKEN||Re-use an already created access token. Same as the access parameter below.|
To read tables use this syntax
"GME:tables='<tableId>' [select='<column1,column2,column3,gx_id,geometry>'] [where='<GME WHERE statement>'] [access='access token']"
To write tables use this syntax
The driver also supports transactions and server side argument selection. The driver also supports attribute and spatial filters. Spatial filters get translated into the intersects= parameter, since that's the way to make the API more useful, and bring down the query costs. You can specify a Point, LineString? or a Polygon as a Spatial filter. Any other type is then handled on the client side. It's up to the user to make sure that the batchCreate and batchPatch calls have less than 50 elements (TODO to fix later). TODO: Dynamic QPS throttling.
I'll make a few GME tables available for testing purposes (still work in progress). I'm planning to use the GRASS GIS North Carolina data. However you can set up your own Maps Engine project for free.