making efficient map layers
woodbri at SWOODBRIDGE.COM
Wed Mar 23 21:26:57 EST 2005
Mark Dieterich wrote:
> I'm really impressed with the maps on the imaptools site, hope you don't
> mind a few prodding questions from a mapserver newbie...
Thank you, it is an ongoing project. The mapfile has 45 layers and about
1900 lines in it. I recommend that you keep it simple, get the basic
logic of the mapfile working with the zoom levels you need. Some of the
mapfiles I have built have had over 150 layers in them and it gets very
hard to keep it all straight.
> - Does your site actually use some form of generalized layer when zoomed
> out? If so, can you tell me at what point you switch from generalized
> maps to shapefiles, it seems really seemless.
I switch at 150000 scale so below that it is Tiger and it is my own
generalized Tiger layer above that.
> - How do you go about changing the width of the different types of
> roads? I assume each class of road is in a different layer and you
> somehow manipulate the line width?
In your class for the roads do something like this:
STYLE # first draw a 5 pixel wide green line
SYMBOL 0 # built in circle symbol
COLOR 0 255 0 # green
STYLE # then draw a 3 pixel wide white line on top of the green
SYMBOL 0 # that leaves a 1 pixel border on each side of the white
COLOR 255 255 255 # white
STYLE # then draw a 1 pixel wide black line down the center
COLOR 0 0 0 # black
You can create your own symbols to do dashed lines, put arrows on lines,
create railroad dual tracks with cross ties, etc.
> - Is there any speed reason to split types of roads, based on the CFCC
> type, into different shapefiles or is it just as good to use shp2tile
I split them because there are a lot of A4* streets and I can avoid
using a CLASS EXPRESSION if they are all in their own shapefile which is
> and then a tileindex? On a side not, is it possible to throw a wildcard
> at ogr2ogr, where by you can specify something likek ogr2ogr dst.shp
> src.shp -where CFCC=A1*? I couldn't figure out if it could take
> wildcards or not. I suppose you could go through and run it for each
> A1* type and append it to the shapefile, but this could be a long process.
Great question, I will leave this for the ogr experts to answer because
I haven't a clue.
> I'm working on familiarizing myself with the National Map offerings and
> will probably have some more questions for you.
More information about the mapserver-users