OGR WRAP character

Frank Warmerdam fwarmerdam at GMAIL.COM
Thu Jul 7 17:54:10 EDT 2005


On 7/7/05, Julien-Samuel Lacroix <jlacroix at dmsolutions.ca> wrote:
> Hi All,
> I guess this is more for Frank, but it can interest other people.
> 
> MapInfo files have a way to indicate that there's a new line in labels.
> They stock the character 10 internally (a \n) for the TAB format.
> Normally in a MapServer mapfile we would put WRAP "&#10;" in our LABEL
> definition t have multiple lines. However, OGR (read: the MITAB driver)
> convert all '\n' into a '\' and a 'n' and all '\' into '\\'. This is to
> get a readable StyleString I guess. Also, the spec of the MapInfo MIF
> format says that it stores the new line character as a '\' and a 'n'
> (two characters).
> 
> This cause a problem in the MapServer context where the WRAP keyword
> takes only one character. With any MapInfo files, the multiline text
> can't be multiline because of this \n issue.
> 
> My questions:
> Does other OGR drivers have this kind of problem? Or is MITAB a special
> case?
> Is there a unified way to return the end of line in strings? Or should
> be there one unified way?
> In any case, the MIF file format two characters is still an issue, but
> maybe it's not used enough to worth any change...
> 
> Possible solutions:
> - Modify MapServer to get all the '\'+'n' characters that comes from OGR
> strings converted into "\n" (LF). Via the PROCESSING keyword maybe.
> - Modify The WRAP keyword to accept string. This will enable any strings
> to be wrapped on multiple characters. Anyone beside me is interested in
> this?
> - Modify MITAB to return "\n" in it's StyleString. But I don't know how
> much impact it can have on the library and it does not fix the MIF file
> issue.

Julien, 

My first thought is that the MITAB driver should not be turning char-10
into escaped \n format.  The \n character is legal (though possibly 
occationally a nuicance) in attribute values and I don't think most other
drivers fool with special characters like this. 

Since Daniel "owns" MITAB you guys are welcome go ahead to a
change to the behavior if you are comfortable with it, though it might
be nice to raise the issue on the mitab mailing list. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-dev mailing list