View ImageType.cs
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
if (ImageFormat.Jpeg.Equals(image.RawFormat)) | |
{ | |
// JPEG | |
} | |
else if (ImageFormat.Png.Equals(image.RawFormat)) | |
{ | |
// PNG | |
} | |
else if (ImageFormat.Gif.Equals(image.RawFormat)) | |
{ |
View globamaptiles.py
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
#!/usr/bin/env python | |
############################################################################### | |
# $Id$ | |
# | |
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 | |
# Global Map Tiles Classes | |
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, | |
# generate a simple HTML viewers based on Google Maps and OpenLayers | |
# Author: Klokan Petr Pridal, klokan at klokan dot cz | |
# Web: http://www.klokan.cz/projects/gdal2tiles/ |
View worlddfile.py
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
def WorldFileParameters(self, tx, ty, zoom): | |
"Returns world file (affine transofrmation) parameters of the given tile." | |
bounds = self.TileBounds( tx, ty, zoom) | |
moriginx = bounds[3] + (self.Resolution(zoom) / 2) | |
moriginy = bounds[0] - (self.Resolution(zoom) / 2) | |
return (self.Resolution(zoom), 0.0, 0.0, self.Resolution(zoom) * -1, moriginy, moriginx) |
View server.js
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
var express = require('express'), | |
geo = require('./routes/geo'); | |
var app = express(); | |
app.get('/countries/:id/bbox', geo.bbox); | |
app.get('/countries/:id/bbox/:srid', geo.bboxSrid); | |
app.get('/countries/:id/polygon', geo.polygon); | |
app.get('/countries/:id/polygon/:srid', geo.polygonSrid); |
View geo.js
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
var pg = require('pg'); | |
var conString = "postgres://username:password@hostname.rds.amazonaws.com:5432/database"; //TODO: point to RDS instance | |
exports.bbox = function(req, res) { | |
var client = new pg.Client(conString); | |
client.connect(); | |
var crsobj = {"type": "name","properties": {"name": "urn:ogc:def:crs:EPSG:6.3:4326"}}; | |
var idformat = "'" + req.params.id + "'"; | |
idformat = idformat.toUpperCase(); | |
var query = client.query("select st_asgeojson(st_envelope(shape)) as geojson from ne_countries where iso_a3 = " + idformat + ";"); |
View irl_bbox.json
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
{ | |
"type": "feature", | |
"crs": { | |
"type": "name", | |
"properties": { | |
"name": "urn:ogc:def:crs:EPSG:6.3:4326" | |
} | |
}, | |
"geometry": { | |
"type": "Polygon", |
View snippet6.bat
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
curl -X POST -d "{ \"type\": \"Point\", \"coordinates\": [-98.35, 39.7] }" -H "Content-Type: application/json" http://localhost:3000/vector/public/states_gen/features/intersect |
View snippet7.js
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
/** | |
* retrieve all features that intersect the input GeoJSON geometry | |
*/ | |
app.post('/vector/:schema/:table/:geom/intersect', function (req, res, next) { | |
//console.log(JSON.stringify(req.body)); | |
var queryshape = JSON.stringify(req.body); | |
//continue with the rest of app.post |
View snippet1.bat
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
python tile_grab.py -b -158;21;-157;22 -d E:\tiles\oahu_img\a -i false -z 6 -u http://www.someserver.net/arcgis/rest/services/ImagerySvc/MapServer/tile/{z}/{y}/{x}.png |
View snippet2.bat
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
gdalbuildvrt 6.vrt 6/*.png |
OlderNewer