Skip to content

Instantly share code, notes, and snippets.

View aidenprice's full-sized avatar

Aiden Price aidenprice

  • Arrowtail Precision Pty Ltd
  • Newcastle, NSW, Australia
  • 01:56 (UTC +10:00)
View GitHub Profile
@aidenprice
aidenprice / UTM Zone Boundaries.geojson
Created May 1, 2019 02:16
UTM Zone Boundaries GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aidenprice
aidenprice / Renewable_Energy_Potential_Web_Map.html
Last active August 29, 2015 14:16
Use OpenLayers 3.0.0 to mash together spatial data sourced from OpenStreetMaps and Geoscience Australia. The resultant web map shows areas of Australia with potential for solar or geothermal energy and the distance to existing power stations and power lines.
<link rel="stylesheet" href="http://openlayers.org/en/v3.0.0/css/ol.css" type="text/css">
<style>
#OpenLayersLayerControl {
margin-top: 10px;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
padding: 10px;
width: 15em;
@aidenprice
aidenprice / Ray_Casting_Algorithm.py
Last active September 21, 2022 16:10
A Python implementation of the Ray-Casting algorithm solution to the point-in-polygon problem. Originally a method in the APPolygonObject class written for my Curtin University, Masters of Geospatial Science, Spatial Computations 100, second assignment, BoreholeWrangler V3.0.
def determineIfPointLiesWithinPolygon(self, locationToTest):
# Check that the argument is actually a LocationObject.
if isinstance(locationToTest, LocationObject):
# Set crossings value to initial zero value.
iCrossings = 0
# For each segment of the polygon (i.e. line drawn between each of the polygon's vertices) check whether
# a ray cast straight down from the test location intersects the segment (keep in mind that the segment
# may be intersected either coming or going). If the ray does cross the segment, increment the iCrossings
@aidenprice
aidenprice / APPolygonObject.py
Last active August 29, 2015 14:03
A Python class to describe a user polygon with a series of APLocationObjects. Can determine whether a test point (also an APLocationObject) lies within the polygon using the ray-casting algorithm. Created for my Curtin University, Masters of Geospatial Science, Spatial Computations 100, second assignment, BoreholeWrangler V3.0.
from APLocationObject import LocationObject
class PolygonObject:
# Class properties
lVertices = []
iNumberOfVertices = None
# Class methods
def __init__(self, lPoints):
self.iNumberOfVertices = len(lPoints)
@aidenprice
aidenprice / APLocationObject.py
Last active August 29, 2015 14:03
A class to describe a point in latitude, longitude and elevation. __eq__ and __repr__ methods excluded. This class was created for my Curtin University, Masters of Geospatial Science, Spatial Computations 100, second assignment, BoreholeWrangler V3.0.
class LocationObject:
# Class properties
fLatitude = None
fLongitude = None
fElevation = None
# Class hidden properties
# Minimum and maximum values to validate location inputs.
_MIN_LATITUDE = -90.0
_MAX_LATITUDE = 90.0