Skip to content

Instantly share code, notes, and snippets.

View moradology's full-sized avatar

Nathan Zimmerman moradology

  • Philadelphia, PA
View GitHub Profile
@moradology
moradology / printwriter
Last active December 3, 2015 18:23
Poor man's log
import java.io._
def printToFile(fileNameString: String)(toWrite: Any) {
val fos = new FileOutputStream(new File(fileNameString), true)
val p = new java.io.PrintWriter(fos)
try { p.append(s"\n$toWrite") } finally { p.close() }
}
printToFile("test.txt")("TEST")

#geotrellis.vector ##Features and Geometries

In addition to working with raster data, Geotrellis provides a number of facilities for the creation, representation, and modification of vector data. The data types central to this functionality (geotrellis.vector.Feature and geotrellis.vector.Geometry) correspond - and not by accident - to certain objects found in the GeoJson spec. Features correspond to the objects listed under features in a geojson FeatureCollection. Geometrys, to geometries in a geojson Feature.

#geotrellis.vector ##Features and Geometries

In addition to working with raster data, Geotrellis provides a number of facilities for the creation, representation, and modification of vector data. The data types central to this functionality (geotrellis.vector.Feature and geotrellis.vector.Geometry) correspond - and not by accident - to certain objects found in the GeoJson spec. Features correspond to the objects listed under features in a geojson FeatureCollection. Geometrys, to geometries in a geojson Feature.

#geotrellis.vector ##Features and Geometries

In addition to working with raster data, Geotrellis provides a number of facilities for the creation, representation, and modification of vector data. The data types central to this functionality (geotrellis.vector.Feature and geotrellis.vector.Geometry) correspond - and not by accident - to certain objects found in the GeoJson spec. Features correspond to the objects listed under features in a geojson FeatureCollection. Geometrys, to geometries in a geojson Feature.

#geotrellis.vector ##Features and Geometries

In addition to working with raster data, Geotrellis provides a number of facilities for the creation, representation, and modification of vector data. The data types central to this functionality (geotrellis.vector.Feature and geotrellis.vector.Geometry) correspond - and not by accident - to certain objects found in the GeoJson spec. Features correspond to the objects listed under features in a geojson FeatureCollection. Geometrys, to geometries in a geojson Feature.

#geotrellis.vector
##Features and Geometries
In addition to working with raster data, Geotrellis provides a number of
facilities for the creation, representation, and modification of vector
data. The data types central to this functionality (`geotrellis.vector.Feature`
and `geotrellis.vector.Geometry`) correspond - and not by accident - to
certain objects found in [the GeoJson spec](http://geojson.org/geojson-spec.html).
`Feature`s correspond to the objects listed under `features` in a geojson
`FeatureCollection`. `Geometry`s, to `geometries` in a geojson `Feature`.

#geotrellis.vector ##Features and Geometries

In addition to working with raster data, Geotrellis provides a number of facilities for the creation, representation, and modification of vector data. The data types central to this functionality (geotrellis.vector.Feature and geotrellis.vector.Geometry) correspond - and not by accident - to certain objects found in the GeoJson spec. Features correspond to the objects listed under features in a geojson FeatureCollection. Geometrys, to geometries in a geojson Feature.

Base = declarative_base()
engine = create_engine('postgresql://vagrant:vagrant@33.33.33.15:5432/vagrant', echo=True)
engine.connect()
Session = sessionmaker(bind=engine)
class JSchema(ConcreteBase, Base):
__tablename__ = 'json_schemas'
id = Column(Integer, primary_key=True)
router = DefaultRouter()
router.register(r'modelviewpath', module.SomeViewSet)
factory.put('https://botanic.internal.azavea.com:8023/api/modelviewpath/6/', etc, etc)
def readTile[K: TileReader: JsonFormat: ClassTag](layerId: LayerId): K => Tile = {
val accumuloLayerMetaData = metaDataCatalog.read(layerId)
val keyBounds = attributeStore.read[KeyBounds[K]](layerId, "keyBounds")
val index = attributeStore.read[KeyIndex[K]](layerId, "keyIndex")
implicitly[TileReader[K]].read(instance, layerId, accumuloLayerMetaData, index)(_)
}
val tile = (catalog.readTile[SpaceTimeKey](layerId))(key) // Throws
val tile = catalog.readTile[SpaceTimeKey](layerId)(key) // Throws