[gdal-dev] Closing disconnected contours

2013-02-25 Thread zeta
Hi,

I have shape file from sample map, consisting of topological contours. However 
many contours have small gaps and I'm looking for a pointer how to connect 
those lines, automatically.
Does ogr have a method or maybe more generally does anyone know of a tool, that 
would correctly close disconnected contours, which aren't labeled?
Gaps are small - artifacts from graticules present in original image used as 
source for creating this vector.

Thanks

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


Re: [gdal-dev] Closing disconnected contours

2013-02-25 Thread Chaitanya kumar CH
zeta,

The gaps are likely caused by pixels with no data. A simple method is to
run gdal_fillnodata.py on the original raster and then create the contours.

http://www.gdal.org/gdal_fillnodata.html



On Mon, Feb 25, 2013 at 1:01 PM, zeta ot...@hush.ai wrote:

 Hi,

 I have shape file from sample map, consisting of topological contours.
 However many contours have small gaps and I'm looking for a pointer how to
 connect those lines, automatically.
 Does ogr have a method or maybe more generally does anyone know of a tool,
 that would correctly close disconnected contours, which aren't labeled?
 Gaps are small - artifacts from graticules present in original image used
 as source for creating this vector.

 Thanks

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




-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Closing disconnected contours

2013-02-25 Thread Chaitanya kumar CH
zeta,

Are the lines in topo.tif contour lines? How did you generate them?


On Tue, Feb 26, 2013 at 12:20 AM, zeta ot...@hush.ai wrote:

 Chaitanya kumar CH wrote:
 
 zeta,
 
 The gaps are likely caused by pixels with no data. A simple method is to
 run gdal_fillnodata.py on the original raster and then create the
 contours.
 
 http://www.gdal.org/gdal_fillnodata.html

 Thanks Chaitanya,

 that's excellent news, as I previously searched for algorithms about curve
 reconstruction, and none seemed easy for implementation. I was driven by
 approach using Delaunay Triangulation,  referenced to Amenta The crust and
 the beta -skeleton: Combinatorial curve reconstruction and plastically
  explained i.e. here:
 http://valis.cs.uiuc.edu/~sariel/research/CG/applets/Crust/Crust.html but
 I thought to look for shortcut if possible, without reinventing
 implementation.

 I tried the script, and I get some gaps filled, but most aren't. I used
 -md parameter of 20px, but changed that value from 10 to 300 without
 significant improvement. Then I used mask file, which I assume works as in
 OpenCV Inpaint function, by using mask as a helper for gap detection, but
 without success.

 I'm attaching example image, and mask image, which I used to test the
 script, in a hope that someone can tell me if better results are possible.

 Thanks




-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Closing disconnected contours

2013-02-25 Thread zeta
Chaitanya kumar CH wrote:

Are the lines in topo.tif contour lines? How did you generate them?


Hi Chaitanya,

I segmented scanned image, and then did thinning on separation that interested 
me - that is topo contours. Here is link to a part of scanned image that I used 
as example: http://i.imgur.com/Wyv147m.png

I thought also that maybe gdal_fillnodata.py doesn't like thinning (1px 
contours) and I did dilation on same image to get topo contours with 3px width, 
but result was worse.
Did I expected too much, or maybe my image wasn't prepared corectly for gdal 
algorithm used in gdal_fillnodata.py?

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


Re: [gdal-dev] Closing disconnected contours

2013-02-25 Thread Chaitanya kumar CH
zeta,

gdal_fillnodata is intended for raster images, like a DEM. Your image is a
rendered map.
The image you provided is not suitable for unsupervised processing,
especially with GDAL.


On Tue, Feb 26, 2013 at 12:53 PM, zeta ot...@hush.ai wrote:

 Chaitanya kumar CH wrote:
 
 Are the lines in topo.tif contour lines? How did you generate them?


 Hi Chaitanya,

 I segmented scanned image, and then did thinning on separation that
 interested me - that is topo contours. Here is link to a part of scanned
 image that I used as example: http://i.imgur.com/Wyv147m.png

 I thought also that maybe gdal_fillnodata.py doesn't like thinning (1px
 contours) and I did dilation on same image to get topo contours with 3px
 width, but result was worse.
 Did I expected too much, or maybe my image wasn't prepared corectly for
 gdal algorithm used in gdal_fillnodata.py?




-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Closing disconnected contours

2013-02-25 Thread zeta
Chaitanya kumar CH wrote:

gdal_fillnodata is intended for raster images, like a DEM. Your image is a
rendered map.
The image you provided is not suitable for unsupervised processing,
especially with GDAL.

OK than, Chaitanya, thanks for letting me know.

Cheers

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