Skip to content

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

Open
artemp opened this Issue Oct 11, 2011 · 15 comments

5 participants

@artemp
Mapnik member
artemp commented Oct 11, 2011

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
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] Also see Ticket #152

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] pushing to 0.7.0 since it is an enhancement

@artemp
Mapnik member
artemp commented Oct 11, 2011

[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
Mapnik member
artemp commented Oct 11, 2011

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

@artemp
Mapnik member
artemp commented Oct 11, 2011

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

@springmeyer
Mapnik member

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
rory commented Dec 4, 2012

@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
Mapnik member

@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
Mapnik member

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

@bFlood
bFlood commented Dec 6, 2012

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

@rory
rory commented Dec 7, 2012

Cool thanks, I'll have a look

@sainsb
sainsb commented Sep 4, 2013

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
Mapnik member

@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 Sep 5, 2013
@sainsb
sainsb commented Sep 10, 2013

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 Aug 12, 2014
@springmeyer springmeyer added the post3x label Aug 12, 2014
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.