Scale-dependent rendering
While they are not specifically for web services, being able to change the styling and presence of data based on the scale of the map can have a huge impact on the speed and readability of web services. Unlike printed maps, web maps are viewed at multiple scales. This variation in scales often requires different cartography to keep the map legible and usable.
Getting ready
You'll need a QGIS project, preferably one with a high data density or differing levels of information. A good example is road data, where you have major, minor, local, and other variants of road classification. caryStreets.shp
converted from CAD in a previous chapter is a good example.
How to do it…
Open QGIS and load
caryStreets.shp
.Now, open the attribute table and look for an attribute to filter in. In
caryStreets.shp
, there are several potential columns to use, such asStreetType
,Major_Road
, andMain_Road
.Note
StreetType
appears to be classes, whereas the other two columns appear to beTrue
...