{"_id":"561d58cc8ca8b90d0021021a","parentDoc":null,"project":"55faeacad0e22017005b8265","user":"55fae9d4825d5f19001fa379","category":{"_id":"561d588d8ca8b90d00210219","project":"55faeacad0e22017005b8265","version":"55faeacad0e22017005b8268","__v":7,"pages":["561d58cc8ca8b90d0021021a","561d58ea071cd60d000d3202","561d58f88ca8b90d0021021c","564e30acc475e017007ffb43","564e3524e964972100508e6a","564e37deae07512b00a87ddc","564e3a08c475e017007ffb58"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-13T19:16:29.547Z","from_sync":false,"order":10,"slug":"thumbnail-service-guide","title":"Thumbnail Service Guide"},"__v":25,"version":{"_id":"55faeacad0e22017005b8268","project":"55faeacad0e22017005b8265","__v":33,"createdAt":"2015-09-17T16:31:06.800Z","releaseDate":"2015-09-17T16:31:06.800Z","categories":["55faeacbd0e22017005b8269","55faf550764f50210095078e","55faf5b5626c341700fd9e96","55faf8a7825d5f19001fa386","560052f91503430d007cc88f","560054f73aa0520d00da0b1a","56005aaf6932a00d00ba7c62","56005c273aa0520d00da0b3f","5601ae7681a9670d006d164d","5601ae926811d00d00ceb487","5601aeb064866b1900f4768d","5601aee850ee460d0002224c","5601afa02499c119000faf19","5601afd381a9670d006d1652","561d4c78281aec0d00eb27b6","561d588d8ca8b90d00210219","563a5f934cc3621900ac278c","5665c5763889610d0008a29e","566710a36819320d000c2e93","56ddf6df8a5ae10e008e3926","56e1c96b2506700e00de6e83","56e1ccc4e416450e00b9e48c","56e1ccdfe63f910e00e59870","56e1cd10bc46be0e002af26a","56e1cd21e416450e00b9e48e","56e3139a51857d0e008e77be","573b4f62ef164e2900a2b881","57c9d1335fd8ca0e006308ed","57e2bd9d1e7b7220000d7fa5","57f2b992ac30911900c7c2b6","58adb5c275df0f1b001ed59b","58c81b5c6dc7140f003c3c46","595412446ed4d9001b3e7b37"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"v1","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-13T19:17:32.820Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"The Thumbnail Service lets you request a thumbnail image and the image's metadata. You can request the thumbnail by dimensions( browse mode) or by orientation (thumbnail mode). The service redirects API requests to the Amazon Web Services (S3) location for the image file or the metadata file. In Thumbnail mode, you can add an IMG tag to the thumbnail. \n\n\n## Resources\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"[Browse Mode](doc:browse-mode)\",\n    \"1-0\": \"[Metadata Mode](doc:metadata-mode)\",\n    \"2-0\": \"[JSON Mode](doc:json-mode)\",\n    \"3-0\": \"[Thumbnail Mode](doc:thumbnail-mode)\",\n    \"0-1\": \"Get a thumbnail by catalog ID and Dimensions.\",\n    \"1-1\": \"Get the metadata file for an image by catalog ID.\",\n    \"2-1\": \"Get the location of a thumbnail image and its metadata file by catalog ID.\",\n    \"3-1\": \"Get a thumbnail by dimensions and orientation. Set an img flag for the thumbnail.\",\n    \"h-0\": \"Resource Name\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Click a Resource Name above to see its API reference material.\"\n}\n[/block]\n## Browse Mode\nIn browse mode, catalog ID and a string value for dimensions are required. Orientation is fixed and cannot be defined in browse mode.The fixed orientation is \"standard.\"\n\n\n\nValid dimensions are:\n* small\n* medium\n* large\n* natres\n\n## Thumbnail Mode\nIn thumbnail mode, catalog ID and numerical value for dimensions are required.\n\nValid dimensions are:\n*256 (small)\n*512 (medium)\n*1024 (large)\n\nOrientation can be set in thumbnail mode. \n\nValid orientation values are:\n\nNOTE: All modes maintain aspect ratio\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"standard\",\n    \"0-1\": \"'fit' the image so that the longest extent will not exceed the requested dimension\",\n    \"1-0\": \"maxwidth\",\n    \"1-1\": \"'fit' the image so that the width will not exceed the requested dimension\",\n    \"2-0\": \"maxheight\",\n    \"2-1\": \"'fit' the image so that the height will not exceed the requested dimension\",\n    \"3-0\": \"natres\",\n    \"3-1\": \"Do not 'fit' the image. Use its original extents.\",\n    \"h-0\": \"Orientation\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n#####  IMG Flag:\nIMG=TRUE can be set in thumbnail mode. This will return an img tag to make the image easily viewable in a web page for testing. By default a 301 redirect to a cached image on s3 will be returned.\n\n## Examples:\n\n### Thumbnail mode with max width orientation example\n\n\n\nhttps://geobigdata.io/thumbnails/v1/thumbnail/1030010027887C00/256?orientation=maxwidth\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/nFuq0hKBSYeVU1W84cEJ_256w.png\",\n        \"256w.png\",\n        \"256\",\n        \"1355\",\n        \"#626563\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n### Browse Mode Small Example\n\nSend a Get request to this URL to be redirected to the image below:\n\nhttps://geobigdata.io/thumbnails/v1/browse/1030010027887C00.small.png\n\nFor more information, see [Browse Mode](doc:browse-mode) ]\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/nmbs5j2xRPulTtYJHjzO_256s.png\",\n        \"256s.png\",\n        \"48\",\n        \"256\",\n        \"#636662\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n### Metadata mode\n\nSend a GET request to this URL to be redirected to the S3 location with the JSON metadata file. \n\nhttps://geobigdata.io/thumbnails/v1/metadata/1030010027887C00.json\n\nFor more information, see [Metadata Mode](doc:metadata-mode) ]\n\nThis is an example of a JSON metadata file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"geometry\\\": {\\n\\t\\\"type\\\": \\\"Polygon\\\", \\n  \\\"coordinates\\\": [\\n  \\t[\\n  \\t\\t[-105.279894, 40.267782], \\n    \\t[-105.284826, 39.218454], \\t\\t\\t\\t\\t\\n    \\t[-105.088554, 39.215322], \\n    \\t[-105.086538, 40.264614], \\n    \\t[-105.279894, 40.267782]\\n  \\t]\\n\\t]\\n}, \\n\\\"crs\\\": {\\n\\t\\\"type\\\": \\\"name\\\", \\n  \\\"properties\\\": \\n  \\t{\\\"name\\\": \\\"urn:ogc:def:crs:OGC:1.3:CRS84\\\"\\n   }\\n }, \\\"type\\\": \\\"Feature\\\", \\n \\\"properties\\\": {\\n \\t\\t\\\"id\\\": \\\"1030010027887C00\\\", \\n    \\\"name\\\": \\\"footprint\\\"\\n    }\\n}\\n\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n### JSON Mode\n\nYou can get the S3 locations for both the image and the JSON file with metadata in one request. For more information, see [JSON Mode](doc:json-mode) ] .\n\nWhen you send a GET request to https://geobigdata.io/thumbnails/v1/get/1050410002946400.small.png, it will return the S3 URLS for both the .png file and the .json file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"image\\\": \\\"http://alpha-thumbnail-cache.s3.amazonaws.com/1050410002946400/256s.png\\\",\\n  \\\"metadata\\\": \\\"http://alpha-thumbnail-cache.s3.amazonaws.com/1050410002946400/metadata.json\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nFor JSON mode, a catalog ID and a string value for dimensions is required. Valid dimensions are:\n\nValid dimensions are:\n* small\n* medium\n* large\n* natres","excerpt":"Overview of the GBDX Thumbnail service","slug":"thumbnail-service-course","type":"basic","title":"Thumbnail Service Course"}

Thumbnail Service Course

Overview of the GBDX Thumbnail service

The Thumbnail Service lets you request a thumbnail image and the image's metadata. You can request the thumbnail by dimensions( browse mode) or by orientation (thumbnail mode). The service redirects API requests to the Amazon Web Services (S3) location for the image file or the metadata file. In Thumbnail mode, you can add an IMG tag to the thumbnail. ## Resources [block:parameters] { "data": { "0-0": "[Browse Mode](doc:browse-mode)", "1-0": "[Metadata Mode](doc:metadata-mode)", "2-0": "[JSON Mode](doc:json-mode)", "3-0": "[Thumbnail Mode](doc:thumbnail-mode)", "0-1": "Get a thumbnail by catalog ID and Dimensions.", "1-1": "Get the metadata file for an image by catalog ID.", "2-1": "Get the location of a thumbnail image and its metadata file by catalog ID.", "3-1": "Get a thumbnail by dimensions and orientation. Set an img flag for the thumbnail.", "h-0": "Resource Name", "h-1": "Description" }, "cols": 2, "rows": 4 } [/block] [block:callout] { "type": "info", "title": "Click a Resource Name above to see its API reference material." } [/block] ## Browse Mode In browse mode, catalog ID and a string value for dimensions are required. Orientation is fixed and cannot be defined in browse mode.The fixed orientation is "standard." Valid dimensions are: * small * medium * large * natres ## Thumbnail Mode In thumbnail mode, catalog ID and numerical value for dimensions are required. Valid dimensions are: *256 (small) *512 (medium) *1024 (large) Orientation can be set in thumbnail mode. Valid orientation values are: NOTE: All modes maintain aspect ratio [block:parameters] { "data": { "0-0": "standard", "0-1": "'fit' the image so that the longest extent will not exceed the requested dimension", "1-0": "maxwidth", "1-1": "'fit' the image so that the width will not exceed the requested dimension", "2-0": "maxheight", "2-1": "'fit' the image so that the height will not exceed the requested dimension", "3-0": "natres", "3-1": "Do not 'fit' the image. Use its original extents.", "h-0": "Orientation", "h-1": "Description" }, "cols": 2, "rows": 4 } [/block] ##### IMG Flag: IMG=TRUE can be set in thumbnail mode. This will return an img tag to make the image easily viewable in a web page for testing. By default a 301 redirect to a cached image on s3 will be returned. ## Examples: ### Thumbnail mode with max width orientation example https://geobigdata.io/thumbnails/v1/thumbnail/1030010027887C00/256?orientation=maxwidth [block:image] { "images": [ { "image": [ "https://files.readme.io/nFuq0hKBSYeVU1W84cEJ_256w.png", "256w.png", "256", "1355", "#626563", "" ] } ] } [/block] ### Browse Mode Small Example Send a Get request to this URL to be redirected to the image below: https://geobigdata.io/thumbnails/v1/browse/1030010027887C00.small.png For more information, see [Browse Mode](doc:browse-mode) ] [block:image] { "images": [ { "image": [ "https://files.readme.io/nmbs5j2xRPulTtYJHjzO_256s.png", "256s.png", "48", "256", "#636662", "" ] } ] } [/block] ### Metadata mode Send a GET request to this URL to be redirected to the S3 location with the JSON metadata file. https://geobigdata.io/thumbnails/v1/metadata/1030010027887C00.json For more information, see [Metadata Mode](doc:metadata-mode) ] This is an example of a JSON metadata file. [block:code] { "codes": [ { "code": "{\"geometry\": {\n\t\"type\": \"Polygon\", \n \"coordinates\": [\n \t[\n \t\t[-105.279894, 40.267782], \n \t[-105.284826, 39.218454], \t\t\t\t\t\n \t[-105.088554, 39.215322], \n \t[-105.086538, 40.264614], \n \t[-105.279894, 40.267782]\n \t]\n\t]\n}, \n\"crs\": {\n\t\"type\": \"name\", \n \"properties\": \n \t{\"name\": \"urn:ogc:def:crs:OGC:1.3:CRS84\"\n }\n }, \"type\": \"Feature\", \n \"properties\": {\n \t\t\"id\": \"1030010027887C00\", \n \"name\": \"footprint\"\n }\n}\n", "language": "text" } ] } [/block] ### JSON Mode You can get the S3 locations for both the image and the JSON file with metadata in one request. For more information, see [JSON Mode](doc:json-mode) ] . When you send a GET request to https://geobigdata.io/thumbnails/v1/get/1050410002946400.small.png, it will return the S3 URLS for both the .png file and the .json file. [block:code] { "codes": [ { "code": "{\n \"image\": \"http://alpha-thumbnail-cache.s3.amazonaws.com/1050410002946400/256s.png\",\n \"metadata\": \"http://alpha-thumbnail-cache.s3.amazonaws.com/1050410002946400/metadata.json\"\n}", "language": "json" } ] } [/block] For JSON mode, a catalog ID and a string value for dimensions is required. Valid dimensions are: Valid dimensions are: * small * medium * large * natres