Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
<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; |
This file contains hidden or 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 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 |
This file contains hidden or 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
from APLocationObject import LocationObject | |
class PolygonObject: | |
# Class properties | |
lVertices = [] | |
iNumberOfVertices = None | |
# Class methods | |
def __init__(self, lPoints): | |
self.iNumberOfVertices = len(lPoints) |
This file contains hidden or 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
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 |