Commit 9933468b authored by Jon Pye's avatar Jon Pye
Browse files

Removed hanging OpenStreetMap references and used coastlines() with max resolution

parent 6c2f6c1e
......@@ -8,7 +8,7 @@ import numpy as np
import as ccrs
from import MapQuestOpenAerial, MapQuestOSM, OSM
import matplotlib.pyplot as plt
from shapely.geometry import Polygon, mapping, asShape, shape, asPoint, point
from shapely.geometry import Point
def flip_geojson_coordinates(geo):
......@@ -28,10 +28,10 @@ def flip_geojson_coordinates(geo):
wfs = WebFeatureService('', version="2.0.0")
print list(wfs.contents)
a = wfs.contents['otn:animals']
a = wfs.contents['otn:stations']
b = a.boundingBoxWGS84
json_response = wfs.getfeature(typename=['otn:animals'], propertyname=None, outputFormat='application/json').read()
json_response = wfs.getfeature(typename=['otn:stations'], propertyname=None, outputFormat='application/json').read()
geom = geojson.loads(json_response)
......@@ -43,28 +43,25 @@ geodetic = ccrs.Geodetic(globe=ccrs.Globe(datum='WGS84'))
# Open Source Imagery from MapQuest (max zoom = 16?)
tiler = MapQuestOpenAerial()
# Open Street Map (max zoom = 18?)
tiler = OSM()
ax = plt.axes(
ax = plt.axes(projection=ccrs.PlateCarree())
extent = (b[0]-0.1*dx,b[2]+0.1*dx,b[1]-0.1*dy,b[3]+0.1*dy)
ax.set_extent(extent, geodetic)
ax.add_image(tiler, 7)
# facecolor=BLUE, edgecolor=GRAY,alpha=0.5)
for p in geom.get("features", []):
# How to feed this to the ax.?
#multi_poly = asShape(p.get("geometry"))
thePoint = asPoint(p.get("geometry"))
edgecolor='black',facecolor='none', color='black')
# Get a list of all features.
locs = geom.get("features", [])
lons, lats = zip(*[(x["geometry"]["coordinates"][0], x["geometry"]["coordinates"][1]) for x in locs])
# Can get other data here, too.
ax.scatter(lons, lats, transform=ccrs.PlateCarree())
print 'done with geometry'
gl.xlabels_top = False
gl.ylabels_right = False
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment