[gdal-dev] How to concatenate with newlines by using OGR SQL?
Chaitanya kumar CH
chaitanya.ch at gmail.com
Tue Jul 31 00:16:27 PDT 2012
You can try to pass the newline character directly from the command line.
With bash, you can use $'\n'. In your case it will be like this:
ogr2ogr -f gpx test.gpx finland.osm.pbf
-sql "select name,CONCAT(addr_street,"$'\n'",addr_housenumber)
as 'desc' from points where amenity='toilets'"
On Tue, Jul 31, 2012 at 12:09 PM, Jukka Rahkonen
<jukka.rahkonen at mmmtike.fi>wrote:
> I was playing with the new OSM driver and tried to transfer some
> POI features into my GPS. It goes well by using GPX format in
> between. However, I have a little problem. My GPS supports multiline
> descriptions but I do not know how to insert newlines into the
> output of ogr2ogr. The following command adds a space character
> between addr_street and addr_housenumber, but is is somehow possible
> to insert newline instead?
> ogr2ogr -f gpx test.gpx finland.osm.pbf
> -sql "select name,CONCAT(addr_street,' ',addr_housenumber)
> as 'desc' from points where amenity='toilets'"
> I made two blind trials as
> CONCAT(addr_street,\n,addr_housenumber) which gives parsing error and
> CONCAT(addr_street,'\n',addr_housenumber) which adds string \n literally.
> -Jukka Rahkonen-
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
Chaitanya kumar CH.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev