Skip to content

Instantly share code, notes, and snippets.

View mikepianka's full-sized avatar

Mike Pianka mikepianka

View GitHub Profile
@mikepianka
mikepianka / README.txt
Last active April 17, 2024 15:22
Python http.server exe
This is Python's http.server that has been bundled to an .exe using PyInstaller. You can use it as a local web server for testing.
Run the local server
1. Copy the server.exe into the folder you want to serve and then double click it to start the local server.
2. A window will pop up letting you know the server is running on port 8000.
3. Open http://localhost:8000/ in your web browser.
4. When you are done, simply close the server.exe window to stop the local server.
If you have another service running on port 8000, you can run on a different port like so:
1. Open Command Prompt
@mikepianka
mikepianka / redirect.html
Last active July 29, 2022 17:55
Simple HTML Redirect
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Redirecting...</title>
</head>
<body onload="redirect()">
<p>
If you are not automatically redirected; follow this
<a href="#" onclick="redirect()">link</a>
@mikepianka
mikepianka / gh-pages-react-deploy.md
Last active November 6, 2020 03:22
Auto Deploy React app to GitHub Pages

Auto deploy React app to GitHub Pages

project should be pushed up to a GitHub repo before following these instructions

install gh-pages

install the gh-pages package in your project as a dev dependency

npm install gh-pages --save-dev

edit package.json

add homepage field to tell React the root for the app

@mikepianka
mikepianka / backgrounds.md
Last active October 22, 2020 13:26
Windows Terminal Starter

tux

pytux

python

powershell

@mikepianka
mikepianka / cursor_oops.py
Last active October 2, 2020 10:03
OOP helper class for arcpy cursors
# when arcpy moves to python 3.7, dataclasses will be the better alternative
class Feature:
"""A feature object created from an attribute table row."""
def __init__(self, field_names, row_values):
self.__schema = dict(zip(field_names, [type(v) for v in row_values]))
d = dict(zip(field_names, row_values))

GIS DATA QA-QC

This is a list of general QA-QC procedures for evaluating GIS vector data. These are methods I've had success with for catching common errors and anomalies. These techniques focus on identifying higher level issues that can be overlooked when the data is peer-reviewed at a “down in the weeds” level specific to the content of the data layers.

Most often, granular data edit errors are caught in peer-level review. After all that is the whole purpose of these reviews. These are the reviews focused on “Did all the sewer lines get added? Did all of the attributes on the sewer lines get filled out correctly?" These reviews are good at catching if a feature line was missed and not added to the shapefile, a feature attribute that could have been filled out was left empty or was filled in with an incorrect value, etc.

With all the hard work to make sure the nitty-gritty details were captured in the feature class, there can be bigger picture issues that cause problems which may not be immediately evi

@mikepianka
mikepianka / raster_multi_clip.py
Created February 19, 2020 15:21
Clip a raster in arcpy with multiple polygons
import os
import arcpy
### add inputs
# the input polygon feature class with the areas of interest to clip
fc = r'c:\working\project.gdb\clip_areas'
# the input raster to be clipped
raster = r'c:\working\project.gdb\some_big_raster'