[gdal-dev] converting lines to linestrings
jluis at ualg.pt
Sat Aug 27 12:52:49 EDT 2011
On 27-08-2011 17:27, Frank Warmerdam wrote:
> On 11-08-27 02:10 AM, Zoltan Szecsei wrote:
>> I'm not sure if this is the correct list to address this on, but ....
>> I have lots of files, each with a bunch of lines that start & stop on
>> others ends and I need to convert them into line strings, file by file.
>> Is there a command-line (batch) way I can do this?
>> They are currently in DGN (v8) format but I can convert them to SHP,
>> MID/MIF or
>> What I'm looking to do is to create a batch pipeline that, file by
>> file, will
>> take each line, and if either of its ends are within 0.5m of another
>> then join them together to form one line string, then output that
>> "snapped up"
>> data to disk. (any format)
> I do not believe you can accomplish this with ogr2ogr. But it is
> possible to write a script, for instance in python, that would accomplish
> this in combination with the OGR API. That is the approach I would take.
The GMT program 'gmtstitch' will do just that but you will have to
convert the DGN files to gmt with ogr2ogr
More information about the gdal-dev