Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proj4 does not accept utf8 projstr #97

Open
christophfink opened this issue Dec 12, 2013 · 0 comments
Open

proj4 does not accept utf8 projstr #97

christophfink opened this issue Dec 12, 2013 · 0 comments

Comments

@christophfink
Copy link

In kartograph/proj/proj4.py the constructor function __init__ accepts a projstr which later is used to initialise proj4's pyproj.Proj()
This string typically is a unicode string, at least on my system, because json.loads() produces unicode output.
Thus, it is necessary to cast projstr to str().

Example error output:

$ kartograph -P testjson -o test.svg
  cli.py, in render_map()
  71: K.generate(cfg, args.output, preview=args.preview, format=format, stylesheet=css)  kartograph.py, in generate()
  46: _map = Map(opts, self.layerCache, format=format)  map.py, in __init__()
  48: me.proj = me._init_projection()  map.py, in _init_projection()
  106: return projC(**p_opts)  proj/proj4.py, in __init__()
  11: self.proj = pyproj.Proj(projstr)  /usr/lib64/python2.7/site-packages/pyproj/__init__.py, in __new__()
  328: projstring = _dict2string(projparams)  /usr/lib64/python2.7/site-packages/pyproj/__init__.py, in _dict2string()
  555: for key,value in projparams.items():
'unicode' object has no attribute 'items'

with test.json containing the following crs information:

    "proj": {
        "projstr": "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
        "id": "proj4"
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant