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

Multiple-field styling? Live updates? #986

Open
mroswell opened this issue Dec 2, 2011 · 5 comments
Open

Multiple-field styling? Live updates? #986

mroswell opened this issue Dec 2, 2011 · 5 comments

Comments

@mroswell
Copy link

mroswell commented Dec 2, 2011

Is there styling in Carto across multiple data fields?
For instance:
If AgCommittee='Y' and Party="R" color Red
If AgCommittee='Y' and Part='D' color Blue
If Ag Committee is Null color white

I would imagine a syntax such as:

#Congress [AgCommittee='Y' AND Party = 'R'] {
polygon-fill: @red;
}

Or, do I need to pre-process all this in a GIS (by adding a color-by field with entries such as 'AgDem' and AgRepub'?

Related to this, if I edit a file in a GIS, for instance QGIS, is there a way to have the file updates be reflected in the currently opened TileMill.

@tmcw
Copy link
Contributor

tmcw commented Dec 2, 2011

Hey @mroswell: sure, what you're looking for is expressed in Carto as

#Congress [AgCommittee='Y'][Party = 'R'] {
polygon-fill: @red;
}

I'm not sure about your cache question offhand - I think there's some control of this, but not sure.

@mroswell
Copy link
Author

mroswell commented Dec 2, 2011

Thanks very much. I'm guessing there's a performance hit for this multifield styling. Is it significant? (Remember, the Congress file I've got is torturously slow to start with)

@tmcw
Copy link
Contributor

tmcw commented Dec 2, 2011

It'll be very, very minor - likely unnoticable. I assume you've done the normal stuff to make your data faster - reprojection & it's in a fast format?

@springmeyer
Copy link
Member

re: reflecting changes made in QGIS in TileMill - normally all that should be needed is to save the currently tilemill project. However, there is a bug/feature in mapnik that keeps, specifically, shapefile references in a cache (mapnik/mapnik#784). So, for shapefiles, getting new data in tilemill requires actually re-starting TileMill or renaming the file and reloading it as a new layer. I can understand if this is a major hassle - so we need to fix this upstream in mapnik somehow.

@mroswell
Copy link
Author

mroswell commented Dec 2, 2011

See related question: https://github.com/mapbox/tilemill/issues/989
(how to convert shapefiles to SQLite format, since that seems to be more workable data source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants