[mapserver-users] Rendering Challenges

Brent Fraser bfraser at geoanalytic.com
Mon May 9 17:17:33 EDT 2011


Steve W.,

   The reason I'd like to minimize any pre-processing is that NRCan 
publishes about 30 GB of shapefiles for the map series.  And they 
publish a complete new version of these every 6 months.  Currently I 
build tileindexes, and I expect I'll have to do other pre-processing 
steps to get the rendered output I'd like.  The answer may be to load 
the data into PostGIS (every 6 months) and use its functions to make the 
data suitable for Mapserver.  Maybe not.

   I've been thinking about a pre-processing commandline utility based 
on OGR and the GEOS functions it supports (and other functions it will 
hopefully support in the future).  One thing  I have to do is a 
LineMerge on the rivers shapefile so they will label in Mapserver.  
Currently a river will have many short segments broken at every 
tributary preventing any segment to be long enough to support a label.

   Having a separate pre-calculated shapefile for polygon annotation 
might get me closer to my goal.  Dunno about the impact of having to 
support any arbitrary scale the user may view the map...  NRCan's 
cartographers have it easy; they just have to render the data a one 
scale!  And since it is [just] basemap data I suppose I could use Mapnik 
to render tiles, but that feels wrong.  I'd much rather help to improve 
Mapserver.

   As for the "erasing of lines", I want just the contour lines under 
the label not to be drawn.  I've used OUTLINECOLOR in the past but have 
been unhappy with the results (segments visible between characters, 
other features erased).  I suppose the lines could be clipped to the 
bounding boxes of the contour labels, but due to the potentially curved 
nature of the contour labels I think the clipping polygons would have to 
be something like the convex hull of the character boxes.

Best Regards,
Brent Fraser


On 5/9/2011 2:30 PM, Stephen Woodbridge wrote:
> Brent,
>
> I think this is an excellent list of features that we should strive to 
> support in mapserver. I here that you ideal stated goal is to use the 
> files as published, but as a close alternative I can see that having a 
> utility to preprocess the files might make implementation faster and 
> and more consistent. This thought is based on some simple ideas:
>
> 1. what is inside/outside of a polygon? While we can compute this for 
> every polygon on every draw, I do not think we want to do that, so 
> having a preprocessor that standardizes polygon node ordering would 
> avoid this.
>
> 2. polygon label point and orientations. It would be nice to have a 
> utility, or the one above, that can do some basic analysis of a 
> polygon and pick the ideal label point and orientation. This then 
> might create a companion label point shapefile or add additional 
> attribute columns for this purpose. This approach also has the benefit 
> that you could then edit the label point file to override the 
> automatically generated point.
>
> I think these two items would greatly increase our ability to 
> implement in a consistent manner items 1, 2, 3, and 4.
>
> On 5/9/2011 3:51 PM, Brent Fraser wrote:
>> While testing v6, I can up with the following list of things I couldn't
>> do (see http://i56.tinypic.com/8vvprn.png for a graphic):
>>
>> 1. Render lines inside polygon boundary (with or without opacity)
>> 2. Place polygon annotation on/inside boundary line
>> (http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
>> 3. Rotate anno if required to fit inside a polygon
>> 4. Place polygon annotation outside polygon if anno doesn't fit inside
>> 5. Place line anno above (or below) when using ANGLE FOLLOW
>> 6. Rotate vector symbols to follow lines (a font might work but is a
>> pain to create)
>> 7. User specified character spacing
>> 8. Erase lines (but not other objects) under annotation
>
> For this one, do you want to erase ALL lines or just suspend drawing 
> the line of the object being labeled? If you truely want to erase all 
> lines, then you have to define what is a line! antialiased? wide 
> lines? how is a line different from the highlighted edge of a polygon? 
> or a line that has been drawn as a wide street with shoulders and a 
> centerline?
>
> Currently we support drawing a multi-pixel halo around the text the in 
> effect erases/replaces everything under the halo.
>
> I like your example image as a great use case.
>
> Thanks,
>   -Steve
>
>>
>> My goal was to use the published shp files
>> (http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip) 
>>
>> without modification and see how close I could get to the published PDF
>> (http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip). 
>>
>>
>>
>> Any suggested rendering techniques are appreciated. I'll file tickets
>> for those problems deemed worthy.
>>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



More information about the mapserver-users mailing list