def _truncate(self, x, y): return (x, y) for pjname in projections: projections[pjname].name = pjname if __name__ == '__main__': import sys # some class testing #p = LAEA(52.0,10.0) #x,y = p.project(50,5) #assert (round(x,2),round(y,2)) == (3962799.45, -2999718.85), 'LAEA proj error' from kartograph.geometry import BBox print Proj.fromXML(Robinson(lat0=3, lon0=4).toXML(), projections) Robinson(lat0=3, lon0=4) for pj in projections: Proj = projections[pj] bbox = BBox() try: proj = Proj(lon0=60) print proj.project(0, 0) print proj.world_bounds(bbox) print proj.toXML() except: print 'Error', pj print sys.exc_info()[0] raise
projections['proj4'] = Proj4 for pjname in projections: projections[pjname].name = pjname if __name__ == '__main__': import sys # some class testing #p = LAEA(52.0,10.0) #x,y = p.project(50,5) #assert (round(x,2),round(y,2)) == (3962799.45, -2999718.85), 'LAEA proj error' from kartograph.geometry import BBox print Proj.fromXML(Robinson(lat0=3, lon0=4).toXML(), projections) Robinson(lat0=3, lon0=4) for pj in projections: Proj = projections[pj] bbox = BBox() try: proj = Proj(lon0=60) print proj.project(0, 0) print proj.world_bounds(bbox) print proj.toXML() except: print 'Error', pj print sys.exc_info()[0] raise