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

Can't generate map with "special" layer #107

Open
dikmax opened this issue Jun 4, 2014 · 2 comments
Open

Can't generate map with "special" layer #107

dikmax opened this issue Jun 4, 2014 · 2 comments

Comments

@dikmax
Copy link

dikmax commented Jun 4, 2014

When I add to config some special layer (sea or graticule), map fails to generate with error:

Traceback (most recent call last):
  File "visited-countries/map/makeMap.py", line 22, in <module>
    K.generate(config, outfile='world.svg')
  File "/usr/local/lib/python2.7/dist-packages/kartograph/kartograph.py", line 46, in generate
    _map = Map(opts, self.layerCache, format=format)
  File "/usr/local/lib/python2.7/dist-packages/kartograph/map.py", line 48, in __init__
    me.proj = me._init_projection()
  File "/usr/local/lib/python2.7/dist-packages/kartograph/map.py", line 88, in _init_projection
    map_center = self.__get_map_center()
  File "/usr/local/lib/python2.7/dist-packages/kartograph/map.py", line 140, in __get_map_center
    features = self._get_bounding_geometry()
  File "/usr/local/lib/python2.7/dist-packages/kartograph/map.py", line 257, in _get_bounding_geometry
    charset=layer.options['charset']
TypeError: get_features() got an unexpected keyword argument 'filter'

I tried first with console util, then with python script. All the same.

from kartograph import Kartograph
K = Kartograph()

config = {
    "layers": {
        "background": {
            "special": "sea",
            "charset": "utf8"
        },
        "countries": {
           "src": "ne_50m_admin_0_countries_lakes.shp",
            "attributes": {
                "code": "su_a3"
            }
        }
    },
    "proj": {
        "id": "winkel3"
    }
}

K.generate(config, outfile='world.svg')

Any ideas how to fix it?

@josemiotto
Copy link

I had the same error, it is solved by adding a bounds parameter.

@zimmicz
Copy link

zimmicz commented Nov 1, 2014

@josemiotto could you please send an example? I tried with

{
    "layers": {
        "background": {
            "special": "sea"
        },
        "countries": {
            "src": "ne_50m_admin_0_countries.shp"
        },
        "mygraticule": {
            "special": "graticule",
            "latitudes": 10,
            "longitudes": 10
        }
    },
    "bounds": {
        "mode": "bbox",
        "data": [-180, -90, 180, 90]
    }
}

but that does not seem to work.

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

3 participants