Skip to content

Instantly share code, notes, and snippets.

@bryanluman
bryanluman / float2int.py
Last active December 2, 2020 03:57
Converting a large DEM with rasterio
import numpy as np
import rasterio
"""
2014-02-13
Bryan Luman
Use it however you like at your own risk
Problem:
I have a huge DEM converted from LiDAR LAS points. I'd like to make it slightly
@bryanluman
bryanluman / fix_index.py
Last active August 29, 2015 13:57
Fix shapefile indexes recursively thanks to NIM098173
import os
import sys
import arcpy
from datetime import datetime
def has_no_index(shp_filepath):
sbx = shp_filepath[0:-3] + 'sbx'
sbn = shp_filepath[0:-3] + 'sbn'
return not ( os.path.exists(sbx) and os.path.exists(sbn) )
@bryanluman
bryanluman / sde_hacks.py
Created August 5, 2014 20:52
Mini-implementation of ArcSDE I made for ArcGIS 9 when ArcPy really sucked
class FeatureClass(object):
def __init__(self, conn, database, schema, table_name):
self.conn = conn
self.database = database
self.schema = schema
self.table_name = table_name
self._set_registration_id()
self._set_geometry_table()
@property