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
app.get('/leonardtown/buildings/:geom', function (req, res, next) { | |
var client = new pg.Client(app.conString); | |
var geom = req.params.geom.toLowerCase(); | |
if ((geom != "features") && (geom != "geometry")) { | |
res.status(404).send("Resource '" + geom + "' not found"); | |
return; | |
} | |
var tablename = "leonardtown_bldgs"; | |
var schemaname = "public"; | |
var fullname = schemaname + "." + tablename; |
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 |
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 |
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 requests | |
from pprint import pprint | |
r = requests.get('https://api.stackexchange.com/2.2/tags?page=1&pagesize=100&order=desc&sort=popular&site=gis') | |
data = r.json() | |
print "tag,count" | |
for tag in data["items"]: | |
print tag["name"] + "," + str(tag["count"]) |
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 (_draw == null) | |
{ | |
_draw = new Draw(BoundMap); //private class-level variable of type ESRI.ArcGIS.Client.Draw | |
_draw.DrawComplete += DrawCompleteHandler; //subscribe to the DrawComplete event | |
_activated = true; | |
_draw.IsEnabled = true; //enable the Draw object | |
} | |
_draw.DrawMode = DrawMode.Point; //set it to Point mode |
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
private void DrawCompleteHandler(object sender, DrawEventArgs args) | |
{ | |
_currentPoint = args.Geometry as MapPoint; //capture the point that where the mouse was clicked | |
TextSymbolPropsWindow win = new TextSymbolPropsWindow(); //My child window. This can be any you define. | |
win.EditMode = false; //this tells the window that this is a new annotation | |
win.Closed += new EventHandler(win_Closed); //subscribe to the window's Closed event | |
win.Show(); | |
} |
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
void win_Closed(object sender, EventArgs e) | |
{ | |
TextSymbolPropsWindow win = sender as TextSymbolPropsWindow; | |
if ((bool)win.DialogResult) | |
{ | |
GraphicsLayer graphicsLayer = BoundMap.Layers["AnnoLayer"] as GraphicsLayer; //the layer on which the anno will be drawn | |
string input = win.Annotation; | |
if (!String.IsNullOrEmpty(input)) | |
{ |
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
//callback should be like function(err){//do stuff} | |
function registervector(datasetName, callback){ | |
//dataset name is the name of the PostGIS table | |
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; //my dev SSL is self-signed. don't do this in production. | |
var https = require('https'); //using SSL because of basic auth in this example | |
var auth = 'Basic ' + new Buffer('username' + ':' + 'p@s$w0rd').toString('base64'); //strong passwords please | |
//build the object to post | |
var post_data = {'featureType': {'name': datasetName}}; | |
//be sure to turn it into a string | |
var s = JSON.stringify(post_data); |
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 fs = require('fs'); | |
function writeMetadata(Origin, Pubdate, Title, Abstract, Westbc, Eastbc, Northbc, Southbc, Addrtype, State){ | |
var XMLWriter = require('xml-writer'); | |
xw = new XMLWriter(true); | |
xw.startDocument(); | |
var root = xw.startElement('metadata'); | |
root.writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); | |
root.writeAttribute('xsi:noNamespaceSchemaLocation','http://www.fgdc.gov/metadata/fgdc-std-001-1998.xsd'); | |
var idinfo = root.startElement('idinfo'); |
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
SELECT | |
us_states_squares.shape, | |
us_states_squares.abbr, | |
us_states_squares.name, | |
vw_statistics_ytd.ytd | |
FROM | |
public.us_states_squares | |
INNER JOIN public.vw_statistics_ytd ON | |
us_states_squares.abbr = vw_statistics_ytd.state_abbr | |
WHERE |