kartograph / kartograph.py

UNMAINTAINED! Renders beautiful SVG maps in Python.
http://kartograph.org/docs/kartograph.py
1k stars 195 forks source link

LCC projection throws error #90

Open cspencer51 opened 10 years ago

cspencer51 commented 10 years ago

When working with a Lambert Conformal Conic projection, and the following .json config file I, I get "ERROR 6: No translation for Lambert_Conformal_Conic to PROJ.4 format is known."

{
    "proj": {
        "id": "proj4",
        "opts": "+proj=lcc"
    },
    "layers": {
        "base": {
            "src": "COMMUNE.shp",
            "join": {
                "group-by": {
                    "commune": "NOM_COMM"
                },
                "export-ids": false
            }
        }
    }
}
$ kartograph fr.json -o fr.svg
ERROR 6: No translation for Lambert_Conformal_Conic to PROJ.4 format is known.
  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__()
  42: layer = MapLayer(layer_id, layer_cfg, me, layerCache)  maplayer.py, in __init__()
  35: self.source = handle_layer_source(self.options, self.cache)  layersource/__init__.py, in handle_layer_source()
  32: src = ShapefileLayer(src)  layersource/shplayer.py, in __init__()
  40: self.proj = pyproj.Proj(srs.ExportToProj4())  /usr/local/lib/python2.7/site-packages/pyproj/__init__.py, in __new__()
  343: return _proj.Proj.__new__(self, projstring)  _proj.pyx, in _proj.Proj.__cinit__ (_proj.c:950)()
  80: None
projection not named

There's not a lot of documentation on how the projections are supposed to work, so that part of the JSON is pieced together from what I've found here: https://github.com/kartograph/kartograph.py/issues/34 and here: ftp://ftp.remotesensing.org/proj/OF90-284.pdf .

Anyone else have this issue with either LCC or another projection?

choct155 commented 10 years ago

Just bumping this issue to make sure it is still on the radar. Cool product, but my only workaround for this issue has been to convert the base file. (It is not possible, for example, to try to convert the on the fly via the input JSON tree.)

rccc commented 10 years ago

In the '.prj' file, the projection property must be 'PROJECTION["Lambert_Conformal_Conic_2sp"]', not 'PROJECTION["Lambert_Conformal_Conic"]'.

http://forum.osgearth.org/Proj4-error-No-translation-for-lambert-conformal-conic-to-PROJ-4-format-is-known-td7579032.html

r-barnes commented 9 years ago

I'm having a similar issue with

ERROR 6: No translation for Albers to PROJ.4 format is known.