Exemple #1
0
#-----------------------------------------------------------------------------
# INITIALISE CLASS STATES
#-----------------------------------------------------------------------------

# Generate InShape class
SHAPE = InShape(shape_path)
# Create shapely polygon from imported shapefile
UNIQUE_SHAPE = SHAPE.shape_poly()
print type(UNIQUE_SHAPE)
# Generate InPoly class
INPOLY = InPoly(shape_path)
GEODESIC = Geodesic()
COORDS = Coordinates()
INPOLY = InPoly(shape_path)
POLY_NODES = INPOLY.poly_nodes()

# decluster the points to desired specifications.
coords = COORDS.decluster(inputs=coords, degree_dist=0.5)

lonmin, lonmax = np.floor(min(coords[:, 0])), np.ceil(max(coords[:, 0]))
latmin, latmax = np.floor(min(coords[:, 1])), np.ceil(max(coords[:, 1]))
print lonmin, lonmax, latmin, latmax

plt.figure()
plt.scatter(coords[:, 0], coords[:, 1])
plt.show()



kappa = [np.vstack([[coord1[0],coord1[1],coord2[0],coord2[1]]\
Exemple #2
0
# -----------------------------------------------------------------------------
# INITIALISE CLASS STATES
# -----------------------------------------------------------------------------

# Generate InShape class
SHAPE = InShape(shape_path)
# Create shapely polygon from imported shapefile
UNIQUE_SHAPE = SHAPE.shape_poly()
print type(UNIQUE_SHAPE)
# Generate InPoly class
INPOLY = InPoly(shape_path)
GEODESIC = Geodesic()
COORDS = Coordinates()
INPOLY = InPoly(shape_path)
POLY_NODES = INPOLY.poly_nodes()


# decluster the points to desired specifications.
coords = COORDS.decluster(inputs=coords, degree_dist=0.5)


lonmin, lonmax = np.floor(min(coords[:, 0])), np.ceil(max(coords[:, 0]))
latmin, latmax = np.floor(min(coords[:, 1])), np.ceil(max(coords[:, 1]))
print lonmin, lonmax, latmin, latmax


plt.figure()
plt.scatter(coords[:, 0], coords[:, 1])
plt.show()