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; |
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 sys | |
import os | |
import urllib | |
from bs4 import BeautifulSoup | |
#TODO: pass in xml path and output folder as args | |
xml = open('C:\\Workspace\\blog\\geomusings_export.xml').read() | |
doc = BeautifulSoup(xml) | |
#attachments could technically be something other than images |
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
## Copyright (c) 2013, William Dollins | |
## All rights reserved. | |
## | |
## Redistribution and use in source and binary forms, with or without | |
## modification, are permitted provided that the following conditions are met: | |
## | |
## Redistributions of source code must retain the above copyright notice, | |
## this list of conditions and the following disclaimer. | |
## | |
## Redistributions in binary form must reproduce the above copyright notice, |
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
## Copyright (c) 2013, William Dollins | |
## All rights reserved. | |
## | |
## Redistribution and use in source and binary forms, with or without | |
## modification, are permitted provided that the following conditions are met: | |
## | |
## Redistributions of source code must retain the above copyright notice, | |
## this list of conditions and the following disclaimer. | |
## | |
## Redistributions in binary form must reproduce the above copyright notice, |
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 site | |
import psycopg2 | |
import csv | |
conn = psycopg2.connect("dbname=mydb host=myhost user=myuser password=mypass") | |
cur = conn.cursor() | |
cr = csv.reader(open("/path/to/my.csv","rb")) | |
i = 0 | |
for row in cr: |
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
{ | |
"vlayers": [{ | |
"vlayer": { | |
"featureSources": ["feature1.json", | |
"feature2.json"] | |
} | |
}, | |
{ | |
"vlayer": { | |
"featureSources": ["feature3.json", |
OlderNewer