Skip to content

Error when generating svg #35

Closed
ferdinandsalis opened this Issue Apr 4, 2012 · 3 comments

3 participants

@ferdinandsalis

I ran into the following issue while generating a svg map. The used shapefile is the Admin 1 – States, Provinces loaded into QGIS to select all the german states and then saved as.

kartograph svg map.yaml -o germany.svg

-> full extend
Traceback (most recent call last):
File "/usr/local/bin/kartograph", line 8, in <module>
load_entry_point('kartograph.py==0.2.0', 'console_scripts', 'kartograph')()
File "/Library/Python/2.7/site-packages/kartograph.py-0.2.0-py2.7.egg/kartograph/cli.py", line 95, in main
args.func(args)
File "/Library/Python/2.7/site-packages/kartograph.py-0.2.0-py2.7.egg/kartograph/cli.py", line 64, in svg
K.generate(cfg, args.output)
File "/Library/Python/2.7/site-packages/kartograph.py-0.2.0-py2.7.egg/kartograph/kartograph.py", line 30, in generate
view = self.get_view(opts, bbox)
File "/Library/Python/2.7/site-packages/kartograph.py-0.2.0-py2.7.egg/kartograph/kartograph.py", line 201, in get_view
return View(bbox, w, h - 1)
TypeError: unsupported operand type(s) for -: 'str' and 'int'
{
  "proj": {
    "id": "ortho",
  },
  "layers": [
    {
      "id": "countries",
      "src": "germany-real.shp",
      "attributes": {
        "NAME_1": "Bundesland",
      }
    }
  ],
  "export": {
    "width": "auto",
    "height": "auto"
  },
  "bounds": {
    "padding": 0.02
  }
}

I hope someone can help. Thanks!

@gka
kartograph member
gka commented Apr 12, 2012

looks like a small bug. quick workaround: try setting a fixed width instead of "auto".

@marcmoncrief

I'm also getting this full extend message.
I'm trying to map a map from a shp where the actual vector image is placed at co-ordinates somewhere in the 7 digits. Obviously they wanted to make sure the space they were using was well out of the way of any regular maps.
the code looks like this:

{
"proj": {
"id": "satellite",
"lon0": 125,
"lat0": -86.75,
"dist": 2,
"up": 0,
"tilt": -35.806451612903224
},
"layers": [
{
"special": "sea",
"styles": {
"fill": "lightblue"
}
},
{
"special": "graticule",
"latitudes": 10,
"longitudes": 10,
"styles": {
"stroke-width": "0.4px"
}
},
{
"id": "city",
"src": "shp/urban_2010_within_2030_extent.shp",
"attributes": {
}
}
],
"export": {
"width": 800,
"height": 500
},
"bounds": {
"mode": "bbox",
"data": [2480000, 2398854, 2500501, 2412811],
"padding": 0.02,
"crop": [2480000, 2398854, 2500501, 2412811]
}
}

When I try to build I'm getting this:
Monkers-MacBook-Air:Includes ninamoncrief$ kartograph svg treeMap.json -o treeMap.svg
-> full extend
[]
and the cursor just sits there. For a long time.

@gka
kartograph member
gka commented Jul 19, 2012

Could you please try to reproduce the bug with the latest version of Kartograph (found in the kartograph-2 branch) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.