We are using Mapnik for data mapping of demographic data and are having a bit of a problem with the placement of Alaska's label for our State shapefile (it's showing up in California!). I think it may be a problem in the shapefile, but I don't know how to fix it. I've been a developer for quite some time, but I'm new to the GIS world.
  1. When displaying the shapefile in Quantum GIS, it is displayed correctly: Quantum GIS.png
  2. When displaying the shapefile using Mapnik, the label is in CA: Mapnik.png
  3. I could provide the shapefiles we are using -- these are based on public shapefiles, but were edited by a GIS guy (primarily moving AK, HI, PR and merging polygons so that we get a single label per state).
  4. We are using mapnik in a C++ dll (see code snippet below). 

The label was positioned correctly in Mapnik before the GIS guy merged polygons.

I spent a bunch of time reading forums. I found a suggestion on http://lists.berlios.de/pipermail/mapnik-users/2011-July/004437.html to use placement="interior", however, in C++ I don't see any Interior options for set_label_placement.

Any suggestions what I should change on my side or how to track down the problem in the shapefiles?

Thanks,
Ellis Miller


Code snippet for setting labels:

rule_type vTextRule;
text_symbolizer vTextSymbolizer((LPCTSTR)sColumnInDBFForShowLabel, (LPCTSTR)sFontName_c, iFontSize, color(0, 0, 0));
vTextSymbolizer.set_avoid_edges(true);
vTextSymbolizer.set_label_placement(POINT_PLACEMENT);
vTextRule.append(vTextSymbolizer);

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to