{"action":"created","issue":{"url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing/issues/8","repository_url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing","labels_url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing/issues/8/comments","events_url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing/issues/8/events","html_url":"https://github.com/azavea/usace-program-analysis-geoprocessing/pull/8","id":175544488,"number":8,"title":"Add NLCD land use tile endpoint","user":{"login":"jtarricone","id":18290666,"avatar_url":"https://avatars.githubusercontent.com/u/18290666?v=3","gravatar_id":"","url":"https://api.github.com/users/jtarricone","html_url":"https://github.com/jtarricone","followers_url":"https://api.github.com/users/jtarricone/followers","following_url":"https://api.github.com/users/jtarricone/following{/other_user}","gists_url":"https://api.github.com/users/jtarricone/gists{/gist_id}","starred_url":"https://api.github.com/users/jtarricone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtarricone/subscriptions","organizations_url":"https://api.github.com/users/jtarricone/orgs","repos_url":"https://api.github.com/users/jtarricone/repos","events_url":"https://api.github.com/users/jtarricone/events{/privacy}","received_events_url":"https://api.github.com/users/jtarricone/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"rajadain","id":1430060,"avatar_url":"https://avatars.githubusercontent.com/u/1430060?v=3","gravatar_id":"","url":"https://api.github.com/users/rajadain","html_url":"https://github.com/rajadain","followers_url":"https://api.github.com/users/rajadain/followers","following_url":"https://api.github.com/users/rajadain/following{/other_user}","gists_url":"https://api.github.com/users/rajadain/gists{/gist_id}","starred_url":"https://api.github.com/users/rajadain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajadain/subscriptions","organizations_url":"https://api.github.com/users/rajadain/orgs","repos_url":"https://api.github.com/users/rajadain/repos","events_url":"https://api.github.com/users/rajadain/events{/privacy}","received_events_url":"https://api.github.com/users/rajadain/received_events","type":"User","site_admin":false},"assignees":[{"login":"rajadain","id":1430060,"avatar_url":"https://avatars.githubusercontent.com/u/1430060?v=3","gravatar_id":"","url":"https://api.github.com/users/rajadain","html_url":"https://github.com/rajadain","followers_url":"https://api.github.com/users/rajadain/followers","following_url":"https://api.github.com/users/rajadain/following{/other_user}","gists_url":"https://api.github.com/users/rajadain/gists{/gist_id}","starred_url":"https://api.github.com/users/rajadain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajadain/subscriptions","organizations_url":"https://api.github.com/users/rajadain/orgs","repos_url":"https://api.github.com/users/rajadain/repos","events_url":"https://api.github.com/users/rajadain/events{/privacy}","received_events_url":"https://api.github.com/users/rajadain/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-09-07T16:11:58Z","updated_at":"2016-09-07T21:39:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing/pulls/8","html_url":"https://github.com/azavea/usace-program-analysis-geoprocessing/pull/8","diff_url":"https://github.com/azavea/usace-program-analysis-geoprocessing/pull/8.diff","patch_url":"https://github.com/azavea/usace-program-analysis-geoprocessing/pull/8.patch"},"body":"Connects https://github.com/azavea/usace-program-analysis/issues/166\r\n\r\nThis adds an endpoint to the geoprocessing service at `/nlcd-agg-tiles` that takes requests in the typical `{zoom}/{x}/{y}` form and returns a PNG rendered from the NLCD land cover raster data.\r\n\r\nTo test -->\r\n* clone this branch\r\n* `cd` into the project directory\r\n* execute `.sbt \"project geop\" assembly` to compile the service\r\n* build the docker image with `docker build -t usace-geop-test .` \r\n* spin up a container with `docker run --rm -v ~/.aws:/root/.aws -p 4040:4040 -p 8090:8090 usace-geop-test --driver-memory 2g`\r\n* using cURL or Postman or the like, send a `GET` request to `http://localhost:8090/ping` to ensure the service is available\r\n* send a `GET` request to `http://localhost:8090/nlcd-agg-tiles/{zoom}/{x}/{y}` where zoom is a zoom level between 1-12, and x & y are row/column locations that are valid for that zoom level. \r\n\r\nThe result should be a PNG that looks like it could be rendered from land cover data. For example, `http://localhost:8090/nlcd-agg-tiles/12/1194/1549` should return an image like this:\r\n![1549](https://cloud.githubusercontent.com/assets/18290666/18319508/02fe579c-74f4-11e6-83e0-b3c6bad076b1.png)"},"comment":{"url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing/issues/comments/245428056","html_url":"https://github.com/azavea/usace-program-analysis-geoprocessing/pull/8#issuecomment-245428056","issue_url":"https://api.github.com/repos/azavea/usace-program-analysis-geoprocessing/issues/8","id":245428056,"user":{"login":"rajadain","id":1430060,"avatar_url":"https://avatars.githubusercontent.com/u/1430060?v=3","gravatar_id":"","url":"https://api.github.com/users/rajadain","html_url":"https://github.com/rajadain","followers_url":"https://api.github.com/users/rajadain/followers","following_url":"https://api.github.com/users/rajadain/following{/other_user}","gists_url":"https://api.github.com/users/rajadain/gists{/gist_id}","starred_url":"https://api.github.com/users/rajadain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajadain/subscriptions","organizations_url":"https://api.github.com/users/rajadain/orgs","repos_url":"https://api.github.com/users/rajadain/repos","events_url":"https://api.github.com/users/rajadain/events{/privacy}","received_events_url":"https://api.github.com/users/rajadain/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T21:39:40Z","updated_at":"2016-09-07T21:39:40Z","body":"Querying for a tile that is outside the zoom limits results in 500. I think it should return a 404 instead.\r\n\r\n```http\r\n> http :8090/nlcd-agg-tiles/13/2355/3026.png\r\nHTTP/1.1 500 Internal Server Error\r\nContent-Length: 35\r\nContent-Type: text/plain; charset=UTF-8\r\nDate: Wed, 07 Sep 2016 21:36:08 GMT\r\nServer: spray-can/1.3.3\r\n\r\nThere was an internal server error.\r\n```\r\n\r\nHere's what the service output looks like:\r\n\r\n```\r\n[ERROR] [09/07/2016 21:36:08.039] [ForkJoinPool-4-worker-3] [akka://usace-programanalysis-geop/user/usace-programanalysis] Error during processing of request HttpRequest(GET,http://localhost:8090/nlcd-agg-tiles/13/2355/3026.png,List(Host: localhost:8090, User-Agent: HTTPie/0.9.4, Connection: keep-alive, Accept-Encoding: gzip, deflate),Empty,HTTP/1.1)\r\ngeotrellis.spark.io.package$AttributeNotFoundError: Attribute metadata not found for layer Layer(name = \"nlcd-zoomed\", zoom = 13)\r\n\tat geotrellis.spark.io.s3.S3AttributeStore.read(S3AttributeStore.scala:55)\r\n\tat geotrellis.spark.io.AttributeCaching$$anonfun$cacheRead$1.apply(AttributeCaching.scala:11)\r\n\tat scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:189)\r\n\tat scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91)\r\n\tat geotrellis.spark.io.AttributeCaching$class.cacheRead(AttributeCaching.scala:11)\r\n\tat geotrellis.spark.io.s3.S3AttributeStore.cacheRead(S3AttributeStore.scala:20)\r\n\tat geotrellis.spark.io.BlobLayerAttributeStore$class.readHeader(AttributeStore.scala:60)\r\n\tat geotrellis.spark.io.s3.S3AttributeStore.readHeader(S3AttributeStore.scala:20)\r\n\tat geotrellis.spark.io.s3.S3ValueReader$$anon$1.<init>(S3ValueReader.scala:24)\r\n\tat geotrellis.spark.io.s3.S3ValueReader.reader(S3ValueReader.scala:23)\r\n\tat com.azavea.usace.programanalysis.geop.LayerReader$.catalog(LayerReader.scala:51)\r\n\tat com.azavea.usace.programanalysis.geop.LayerReader$.catalog(LayerReader.scala:41)\r\n\tat com.azavea.usace.programanalysis.geop.LayerReader$.apply(LayerReader.scala:30)\r\n\tat com.azavea.usace.programanalysis.geop.GeopServiceActor$$anonfun$tilesHandler$1$$anonfun$apply$5$$anonfun$apply$6.apply(GeopServiceActor.scala:91)\r\n\tat com.azavea.usace.programanalysis.geop.GeopServiceActor$$anonfun$tilesHandler$1$$anonfun$apply$5$$anonfun$apply$6.apply(GeopServiceActor.scala:90)\r\n\tat scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)\r\n\tat scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)\r\n\tat scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107)\r\n\tat scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)\r\n\tat scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)\r\n\tat scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)\r\n\tat scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)\r\nCaused by: com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: 70316D50CDBB614B), S3 Extended Request ID: c5t0sUD5cFQ43KoxogUsisvJRlp8eGwtGooYv20bmiAcRYl+E28jmzv0Qxd+UI4X81jKqygo7e8=\r\n\tat com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1127)\r\n\tat com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:743)\r\n\tat com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:462)\r\n\tat com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:297)\r\n\tat com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3672)\r\n\tat com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1160)\r\n\tat geotrellis.spark.io.s3.AmazonS3Client.getObject(S3Client.scala:149)\r\n\tat geotrellis.spark.io.s3.S3Client$class.getObject(S3Client.scala:48)\r\n\tat geotrellis.spark.io.s3.AmazonS3Client.getObject(S3Client.scala:121)\r\n\tat geotrellis.spark.io.s3.S3AttributeStore.geotrellis$spark$io$s3$S3AttributeStore$$readKey(S3AttributeStore.scala:39)\r\n\tat geotrellis.spark.io.s3.S3AttributeStore.read(S3AttributeStore.scala:52)\r\n\t... 21 more\r\n```\r\n\r\nThis is the interesting part:\r\n\r\n```\r\nCaused by: com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: 70316D50CDBB614B), S3 Extended Request ID: c5t0sUD5cFQ43KoxogUsisvJRlp8eGwtGooYv20bmiAcRYl+E28jmzv0Qxd+UI4X81jKqygo7e8=\r\n```\r\n\r\nSo S3 is returning a 404. We should pass that on, instead of returning a 500."}}
{"actor":{"display_login":"rajadain"}}