[gdal-dev] converting lines to linestrings

2011-08-27 Thread Zoltan Szecsei

Hi,
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 
each 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 whatever.


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 line-end, then join them together to form one line string, then 
output that "snapped up" data to disk. (any format)


TIA,
Zoltan

--

===
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
P.O. Box 7, Muizenberg 7950, South Africa.

65 Main Road, Muizenberg 7945
Western Cape, South Africa.

34° 6'16.35"S 18°28'5.62"E

Tel: +27-21-7884897  Mobile: +27-83-6004028
Fax: +27-86-6115323 www.geograph.co.za
===

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] converting lines to linestrings

2011-08-27 Thread Frank Warmerdam

On 11-08-27 02:10 AM, Zoltan Szecsei wrote:

Hi,
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 each
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
whatever.

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 line-end,
then join them together to form one line string, then output that "snapped up"
data to disk. (any format)


Zoltan,

I do not believe you can accomplish this with ogr2ogr.  But it is certainly
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.

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

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


RE:Re: [gdal-dev] converting lines to linestrings

2011-08-27 Thread patrickwild




Sent from my Verizon Wireless 4GLTE smartphone.


 From : Frank WarmerdamSubject : Re: [gdal-dev] converting lines to linestrings On 11-08-27 02:10 AM, Zoltan Szecsei wrote:> Hi,> 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 each> 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> whatever.>> 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 line-end,> then join them together to form one line string, then output that "snapped up"> data to disk. (any format)Zoltan,I do not believe you can accomplish this with ogr2ogr.  But it is certainlypossible to write a script, for instance in python, that would accomplishthis in combination with the OGR API.  That is the approach I would take.Best regards,-- ---+--I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.comlight and sound - activate the windows | http://pobox.com/~warmerdamand watch the world go round - Rush    | Geospatial Programmer for Rent___gdal-dev mailing listgdal-dev@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/gdal-dev

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] converting lines to linestrings

2011-08-27 Thread Joaquim Luis

On 27-08-2011 17:27, Frank Warmerdam wrote:

On 11-08-27 02:10 AM, Zoltan Szecsei wrote:

Hi,
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 
each

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

whatever.

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 
line-end,
then join them together to form one line string, then output that 
"snapped up"

data to disk. (any format)


Zoltan,

I do not believe you can accomplish this with ogr2ogr.  But it is 
certainly

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.



Hi,

The GMT program 'gmtstitch' will do just that but you will have to 
convert the DGN files to gmt with ogr2ogr


Joaquim
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev