Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
James McClain committed Nov 6, 2015
2 parents 480ce4a + ba97f1c commit 6147506
Show file tree
Hide file tree
Showing 43 changed files with 1,032 additions and 379 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.class
*.log
# sublime
*.sublime-*

# sbt specific
.cache
Expand All @@ -15,3 +17,4 @@ project/plugins/project/
# Scala-IDE specific
.scala_dependencies
.worksheet
.idea
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
sudo: required

services:
- docker

cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/boot/

script:
- mkdir -p ${HOME}/.sbt
- docker run -v ${HOME}/.ivy2:/root/.ivy2 -v ${HOME}/.sbt:/root/.sbt -v ${PWD}:/modellab-geoprocessing -w /modellab-geoprocessing quay.io/azavea/spark:latest ./sbt test

before_deploy:
- docker run -v ${HOME}/.ivy2:/root/.ivy2 -v ${HOME}/.sbt:/root/.sbt -v ${PWD}:/modellab-geoprocessing -w /modellab-geoprocessing quay.io/azavea/spark:latest ./sbt assembly
- sudo chown ${USER} target/scala-2.10/modellab-geoprocessing-assembly-${TRAVIS_TAG}.jar

deploy:
provider: releases
api_key:
secure: NllnEN36jPxZLvTmLb/JN9Eh5wOlMV5Q/FwSQe/OqCHF2WWasdlAW+CHT2m0gb0cLb9NqwwoFRDJcqYn+XFCuK5Gboc9s6/rQe9oj3EeiyO75lF2XzVLF+MQxvbnb6X9XCFAs7ezcEVBbpM5Yaaclx9bT7WodrFD/s5+09RS5NMZBKZe2UyZmfz1oKIFWLCEvpau+VXnLFZX5z2R41ZBtLBORAuQrjGRs6ed/QXtLtBwQjRcsnlchhk7LAC1LfPIoTWzC8vkiQyLXMjVFTcTeKcHdec6txiSesciCAvEwE/grAfOKp1YCXdjXzYthnwL2V+vc1X9IcNTOyQEBuQArquw1pmA9PjKZm4GU93Om9DflZgy/oHqxiCKrauvyc1c8R5e4kGsIbl+lkgcFu/P4QutEXC8U50z+qS5HGr9hKJDV9te+z4mzbvbvVahWlwBXUOk48maPWTRS7FaRBTvOqaizgow9tuy9on3bTc5GTwyQhAxu6v6NvcMvE2e/JvZWKTVR7H+pR9nKwF+LbnsYu+ZPwX8qtkhl/HX9xDd0RuSDXx8izywV25BpuwapNKHOCLWW4suZKFvoKz6xZ5r5fcIOJVVTHwXuMTezQH9dCkdqA0olrRWn07VSdWeJJM3N+DTVS0nsW03o8KvImiNtHtXdS3hf85xInlBgVWq4AA=
file:
- target/scala-2.10/modellab-geoprocessing-assembly-${TRAVIS_TAG}.jar
skip_cleanup: true
on:
repo: azavea/modellab-geoprocessing
tags: true

notifications:
slack:
secure: Vx7Qu4o6H/ruf0eO+f3fGkOj4VzBBz0g1V26W1+UJcP67SsM8a8HESsfbFR2Jl0fcRaQIITfs5NkZ3dPLM72DcSfMlXyEL1mmWPqdKkvo7Lgbm1GIZG3NE5jg2tUlcBbavgORL8ZGA5EfEtwmD5frFZBMUgBu+VCKKBk6Xn12pi8tLb86cG2X9l9FwZkQkgGdk17FriW60IPSnrmt7X6xHRq1SLCrQxuzQSr6mGsjYOytO5DdOTRR14mZLis7O/gFu3SeldOH1JwsuFIxABqEiB0dXNwKwy2tI04y8eP0TqxpZIhe04I6IlFqXtaurMOrTN8md1zpGms5Oe1p/MELYI+JMNSpV77MHUW/maF0lVZyNcUdi+rwHmTQeIwEMo4akpOb0E2Dl2cD4B5XjKwl4K9c3o40ymGJGqUL0sOPKBR77w153aJaYdWe3ux526KPJFtPEY+8ImN6PfQHyuhBArJ53l7GIByr8e/e5+g+ppBdaaoiC+1+sqpF2T3Npa59utS5XJjeBBXVUP3S0P46WeJXR4bRUq8emengJQoi/997fzTOhQN7VJfFR/dLXxe5NNTDlSTM++fW1VEg1kolg3D1By9xLxxGL5SpHWlyOn2Q+FdhfGOxgQ+tDDzZDbQwhR2d+wnNLNctGlFNYjcORAwoDi/eMLZDFb2Zlc7J/M=
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 0.1.0

- Initial release.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Endpoints

### Register Layer
POST: `/register`
POST: `/layers`
BODY: `Content-Type: application/json`
```json
{ "function_name": "ValueMask",
Expand All @@ -27,6 +27,8 @@ BODY: `Content-Type: application/json`
}
```

GET: `/layers/<layerHash>`

### Register Color Breaks
POST: `/breaks/{color-breaks-name}`
BODY: `Content-Type: application/text`
Expand All @@ -36,6 +38,9 @@ BODY: `Content-Type: application/text`
These are NLCD breaks

### Layer TMS
GET: `/<layer-guid>/{z}/{x}/{y}.png?breaks=<color-breaks-name>`
GET: `/tms/<layer-guid>/{z}/{x}/{y}.png?breaks=<color-breaks-name>`

### Layer Value TMS
GET: `/tms/value/<layer-guid>/{z}/{x}/{y}.json`

[Testing Leaflet Map](sample/leaflet.html)
57 changes: 45 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
name := "modellab"
organization := "com.azavea.modellab"
name := "modellab-geoprocessing"
version := "0.1.0"

Common.settings

libraryDependencies ++= Seq(
Library.scalaTest,
Library.logbackClassic,
Library.sparkCore,
Library.sprayHttpx, Library.sprayCan, Library.sprayRouting, Library.akka,
Library.shapeless,
Library.scalaz,
"io.spray" %% "spray-json" % "1.3.1",
"com.azavea.geotrellis" %% "geotrellis-spark" % Version.geotrellis)

initialCommands in console :=
"""
import geotrellis.raster._
Expand All @@ -20,7 +12,48 @@ initialCommands in console :=
import geotrellis.spark._
import geotrellis.spark.utils._
import geotrellis.spark.tiling._
import com.azavea.modellab._
import com.azavea.modellab.op._
import shapeless._
import syntax.singleton._ ; import record._
import spray.json._
import scalaz._
"""
import geotrellis.spark.utils.SparkUtils
import com.azavea.modellab._
val catalog = new DataHubCatalog {
implicit val sc = geotrellis.spark.utils.SparkUtils.createLocalSparkContext("local[*]", "Model Service")
}
val registry = new LayerRegistry(catalog.layerReader)
val formats = new NodeFormats(new WindowedReader(catalog.layerReader, 8), registry.getLayer)
import formats._
"""

libraryDependencies ++= Seq(
Library.scalaTest,
Library.logbackClassic,
Library.sparkCore,
Library.sprayHttpx, Library.sprayCan, Library.sprayRouting, Library.akka,
Library.shapeless,
Library.scalaz,
Library.metrics, Library.metricsLibrato,
Library.config,
"io.spray" %% "spray-json" % "1.3.1",
"com.azavea.geotrellis" %% "geotrellis-spark" % Version.geotrellis)

resolvers += Resolver.bintrayRepo("azavea", "geotrellis")
resolvers += Resolver.bintrayRepo("azavea", "geotrellis")
resolvers += Resolver.bintrayRepo("scalaz", "releases")
resolvers += "OpenGeo" at "https://boundless.artifactoryonline.com/boundless/main"

test in assembly := {}

assemblyMergeStrategy in assembly := {
case "reference.conf" => MergeStrategy.concat
case "application.conf" => MergeStrategy.concat
case "META-INF/MANIFEST.MF" => MergeStrategy.discard
case "META-INF\\MANIFEST.MF" => MergeStrategy.discard
case "META-INF/ECLIPSEF.RSA" => MergeStrategy.discard
case "META-INF/ECLIPSEF.SF" => MergeStrategy.discard
case _ => MergeStrategy.first
}
2 changes: 0 additions & 2 deletions project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import sbt.Keys._
object Common {
val settings =
List(
organization := "com.azavea",
version := "1.0.0",
scalaVersion := Version.scala,
crossScalaVersions := List(scalaVersion.value),
scalacOptions ++= List(
Expand Down
5 changes: 4 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sbt._

object Version {
val geotrellis = "0.10.0-97834e6"
val geotrellis = "0.10.0-83483fc"
val logback = "1.1.2"
val scala = "2.10.6"
val scalaTest = "2.2.0"
Expand All @@ -23,4 +23,7 @@ object Library {
val logbackClassic = "ch.qos.logback" % "logback-classic" % Version.logback
val sparkCore = "org.apache.spark" %% "spark-core" % Version.spark
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
val metrics = "nl.grons" %% "metrics-scala" % "3.5.2_a2.3"
val metricsLibrato = "com.librato.metrics" % "metrics-librato" % "4.0.1.12"
val config = "com.typesafe" % "config" % "1.2.1"
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.5
sbt.version=0.13.8
6 changes: 6 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resolvers ++= Seq(
Classpaths.sbtPluginReleases,
Opts.resolver.sonatypeReleases
)

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0")
13 changes: 13 additions & 0 deletions sample/Elevation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
POST /layers HTTP/1.1
Content-Type: application/json
Host: localhost:8888
Connection: close
User-Agent: Paw/2.2.5 (Macintosh; OS X/10.10.5) GCDHTTPRequest
Content-Length: 129

{
"function_name": "LoadLayer",
"parameters": {
"layer_name": "us-pennsylvania-philadelphia-elevation-30m-epsg3857"
}
}
22 changes: 22 additions & 0 deletions sample/FocalSum.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
POST /layers HTTP/1.1
Content-Type: application/json
Host: localhost:8888
Connection: close
User-Agent: Paw/2.2.5 (Macintosh; OS X/10.10.5) GCDHTTPRequest
Content-Length: 264

{
"function_name": "FocalMin",
"inputs": [
{
"function_name": "LoadLayer",
"parameters":
{
"layer_name": "nlcd-zoomed"
}
}
],
"parameters": {
"neighborhood": { "shape": "square", "size": 1 }
}
}
6 changes: 6 additions & 0 deletions sample/Layer definition.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
GET /layers/yy3O2Q HTTP/1.1
Content-Type: application/json
Host: localhost:8888
Connection: close
User-Agent: Paw/2.2.5 (Macintosh; OS X/10.10.5) GCDHTTPRequest

6 changes: 6 additions & 0 deletions sample/List Layers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
GET /layers HTTP/1.1
Content-Type: application/json
Host: localhost:8888
Connection: close
User-Agent: Paw/2.2.5 (Macintosh; OS X/10.10.5) GCDHTTPRequest

22 changes: 22 additions & 0 deletions sample/Reclassify Cities.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
POST /layers HTTP/1.1
Content-Type: application/json
Host: localhost:8888
Connection: close
User-Agent: Paw/2.2.5 (Macintosh; OS X/10.10.5) GCDHTTPRequest
Content-Length: 257

{
"function_name": "MapValues",
"inputs": [
{
"function_name": "LoadLayer",
"parameters":
{
"layer_name": "nlcd-zoomed"
}
}
],
"parameters": {
"mappings": [ [[21, 22, 23, 24], null] ]
}
}
8 changes: 8 additions & 0 deletions sample/Register NLCD Breaks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
POST /breaks/nlcd HTTP/1.1
Content-Type: application/text
Host: localhost:8888
Connection: close
User-Agent: Paw/2.2.5 (Macintosh; OS X/10.10.5) GCDHTTPRequest
Content-Length: 3217

0:000000ff;1:00f900ff;2:000000ff;3:000000ff;4:000000ff;5:000000ff;6:000000ff;7:000000ff;8:000000ff;9:000000ff;10:000000ff;11:476ba0ff;12:d1ddf9ff;13:000000ff;14:000000ff;15:000000ff;16:000000ff;17:000000ff;18:000000ff;19:000000ff;20:000000ff;21:ddc9c9ff;22:d89382ff;23:ed0000ff;24:aa0000ff;25:000000ff;26:000000ff;27:000000ff;28:000000ff;29:000000ff;30:000000ff;31:b2ada3ff;32:f9f9f9ff;33:000000ff;34:000000ff;35:000000ff;36:000000ff;37:000000ff;38:000000ff;39:000000ff;40:000000ff;41:68aa63ff;42:1c6330ff;43:b5c98eff;44:000000ff;45:000000ff;46:000000ff;47:000000ff;48:000000ff;49:000000ff;50:000000ff;51:a58c30ff;52:ccba7cff;53:000000ff;54:000000ff;55:000000ff;56:000000ff;57:000000ff;58:000000ff;59:000000ff;60:000000ff;61:000000ff;62:000000ff;63:000000ff;64:000000ff;65:000000ff;66:000000ff;67:000000ff;68:000000ff;69:000000ff;70:000000ff;71:e2e2c1ff;72:c9c977ff;73:99c147ff;74:77ad93ff;75:000000ff;76:000000ff;77:000000ff;78:000000ff;79:000000ff;80:000000ff;81:dbd83cff;82:aa7028ff;83:000000ff;84:000000ff;85:000000ff;86:000000ff;87:000000ff;88:000000ff;89:000000ff;90:bad8eaff;91:b5d3e5ff;92:b5d3e5ff;93:b5d3e5ff;94:b5d3e5ff;95:70a3baff;96:000000ff;97:000000ff;98:000000ff;99:000000ff;100:000000ff;101:000000ff;102:000000ff;103:000000ff;104:000000ff;105:000000ff;106:000000ff;107:000000ff;108:000000ff;109:000000ff;110:000000ff;111:000000ff;112:000000ff;113:000000ff;114:000000ff;115:000000ff;116:000000ff;117:000000ff;118:000000ff;119:000000ff;120:000000ff;121:000000ff;122:000000ff;123:000000ff;124:000000ff;125:000000ff;126:000000ff;127:000000ff;128:000000ff;129:000000ff;130:000000ff;131:000000ff;132:000000ff;133:000000ff;134:000000ff;135:000000ff;136:000000ff;137:000000ff;138:000000ff;139:000000ff;140:000000ff;141:000000ff;142:000000ff;143:000000ff;144:000000ff;145:000000ff;146:000000ff;147:000000ff;148:000000ff;149:000000ff;150:000000ff;151:000000ff;152:000000ff;153:000000ff;154:000000ff;155:000000ff;156:000000ff;157:000000ff;158:000000ff;159:000000ff;160:000000ff;161:000000ff;162:000000ff;163:000000ff;164:000000ff;165:000000ff;166:000000ff;167:000000ff;168:000000ff;169:000000ff;170:000000ff;171:000000ff;172:000000ff;173:000000ff;174:000000ff;175:000000ff;176:000000ff;177:000000ff;178:000000ff;179:000000ff;180:000000ff;181:000000ff;182:000000ff;183:000000ff;184:000000ff;185:000000ff;186:000000ff;187:000000ff;188:000000ff;189:000000ff;190:000000ff;191:000000ff;192:000000ff;193:000000ff;194:000000ff;195:000000ff;196:000000ff;197:000000ff;198:000000ff;199:000000ff;200:000000ff;201:000000ff;202:000000ff;203:000000ff;204:000000ff;205:000000ff;206:000000ff;207:000000ff;208:000000ff;209:000000ff;210:000000ff;211:000000ff;212:000000ff;213:000000ff;214:000000ff;215:000000ff;216:000000ff;217:000000ff;218:000000ff;219:000000ff;220:000000ff;221:000000ff;222:000000ff;223:000000ff;224:000000ff;225:000000ff;226:000000ff;227:000000ff;228:000000ff;229:000000ff;230:000000ff;231:000000ff;232:000000ff;233:000000ff;234:000000ff;235:000000ff;236:000000ff;237:000000ff;238:000000ff;239:000000ff;240:000000ff;241:000000ff;242:000000ff;243:000000ff;244:000000ff;245:000000ff;246:000000ff;247:000000ff;248:000000ff;249:000000ff;250:000000ff;251:000000ff;252:000000ff;253:000000ff;254:000000ff;255:000000ff
8 changes: 8 additions & 0 deletions sample/Roughness Breaks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
POST /breaks/tr HTTP/1.1
Content-Type: application/text
Host: localhost:8888
Connection: close
User-Agent: Paw/2.2.5 (Macintosh; OS X/10.10.5) GCDHTTPRequest
Content-Length: 100

0:2586AB;1:4EA3C8;2:7FB8D4;3:ADD8EA;4:C8E1E7;5:EDECEA;6:F0E7BB;7:F5CF7D;8:F9B737; 9:E68F2D;10:D76B27
21 changes: 21 additions & 0 deletions sample/Roughness.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
POST /layers HTTP/1.1
Content-Type: application/json
Host: localhost:8888
Connection: close
User-Agent: Paw/2.2.5 (Macintosh; OS X/10.10.5) GCDHTTPRequest
Content-Length: 353

{ "function_name": "LocalSubtract",
"inputs": [
{
"function_name": "FocalMax",
"parameters": { "neighborhood": { "shape": "square", "size": 1 } },
"inputs": ["NW1s9w"]
},
{
"function_name": "FocalMin",
"parameters": { "neighborhood": { "shape": "square", "size": 1 } },
"inputs": ["NW1s9w"]
}
]
}
32 changes: 22 additions & 10 deletions sample/leaflet.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,38 @@
L.marker([39.73, -104.8]).bindPopup('This is Aurora, CO.').addTo(cities),
L.marker([39.77, -105.23]).bindPopup('This is Golden, CO.').addTo(cities);

var nlcdUrl = 'http://localhost:8888/7c6173e2-cdfb-4401-b3e9-f9b3d4da3c0e/{z}/{x}/{y}.png?breaks=nlcd';
var nlcdCitiesMaskUrl = 'http://localhost:8888/80ef666c-cities/{z}/{x}/{y}.png?breaks=nlcd';
var nlcdForestMaskUrl = 'http://localhost:8888/80ef666c-forest/{z}/{x}/{y}.png?breaks=nlcd';
var nlcdUrl = 'http://localhost:8888/tms/FqTuoA/{z}/{x}/{y}.png?breaks=nlcd';
var elevationUrl = 'http://localhost:8888/tms/NW1s9w/{z}/{x}/{y}.png';
var nlcdFocalUrl = 'http://localhost:8888/tms/yy3O2Q/{z}/{x}/{y}.png?breaks=nlcd';
var nlcdForestMaskUrl = 'http://localhost:8888/tms/GKQ8Mw/{z}/{x}/{y}.png?breaks=nlcd';
var roughnessUrl = 'http://localhost:8888/tms/gXbYxA/{z}/{x}/{y}.png?breaks=tr';
var baseMbUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IjZjNmRjNzk3ZmE2MTcwOTEwMGY0MzU3YjUzOWFmNWZhIn0.Y8bhBaUMqFiPrDRW9hieoQ';

var base = L.tileLayer(baseMbUrl, {id: 'mapbox.streets'});
var nlcd = L.tileLayer(nlcdUrl, {maxNativeZoom: 13});
var nlcd_city = L.tileLayer(nlcdCitiesMaskUrl, {maxNativeZoom: 13});
var nlcd_forest = L.tileLayer(nlcdForestMaskUrl, {maxNativeZoom: 13});
var base = new L.TileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_nolabels/{z}/{x}/{y}.png', {
attribution: 'Raster Foundry | Map data &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
maxZoom: 18
});
var layerOpacity = 0.5;
var nlcd = L.tileLayer(nlcdUrl, {maxNativeZoom: 13, opacity: layerOpacity});
var elevation = L.tileLayer(elevationUrl, {maxNativeZoom: 13});
var nlcd_focal = L.tileLayer(nlcdFocalUrl, {maxNativeZoom: 13, opacity: layerOpacity});
var nlcd_forest = L.tileLayer(nlcdForestMaskUrl, {maxNativeZoom: 13, opacity: layerOpacity});
var roughness = L.tileLayer(roughnessUrl, {maxNativeZoom: 13});

var map = L.map('map', {
center: [39.9500, -75.1667],
zoom: 12,
layers: [nlcd]
});

map.addLayer(base)

var baseLayers = {
"nlcd": nlcd,
"nlcd_city": nlcd_city,
"nlcd_forest": nlcd_forest
"elevation": elevation,
"nlcd_focal": nlcd_focal,
"nlcd_forest": nlcd_forest,
"Roughness": roughness
};

var overlays = {
Expand All @@ -58,4 +70,4 @@
L.control.layers(baseLayers, overlays).addTo(map);
</script>
</body>
</html>
</html>
20 changes: 0 additions & 20 deletions sample/sample_mask_cities.json

This file was deleted.

Loading

0 comments on commit 6147506

Please sign in to comment.