Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Extend TextSymbolizer "spacing" parameter to apply to polygons #131

Open
artemp opened this Issue · 15 comments

5 participants

@artemp
Owner

I'm thinking in particular of things like very large parks / open spaces, where a single label in the center of the area is difficult to spot. I see that TextSymbolizer has a spacing parameter, but it's my understanding that this applies only to line placement. In a perfect world, the "spacing" parameter would work for polygons as well as lines, perhaps arranging labels in a honeycomb pattern.

@artemp
Owner

[springmeyer] Also see Ticket #152

@artemp
Owner

[springmeyer] pushing to 0.7.0 since it is an enhancement

@artemp
Owner

[springmeyer] I plan to take a look at this after we can get the 0.7.1 release tested and out in the wild.

@artemp
Owner

[springmeyer] See also #443 (closing as dupe there)

@artemp
Owner

[springmeyer] we could potentially leverage quasi-random sequences: http://en.wikipedia.org/wiki/Halton_sequence

@springmeyer
Owner

had a patch against mapnik 0.7.1 I wrote a long time ago that used halton sequences for natural but sparse looking distribution of text labels polygon, but this could also be used to arrange and place something like tree icons in a park. I just need to find it on an old harddrive.

note to self when I dig up this patch and test again: make sure not to clip icons if they fall along polygon edge: http://blogs.esri.com/Support/blogs/mappingcenter/archive/2012/02/08/marker-fill-symbols-add-realism-to-your-maps.aspx (/cc @nvkelso)

@rory

@springmeyer Have you found the code? This is a topic/feature I'm interested in. I'd be willing to help with my (rusty & poor) C++ skills, if there's some sort of a guide...

@springmeyer
Owner

@rory - found the code and updated to latest master: https://gist.github.com/4221816. This is really nothing more that experimental. Long term we'd need to find a way to make the points a bit more random, there would need to be a well named new placement type to trigger this, and some kind of density parameter (or better auto-density code). Also, the point generator would need to be ported to become a conv type in the vertex_converters. And lastly this should be supported in the markers symbolizer, not points, since point symbolizer will likely be removed at some point in favor of markers.

@springmeyer
Owner

also /cc @bflood as I know he was interesting in Mapnik providing dot-density via styling parameter.

@bFlood

thanks @springmeyer, I'm interested in everything in this thread. cheers

@rory

Cool thanks, I'll have a look

@sainsb

This is a burning pain point for me/my agency. There is a huge audience of ArcGIS users that would like to use this for cartography and tiling but having to create a separate layer of randomly distributed points in order to sprinkle labels around a large polygon is pretty much a showstopper brickwall. Not sure if @bflood has found a workaround with A2E...but...yeah...just casting my vote.

@springmeyer
Owner

@darthNachos - one way to help give life to this would be to provide some samples/screenshots from ArcGIS that you think look good and show off the feature well. Since I don't use ArcGIS I can only guess at what might look ideal.

@springmeyer springmeyer was assigned
@sainsb

Since I don't use ArcGIS I can only guess at what might look ideal.

?? What you wrote earlier seemed right on the money:

natural but sparse looking distribution of text labels.

In order that once the user zooms deep inside a large polygon they will still see labels here and there.

It sounds like ArcGIS uses a 4096 supertile for label repetition but I obv. don't know what algorithm they use to label.
thanks.

@springmeyer springmeyer removed this from the Mapnik 2.3.0 milestone
@springmeyer springmeyer added the post3x label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.