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

Broken cylindrical projections in 0.2.2? #37

Open
herrstucki opened this Issue Apr 12, 2012 · 5 comments

Comments

Projects
None yet
5 participants
@herrstucki
Contributor

herrstucki commented Apr 12, 2012

When I try to render a (pseudo?)cylindrical projection with 0.2.2 (e.g. winkel3), I get following error:

Traceback (most recent call last):
  File "/usr/local/bin/kartograph", line 8, in <module>
    load_entry_point('kartograph.py==0.2.2', 'console_scripts', 'kartograph')()
  File "/Library/Python/2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/cli.py", line 103, in main
    args.func(args)
  File "/Library/Python/2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/cli.py", line 65, in svg
    K.generate(cfg, args.output)
  File "/Library/Python/2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/kartograph.py", line 26, in generate
    proj = self.get_projection(opts)
  File "/Library/Python/2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/kartograph.py", line 94, in get_projection
    proj = projC(**p_opts)
  File "/Library/Python/2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/proj/pseudocylindrical.py", line 366, in __init__
    Aitoff.__init__(self, lon0=lon0, flip=flip)
  File "/Library/Python/2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/proj/pseudocylindrical.py", line 341, in __init__
    PseudoCylindrical.__init__(self, lon0=lon0, flip=flip)
  File "/Library/Python/2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/proj/pseudocylindrical.py", line 26, in __init__
    Cylindrical.__init__(self, lon0=lon0, flip=flip)
  File "/Library/Python/2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/proj/cylindrical.py", line 32, in __init__
    from Polygon import MultiPolygon as Poly
ImportError: cannot import name MultiPolygon

This seems to have been introduced with this commit: 84d80fa

@lossy

This comment has been minimized.

Show comment
Hide comment
@lossy

lossy May 17, 2012

Thank you so much for this great work - this is very useful.
I have the same issue as above, error when rendering certain projections when prog->lon0 is not zero. I am using Python 2.7 on Linux (Centos). Looks like "MultiPolygon" class of Polygon lib not registered/available, but this is the first time I ever installed a Python program so fault probably with me - any tips gratefully recieved!

Traceback (most recent call last):
File "/usr/bin/kartograph", line 9, in
load_entry_point('kartograph.py==0.2.2', 'console_scripts', 'kartograph')()
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/cli.py", line 103, in main
args.func(args)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/cli.py", line 65, in svg
K.generate(cfg, args.output)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/kartograph.py", line 26, in generate
proj = self.get_projection(opts)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/kartograph.py", line 94, in get_projection
proj = projC(**p_opts)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/proj/cylindrical.py", line 173, in init
Cylindrical.init(self, lon0=lon0, flip=flip)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/proj/cylindrical.py", line 32, in init
from Polygon import MultiPolygon as Poly
ImportError: cannot import name MultiPolygon

Here's a config file to reproduce the error:
(no error if you change lon0 to 0)

{

"proj": {
"id": "mercator",
"lon0": 10,
"lat0": 0
},

"layers": [
{
"id": "countries",
"src": "ne_50m_admin_0_countries.shp"
}
],

"export": {
"width": 600,
"height": "auto"
},

"bounds": {
"mode": "bbox",
"data": [70,17,135,54]
}

}

lossy commented May 17, 2012

Thank you so much for this great work - this is very useful.
I have the same issue as above, error when rendering certain projections when prog->lon0 is not zero. I am using Python 2.7 on Linux (Centos). Looks like "MultiPolygon" class of Polygon lib not registered/available, but this is the first time I ever installed a Python program so fault probably with me - any tips gratefully recieved!

Traceback (most recent call last):
File "/usr/bin/kartograph", line 9, in
load_entry_point('kartograph.py==0.2.2', 'console_scripts', 'kartograph')()
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/cli.py", line 103, in main
args.func(args)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/cli.py", line 65, in svg
K.generate(cfg, args.output)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/kartograph.py", line 26, in generate
proj = self.get_projection(opts)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/kartograph.py", line 94, in get_projection
proj = projC(**p_opts)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/proj/cylindrical.py", line 173, in init
Cylindrical.init(self, lon0=lon0, flip=flip)
File "/opt/python2.7/lib/python2.7/site-packages/kartograph.py-0.2.2-py2.7.egg/kartograph/proj/cylindrical.py", line 32, in init
from Polygon import MultiPolygon as Poly
ImportError: cannot import name MultiPolygon

Here's a config file to reproduce the error:
(no error if you change lon0 to 0)

{

"proj": {
"id": "mercator",
"lon0": 10,
"lat0": 0
},

"layers": [
{
"id": "countries",
"src": "ne_50m_admin_0_countries.shp"
}
],

"export": {
"width": 600,
"height": "auto"
},

"bounds": {
"mode": "bbox",
"data": [70,17,135,54]
}

}

@mohamedamami

This comment has been minimized.

Show comment
Hide comment
@mohamedamami

mohamedamami May 29, 2012

Any news about this issue

Any news about this issue

@mtvv

This comment has been minimized.

Show comment
Hide comment
@mtvv

mtvv Jun 21, 2012

I have the same problem too. Basically the only projections I can use are "ortho", "satellite" and "stereo".

mtvv commented Jun 21, 2012

I have the same problem too. Basically the only projections I can use are "ortho", "satellite" and "stereo".

@mtvv

This comment has been minimized.

Show comment
Hide comment
@mtvv

mtvv Jul 18, 2012

I have just found out that using 'auto' instead of a number for 'lon0' makes cylindrical projections work.
So using the following produces a winkle triple projection:

{
    "proj": {
       "id": "winkel3",
       "lon0": "auto"
    }
}

mtvv commented Jul 18, 2012

I have just found out that using 'auto' instead of a number for 'lon0' makes cylindrical projections work.
So using the following produces a winkle triple projection:

{
    "proj": {
       "id": "winkel3",
       "lon0": "auto"
    }
}
@neapel

This comment has been minimized.

Show comment
Hide comment
@neapel

neapel Aug 28, 2012

Polygon 2.0.4 doesn't include MultiPolygon.

$ python
Python 2.7.3
>>> import Polygon
>>> Polygon.__version__
'2.0.4'
>>> from Polygon import MultiPolygon
ImportError: cannot import name MultiPolygon

I think it's a typo: in conic.py and cylindrical.py, instead of from Polygon import, it should be from kartograph.geometry.polygon.import: d89bd1a
I get some more errors then, though, like Polygon.Polygon not having an operator &.

neapel commented Aug 28, 2012

Polygon 2.0.4 doesn't include MultiPolygon.

$ python
Python 2.7.3
>>> import Polygon
>>> Polygon.__version__
'2.0.4'
>>> from Polygon import MultiPolygon
ImportError: cannot import name MultiPolygon

I think it's a typo: in conic.py and cylindrical.py, instead of from Polygon import, it should be from kartograph.geometry.polygon.import: d89bd1a
I get some more errors then, though, like Polygon.Polygon not having an operator &.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment