User Tools

Site Tools


thinkgeo_cloud_maps_raster_tiles

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
thinkgeo_cloud_maps_raster_tiles [2019/02/21 22:49]
benbai [RESTful APIs]
thinkgeo_cloud_maps_raster_tiles [2019/03/19 16:59]
benbai [Get Maps Raster Tile By XYZ]
Line 7: Line 7:
 * //**Try it Online**:// All the ThinkGeo Cloud RESTful APIs can be tested online following the instructions below: ​ * //**Try it Online**:// All the ThinkGeo Cloud RESTful APIs can be tested online following the instructions below: ​
   *  Get a ThinkGeo Cloud Client Key. Check out [[https://​wiki.thinkgeo.com/​wiki/​thinkgeo_cloud_client_keys_guideline|ThinkGeo Cloud Client Keys Guideline]] see how to apply one. It's free for 60 days.  ​   *  Get a ThinkGeo Cloud Client Key. Check out [[https://​wiki.thinkgeo.com/​wiki/​thinkgeo_cloud_client_keys_guideline|ThinkGeo Cloud Client Keys Guideline]] see how to apply one. It's free for 60 days.  ​
-  ​ //** **// Authorize with the key at the top of [[https://​cloud.thinkgeo.com/​help/​|ThinkGeo Cloud APIs]] and you are then free to play with all the APIs online. ​+   Visit our [[https://​cloud.thinkgeo.com/​help/​|ThinkGeo Cloud API Explorer]], click the "​Authorize"​ button at the top and enter your client credentials. You are then free to play with all the APIs online. ​
  
  
 //​**ThinkGeo Cloud provides a RESTful API to consume the map tiles**:// //​**ThinkGeo Cloud provides a RESTful API to consume the map tiles**://
 +
 +==== Get Maps Raster Tile By XYZ ====
 +Get the raster tile at the specified zoom level and X/Y coordinate, using the supplied parameters.
 +
 <code html> ​ <code html> ​
-<!-- Get one Raster Tile based on given parameters --> 
 HTTP GET  HTTP GET 
 https://​cloud.thinkgeo.com/​api/​v1/​maps/​raster/​{style}/​x{resolution}/​{srid}/​{tileSize}/​{tileZ}/​{tileX}/​{tileY}.{fileExtension}?​apikey={key}</​code>​ https://​cloud.thinkgeo.com/​api/​v1/​maps/​raster/​{style}/​x{resolution}/​{srid}/​{tileSize}/​{tileZ}/​{tileX}/​{tileY}.{fileExtension}?​apikey={key}</​code>​
-//​**Parameters**//​ +//**URL Parameters**//​ 
-  *  //**style**//: The style for the requesting ​tile, available ​values are "light""dark", "aerial", "hybrid" ​and "transparent-background+  * <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​style:</span> ​The style of the raster ​tile. Available ​values are:</​span></​html>​ 
-   //**resolution**//: The resolution ​for the requesting ​tile. "​x1"​ is available ​and "​x2" ​will be supported ​soon. "​x1"​ is good enough ​for a regular 96 dpi monitor while "​x2"​ is good for high DPI display especially on Apple devices.  ​Behind the Scene, the server will create an 1024*1024 ​image to serve a 512*512 ​x2 tile.  +     * <​html><​span class="api-parameter"><​span class="api-parameter-name">​light</​span>​ - street maplight theme</​span></​html>​ 
-  *  //**srid**//:The SRID for the requesting ​tile, currently ​only "​3857"​ (Spherical Mercator) is supported +     * <​html><​span class="api-parameter"><​span class="​api-parameter-name">​dark</​span>​ - street mapdark theme</​span></​html>​ 
-  *  //**tileSize**//: The size of the requesting ​tile"​512"​ is recommended. "​256"​ is also supported.  +     * <​html><​span class="api-parameter"><​span class="api-parameter-name">​aerial</​span>​ - aerial imagery</​span></​html>​ 
-  *  //**tileZ**//: The Z index (zoom level) of the requesting tile, from 0 to 19. Zoom Level 0 is the highest ​zoomlevel ​with the entire world in one single tile, Zoom Level z has 4^z tiles for the entire world. The greater the z is, the lower the current ​zoomlevel ​is.  +     ​<​html><​span class="​api-parameter"><​span class="​api-parameter-name">​hybrid<​/span> - aerial imagery with street map overlaid on top</span></​html>​ 
-  *  //**tileX**//: The X index (column index in the tiling matrix) of the requesting tile. It is within [04^zfor zoomlevel ​z.  +     <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​transparent-background<​/span> - street map with transparent background<​/span></​html>​ 
-  *  //**tileY**//: The Y index (row index in the tiling matrix) of the requesting tile. It is within [04^zfor zoomlevel ​z.  +  * <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​resolution:</​span> ​The resolution ​of the raster ​tile. "​x1"​ is available ​for all sizes, while "​x2" ​is supported ​in certain scenarios "​x1"​ is intended ​for display on a regular ​72-96 DPI laptop or desktop ​monitorwhile "​x2"​ is for high-DPI displays such as mobile phones and tablets.  ​When you request an "​x2"​ tile, the server will double the size of the image while rendering the same geographic area.  So if you request an "x2" ​tile at size 512, the server will return you a 1024x1024 image.  ​</span><​/html> 
-  *  //**fileExtension**//: The format of the requesting ​tile, "png" ​is available ​for light/​dark/​transparent-background ​styles, ​"​jpeg" ​and "jpg" are available ​for aerial/​hybrid ​styles +  ​<​html><​span class="​api-parameter"><​span class="​api-parameter-name">​srid:</span> ​The spatial reference system ID for the raster ​tile.  Currently ​only "​3857"​ (Spherical Mercator) is supported.</​span></​html>​ 
-  *  ​//**apikey**//:​ the apikey.  +  * <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​tileSize:</span> ​The pixel size of the raster ​tile"​512"​ is recommended. "​256"​ is also supported.</​span></​html>​ 
- +  * <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​tileZ:</​span> ​The Z index (zoom level) of the requesting tile, from 0 to 19. Zoom Level 0 is the highest ​zoom level with the entire world in one single tile.  Each zoom level <em>z</​em> ​has 4<​sup><​em>​z</​em></​sup> ​tiles for the entire world. The greater the z value, the closer to the Earth'​s surface ​the current ​zoom level is.</​span></​html>​ 
-  *  //​**Sample Request URI**//: [[https://​cloud.thinkgeo.com/​api/​v1/​maps/​raster/​light/​x1/​3857/​512/​0/​0/​0.png?​apikey=mykey]] (watermark shows up as no keys are provided).  +  * <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​tileX:</​span> ​The X index (column index in the tiling matrix) of the requesting tile. Valid range is between ​and 4<​sup><​em>​z</​em></​sup> ​for each given zoom level <em>z</em>.</​span></​html>​ 
- +  * <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​tileY:</​span> ​The Y index (row index in the tiling matrix) of the requesting tile. Valid range is between ​and 4<​sup><​em>​z</​em></​sup> ​for each given zoom level <em>z</em>.</​span></​html>​ 
-  *  Hit //**Try it Out**// button below [[https://cloud.thinkgeo.com/help/#/​MapsRasterTiles/​GetMapsRasterTileByXyzV1|GetMapsRasterTileByXyz]] to test it online.  +  * <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​fileExtension:</span> ​The image format of the raster ​tile.  Different formats are available depending on the tile style you have requestedas follows:</​span></​html>​ 
 +     * <​html><​span class="api-parameter"><​span class="​api-parameter-name">​png</​span>​ - supported ​for <em>light</em>, <em>dark</em>, and <em>transparent-background</em> style tiles.</​span></​html>​ 
 +     * <​html><​span class="api-parameter"><​span class="​api-parameter-name">​jpeg</​span>​ or <span class="api-parameter-name">jpg</​span>​ - supported ​for <em>aerial</em> and <em>hybrid</em> style tiles.</span><​/html> 
 +  * <​html><​span class="​api-parameter"><​span class="​api-parameter-name">​apikey:</span> The ThinkGeo Cloud API key that authenticates your request.</span><​/html>
  
 +Here is an example of a raster tile request URL: [[https://​cloud.thinkgeo.com/​api/​v1/​maps/​raster/​light/​x1/​3857/​512/​0/​0/​0.png]]. ​ When no API key is specified, the tile will be watermarked with a ThinkGeo logo.  To remove the watermark, a valid ThinkGeo Cloud API key is required. Please check out [[thinkgeo_cloud_client_keys_guideline|Client Keys Guideline]] to find out how to get your own API key.
  
 +Visit [[https://​cloud.thinkgeo.com/​help/#/​MapsRasterTiles/​GetMapsRasterTileByXyzV1|GetMapsRasterTileByXyz]] and click "Try It Out" to explore this API online. ​
 ===== Map Data Coverage===== ===== Map Data Coverage=====
-Map Suite Raster Tile Data has street tiles and aerial images tiles. ​+Map Suite Raster Tile Data is composed of street tiles and aerial images tiles. ​
  
-  * **Street Tiles**<​div>​The data of streets tiles (//light / dark / transparent-background//​ ) mainly come from [[https://​www.openstreetmap.org|Open Street Map]], and partially from [[https://​www.naturalearthdata.com/​|Natural Earth]], it covers ​the entire world. The tiles are scheduled to be updated ​every month.</​div>​+  * **Street Tiles**<​div>​The data of streets tiles (//light / dark / transparent-background//​ ) mainly come from [[https://​www.openstreetmap.org|Open Street Map]], and partially from [[https://​www.naturalearthdata.com/​|Natural Earth]]. The tiles cover the entire world. The tiles are scheduled to be updated ​on a monthly basis.</​div>​
   * **Aerial Image Tiles**   * **Aerial Image Tiles**
     * The data for zoom level 0 ~ 11 comes from [[https://​www.usgs.gov/​land-resources/​nli/​landsat|LandSat]],​ it covers the entire world. ​     * The data for zoom level 0 ~ 11 comes from [[https://​www.usgs.gov/​land-resources/​nli/​landsat|LandSat]],​ it covers the entire world. ​
Line 41: Line 48:
  
  
-The data is for sale as a separate product, it can be consumed offline by Map Suite SDKs. Check out [[thinkgeo_offline_data_maps_streets|Maps Streets Offline Data]] and [[thinkgeo_offline_data_maps_imagery|Maps Imagery Offline Data]] for detail. ​+Our World Map data can be purchased separately. It can be consumed offline by Map Suite SDKs. Check out [[thinkgeo_offline_data_maps_streets|Maps Streets Offline Data]] and [[thinkgeo_offline_data_maps_imagery|Maps Imagery Offline Data]] for detail. ​
  
 ===== Consume from Client Side ===== ===== Consume from Client Side =====
Line 76: Line 83:
 Sample Code:  Sample Code: 
 <code csharp> <code csharp>
 +using ThinkGeo.Cloud;​
 +
 // Setup the overlay // Setup the overlay
-ThinkGeoCloudMapsOverlay thinkGeoMapsOverlay= new ThinkGeoCloudMapsOverlay("​clientId", "clientSecret"); +ThinkGeoCloudMapsOverlay thinkGeoMapsOverlay = new ThinkGeoCloudMapsOverlay("​Your Client ID", "Your Client Secret"); 
-// or ThinkGeoCloudMapsOverlay thinkGeoMapsOverlay= new ThinkGeoCloudMapsOverlay("​apiKey"​);​+// or ThinkGeoCloudMapsOverlay thinkGeoMapsOverlay= new ThinkGeoCloudMapsOverlay("​Your apiKey"​);​
 Map.Overlays.Add(thinkGeoMapsOverlay);​ Map.Overlays.Add(thinkGeoMapsOverlay);​
 </​code>​ </​code>​
Line 91: Line 100:
  
  
-==== From Client Side SDKs ====+==== Consume ​From Client Side SDKs ====
  
-.Net SDK //ThinkGeo Cloud Client// ​is provided ​to consume the ThinkGeo Cloud Service as well. It's available on [[https://​www.nuget.org/​packages/​ThinkGeo.GisServer.Client|NuGet]], ​here is the complete ​[[thinkgeo_cloud_.net_client_apis|API ​List]]. +Our .NET SDK //ThinkGeo Cloud Client// ​makes it easy to consume ​all of the ThinkGeo Cloud services in your applications. It's available on [[https://​www.nuget.org/​packages/​ThinkGeo.Cloud.Client|NuGet]].  IntelliSense hints will help you get startedand you can also refer to the [[thinkgeo_cloud_.net_client_apis|ThinkGeo Cloud Client ​API list]] for details. 
 + 
 +At the NuGet Package Manager terminal, you can install this package by running the command: ''​Install-Package ThinkGeo.Cloud.Client -Version VERSION_TO_BE_INSTALLED''​. ​ You can also check out ThinkGeo on GitHub for [[https://​github.com/​ThinkGeo?​utf8=%E2%9C%93&​q=cloud&​type=&​language=|samples utilizing the ThinkGeo Cloud Client]].
  
 Sample Code:  Sample Code: 
 <code csharp> <code csharp>
-MapsClient client = new MapsClient("​clientId", "clientSecret");+using ThinkGeo.Cloud;​ 
 + 
 +MapsClient client = new MapsClient("​Your Client ID", "Your Client Secret");
 Stream imageStream = client.GetRasterTile(z,​ x, y, projection, mapType, tileSize, tileResolution);​ Stream imageStream = client.GetRasterTile(z,​ x, y, projection, mapType, tileSize, tileResolution);​
-Task<​Stream>​ task = client.GetRasterTileAsync(z,​ x, y, projection, mapType, tileSize, tileResolution);​ 
 </​code>​ </​code>​
  
Line 109: Line 121:
   * [[https://​samples.thinkgeo.com/​thinkgeo-cloud/​maps/​xyz/​|ThinkGeo Cloud Raster Map Online Sample]] ​   * [[https://​samples.thinkgeo.com/​thinkgeo-cloud/​maps/​xyz/​|ThinkGeo Cloud Raster Map Online Sample]] ​
  
-Desktop ​Samples+Desktop ​Sample
   * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForWinForms|ThinkGeoCloudMapsSample-WinForms]] for [[map_suite_desktop_for_winforms|Map Suite Desktop For WinForms]]   * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForWinForms|ThinkGeoCloudMapsSample-WinForms]] for [[map_suite_desktop_for_winforms|Map Suite Desktop For WinForms]]
   * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForWpf|ThinkGeoCloudMapsSample-WPF]] for [[map_suite_desktop_for_wpf|Map Suite Desktop For WPF]]   * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForWpf|ThinkGeoCloudMapsSample-WPF]] for [[map_suite_desktop_for_wpf|Map Suite Desktop For WPF]]
  
-Web Samples:  +Web Sample
-  * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForiOS|ThinkGeoCloudMapsSample-iOS]] for [[map_suite_mobile_for_ios|Map Suite Mobile For iOS]] +
-  * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForAndroid|ThinkGeoCloudMapsSample-Android]] for [[map_suite_mobile_for_android|Map Suite Mobile for Android]] +
- +
-Mobile Samples+
   * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForWebForms|ThinkGeoCloudMapsSample-WebForms]] for [[map_suite_web_for_webforms|Map Suite Web For WebForms]]   * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForWebForms|ThinkGeoCloudMapsSample-WebForms]] for [[map_suite_web_for_webforms|Map Suite Web For WebForms]]
   * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForMvc|ThinkGeoCloudMapsSample-MVC]] for [[map_suite_web_for_mvc|Map Suite Web For MVC]]   * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForMvc|ThinkGeoCloudMapsSample-MVC]] for [[map_suite_web_for_mvc|Map Suite Web For MVC]]
 +
 +
 +Mobile Sample: ​
 +  * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForiOS|ThinkGeoCloudMapsSample-iOS]] for [[map_suite_mobile_for_ios|Map Suite Mobile For iOS]]
 +  * [[https://​github.com/​ThinkGeo/​ThinkGeoCloudMapsSample-ForAndroid|ThinkGeoCloudMapsSample-Android]] for [[map_suite_mobile_for_android|Map Suite Mobile for Android]]
  
 ===== Related Links ===== ===== Related Links =====
thinkgeo_cloud_maps_raster_tiles.txt · Last modified: 2019/03/31 16:38 by brianr