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

kartograph svg map is empty when using “polygons” bounds mode #101

Open
rccc opened this issue Mar 22, 2014 · 0 comments
Open

kartograph svg map is empty when using “polygons” bounds mode #101

rccc opened this issue Mar 22, 2014 · 0 comments

Comments

@rccc
Copy link

rccc commented Mar 22, 2014

I 'm trying to generate svg maps from the GEOFLA shapefiles ( files are listed in the "Téléchargements" tab ).

Using 'bbox' bounds mode with manually setting the bbox values works well :

{
    "layers": [{
        "id": "depts", 
        "src": "data/DEPARTEMENTS/DEPARTEMENT.shp",
        "filter": {"CODE_REG": "24"},
        "simplify": {
            "method": "distance",
            "tolerance": 8
        },
        "attributes": "all"
    }],
    "bounds": {
        "mode": "bbox",
        "data": [-4.5, 42, 8, 48],
    },
    "export": {
       "width": 600,
       "ratio": 0.8
    }
}

But when setting the bounds mode to 'polygons', then i get an empty svg map :

{
    "layers": [{
        "id": "depts", 
        "src": "data/DEPARTEMENTS/DEPARTEMENT.shp",
        "filter": {"CODE_REG": "24"},
        "simplify": {
            "method": "distance",
            "tolerance": 8
        },
        "attributes": "all"
    }],
    "bounds": {
        "mode": "polygons",
        "data": {
            "layer": "depts"
        },
        "padding": 0.06
    },
    "export": {
       "width": 600,
       "ratio": 0.8
    }
}

I had a look in kartograph files and i noticed that the "get_features" method in "map.py" return a Polygon which coordinates doesn't intersect with the features geometry previouly extracted from the shapefile.

Then, each feature are throw away in the "get_features" method of the "maplayer.py" file when checking if feature geometry intersects with the "layer.map.view_poly" property.

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

1 participant