This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File file = new File("earth.tif") | |
GeoTIFF geotiff = new GeoTIFF(file) | |
Raster raster = geotiff.read("earth") | |
File arcGridFile = new File("earth.asc") | |
ArcGrid arcGrid = new ArcGrid(arcGridFile) | |
arcGrid.write(raster) | |
Raster arcGridRaster = arcGrid.read("earth") | |
arcGridRaster.eachCell {double value, double x, double y -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elif options.offsetcalc: | |
import exifread | |
from datetime import datetime | |
imgDate = datetime.strptime(args[0], "%Y-%m-%d %H:%M:%S") | |
f = open(args[1], 'rb') | |
tags = exifread.process_file(f) | |
f.close() | |
exifDateStr = tags['EXIF DateTimeDigitized'].values | |
exifDate = datetime.strptime(exifDateStr, "%Y:%m:%d %H:%M:%S") | |
diff = exifDate - imgDate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geoscript.layer.* | |
import geoscript.geom.Bounds | |
import geoscript.proj.Projection | |
import javax.imageio.ImageIO | |
Projection proj = new Projection("EPSG:4326") | |
Bounds bounds = new Bounds(-180,-90,180,90, proj) | |
List imageSize = [1600, 800] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geoscript.layer.Shapefile | |
import geoscript.layer.io.CsvReader | |
import geoscript.style.* | |
import geoscript.render.Map | |
import geoscript.geom.Bounds | |
def dir = "/Users/jericks/Projects/NaturalEarth/SmallScale" | |
def ocean = new Shapefile("${dir}/110m_Physical/110m_ocean.shp") | |
ocean.style = new Fill("#66CCFF") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geoscript.layer.* | |
import geoscript.geom.Bounds | |
import geoscript.proj.Projection | |
import javax.imageio.ImageIO | |
MBTiles mbtiles = new MBTiles(new File("geography-class.mbtiles")) | |
Raster raster = mbtiles.getRaster(mbtiles.tiles(4)).reproject(new Projection("EPSG:4326")).resample(bbox: new Bounds(-180,-90,180,90,"EPSG:4326"), size: [800,400]) | |
ImageIO.write(raster.image, "png", new File("geography-class.png")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.imageio.ImageIO | |
import java.awt.* | |
import java.awt.image.* | |
if (args.length < 2) { | |
println "Usage: groovy tabs.groovy input.png output.png" | |
System.exit(-1) | |
} | |
String inputFile = args[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Store a tile | |
* | |
* @throws IOException | |
*/ | |
public void saveTile(MBTilesTile entry) throws IOException { | |
try { | |
Connection cx = connPool.getConnection(); | |
try { | |
PreparedStatement ps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package geoscript.layer | |
import geoscript.feature.Feature | |
import geoscript.workspace.Directory | |
import geoscript.workspace.Memory | |
import org.geotools.data.DataUtilities | |
import org.geotools.data.DefaultTransaction | |
import org.geotools.data.FeatureStore | |
import org.geotools.data.Transaction | |
import org.geotools.data.collection.ListFeatureCollection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geoscript.layer.* | |
import geoscript.feature.* | |
import geoscript.workspace.* | |
import org.geotools.data.Transaction | |
import org.geotools.data.DefaultTransaction | |
import org.geotools.data.FeatureStore | |
import org.geotools.data.DataUtilities | |
import org.geotools.data.FeatureWriter as GtFeatureWriter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geoscript.layer.* | |
import geoscript.feature.* | |
import geoscript.workspace.* | |
import org.geotools.data.Transaction | |
import org.geotools.data.DefaultTransaction | |
import org.geotools.data.FeatureStore | |
import org.geotools.data.DataUtilities | |
/** |
NewerOlder