forked from gisalgs/geom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_projection.py
39 lines (33 loc) · 915 Bytes
/
test_projection.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Test drive for the Robinson projection.
Contact:
Ningchuan Xiao
The Ohio State University
Columbus, OH
"""
__author__ = "Ningchuan Xiao <[email protected]>"
from osgeo import ogr
import matplotlib.pyplot as plt
from transform1 import *
from worldmap import *
fname = '../data/ne_110m_coastline.shp'
pp, numgraticule, numline = prep_projection_data(fname)
points=[]
for p in pp:
p1 = transform1(p[1], p[2])
points.append([p[0], p1[0], p1[1]])
for i in range(numline):
if i<numgraticule:
col = 'lightgrey'
else:
col = '#5a5a5a'
ptsx = [p[1] for p in points if p[0]==i]
ptsy = [p[2] for p in points if p[0]==i]
plt.plot(ptsx, ptsy, color=col)
plt.axis('scaled')
frame = plt.gca()
frame.axes.get_xaxis().set_visible(False)
frame.axes.get_yaxis().set_visible(False)
frame.set_frame_on(False)
frame.set_frame_on(True)
plt.show()