-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Trouble Joining Features in a Layer #13
Comments
The second config you posted doesn't seem to be valid. There's a " in the line before "export-ids": "no". Do you have used the same config? Could you try to provide a reproducible example, perhaps using a free shapefile? |
Thanks for the quick reply, gka! Sorry, I must have copied that file before I saved the changes to it. Here is the corrected json that I was using and causing an error:
But I get the same error when I try to group all countries by continent using your sample ne_50m_admin_0_countries.shp file. Here's the .json file I used:
And here's the error I get when trying to group the countries by continent:
If I use the json without the "join", it creates an .svg just fine:
Thanks again for your help. |
Hi, I have exactly the same error. Is there already a solution? This config works perfectly: { "id": "continents", "src": "ne_50m_admin_0_countries.shp", "class": "continents", "attributes": "all", "filter-islands": 40, "filter": { "and": [ ["adm0_a3", "not in", ["ATA"]] ] }, "join": { "group-by": "continent", "group-as": "region_code", "attributes": { "admin": "continent" }, "export-ids": "adm0_a3" }, "simplify": 0 } But I need to group special countries. So I tried the following: { "id": "continents", "src": "ne_50m_admin_0_countries.shp", "class": "continents", "filter": { "and": [ ["iso_a2", "in", ["AI", "AG", "AW", "BB", "BZ", "VG", "CR", "CW", "BS", "DM", "DO", "SV", "GD", "GT", "HT", "HN", "JM", "VI", "KY", "CU", "MS", "NI", "PA", "PR", "SX", "BL", "KN", "LC", "MF", "VC", "TT", "TC"]] ] }, "join": { "group-by": "iso_a2", "groups": { "CAC": ["AI", "AG", "AW", "BB", "BZ", "VG", "CR", "CW", "BS", "DM", "DO", "SV", "GD", "GT", "HT", "HN", "JM", "VI", "KY", "CU", "MS", "NI", "PA", "PR", "SX", "BL", "KN", "LC", "MF", "VC", "TT", "TC"] } }, "simplify": 0 } Then I get the error: cli.py, in render_map() 66: 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__() 65: me._join_features() map.py, in _join_features() 503: if join['export-ids']: 'export-ids' Thanks for help! |
Hi gka. Just wondering what the status of this issue is. Did chilles1 and I uncover a bug that you are trying to fix or is there a problem with our configuration arrays? Thanks! |
I had exactly the same error and I was able to fix it by setting {
"layers": [{
"src": "ne_50m_admin_0_countries.shp",
"join": {
"group-by": "continent",
"export-ids": false
}
}]
} |
Same issue here. Also fixed it with the "export-ids": false workaround |
Same issue and once again it was resolved by setting "export-ids": false - is there a fix for this coming in the main repo? |
I realize this may not be a bug and is probably just a problem with the way I am trying to group these regions together, but I couldn't find any message board where I could post my question.
I am trying to create an SVG of the U.S Virgin Islands using Kartograph via the command line. I have read through the documentation multiple times and have been able to get Kartograph to produce a simple .svg file using the following json array:
However, it does not produce an .svg file when I try to create an SVG where the islands are grouped by FIPS code (one of the attributes in the .shp file using the following json array:
When I use the grouping json array, I get the following output:
There doesn't seem to be any error. But I'm also not sure what I've done wrong. I've looked through the code and not been able to figure it out. Again, this probably isn't a bug, just me not completely understanding how to use the tool. Any help would be appreciated. This is an amazing tool and will save me a lot of time if I can get it working properly. Thanks!
The text was updated successfully, but these errors were encountered: