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 |
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
ogr2ogr -f "GeoJSON" statistics_%2_%1.geojson PG:"host=localhost user=wombat dbname=geo2 password=sufficiently_complex_password" -sql "SELECT * FROM vw_geojson_statistics_ytd WHERE year = 2015" |
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
using GeoIQ.Net; | |
using GeoIQ.Net.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
def AgsTile(self, tx, ty, zoom): | |
#Converts TMS tile coordinates to ArcGIS Tile coordinates | |
xhex = hex(tx) | |
yhex = hex((2**zoom - 1) - ty) | |
xhex = xhex.replace("0x", "") | |
yhex = yhex.replace("0x", "") | |
xhex = "C" + xhex.zfill(8) | |
yhex = "R" + yhex.zfill(8) | |
return xhex, yhex |
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
DECLARE @pt geometry; | |
SET @pt = geometry::Point(-82.655, 42.399, 4326) | |
SELECT COUNT(GID) FROM lake_st_clair WHERE geom.STContains(@pt) = 1; |
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
USE [MyDB] | |
GO | |
/****** Object: Trigger [dbo].[Locations_Insert] Script Date: 11/03/2012 08:50:48 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
/* This trigger makes sure that the data being inserted into | |
the Locations falls within a specific polygon stored in another table. | |
If it doesn't, the transaction is rolled back. |
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 path = Server.MapPath("/App_Data/mvc_samples.gdb"); | |
Geodatabase gdb = Geodatabase.Open(path); | |
Table statesTable = gdb.OpenTable("\\us_states"); | |
RowCollection rows = statesTable.Search("*", "STATE_NAME LIKE 'M%'", RowInstance.Recycle); | |
var rval = rows.ToGeoJson(); | |
gdb.Close(); | |
Response.ContentType = "application/json"; | |
object result = this.Content(rval); | |
return result as ActionResult; |