Fitting place names into map shapes
Posted
by Old Man
on Stack Overflow
See other posts from Stack Overflow
or by Old Man
Published on 2010-05-28T12:46:17Z
Indexed on
2010/05/28
14:52 UTC
Read the original article
Hit count: 177
I'm drawing shapes using GDI+ using a list of lat/lon floats, and I need to place the name of the place within the borders of the polygon. Simply centering the text in the bounding rectangle doesn't work for irregular shapes. I have the text and the font so I can get the size of the rectangle that the text will need to fit in, but at that point I'm stuck.
This seems like a common problem that all mapping software solves, as well as the kind of thing you would find in an algorithm or computer graphics textbook.
So, given a list of floats for a polygon and a rectangle, is there a way to get the best possible point to place the text, using: 1) GDI+; 2) SQL Server Geospatial; or 3) c# code (or c, pseudocode, etc)
© Stack Overflow or respective owner