Jump to content

 
Photo

Closing topological lines with gaps

- - - - -

  • Please log in to reply
11 replies to this topic

#1
zetah

zetah

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • No Country Selected

Hi,

 

I've made a scan from topological map, which I segmented on color to get topo contours, and then did thinning.

 

Here is source map:

 

and this is separation result:

 

As can be seen, contours are disconnected on places where various labels, additional lines and graticules were overlayed.

 

Does someone know of a way how to connect this gaps?

 

 

Thanks



#2
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,888 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

FME could do it, there's a Snapper transformer. However, if you don't have the proper elevation attributes attached to every line, there's no guarantee you won't end up with a big mess. I think you could do the same in ArcGIS and probably QGIS as well, but again, if you don't have those attributes chances are you'll need to spend time checking and editing the results.

 

Also, your gaps are fairly large (relative to the spacing of the contour lines). This is going to cause either ugly lines, or artefacts if you use this data to create a DEM.


Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#3
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

As Hans said, without the proper elevation attached to the lines, there's not much you can do (or guaranty anything will work). Also, with the process you describe, you only have a raster representation of the line. 

 

If you manage to extract the lines, with elevations, you could just extract the z-value of the vertices and create a new model. The gaps will be extrapolated. 

 

Nonetheless, I'm pretty sure your data need cleaning to. You have some perpendicular lines that can't be topo contours.



#4
zetah

zetah

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • No Country Selected

Thanks for your replies

 

I can label the lines with Z value, but the process will take the same amount of time as closing the gaps manually. If I had Z values I'd close the lines with gdal script.

 

I've also read about curve reconstruction algorithms, but they aren't that easy for me to be implemented from ground up, and I'm looking around if anyone made them publicly and embedded in some tool. From papers I've read discussing this problem, most accurate results are reported by using the properties of Voronoi diagrams vertices and Delaunay triangulation for detecting contours and closing the gaps, and I hoped I don't have to reinvent implementation.


Edited by zetah, 27 February 2013 - 06:44 AM.


#5
david17tym

david17tym

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 103 posts
  • Gender:Male
  • Location:North Wales
  • United Kingdom

ET Geowizards (Clean Contour Gaps) for ArcGIS is another (semi-automated) option,

but as Hans and Francois have noted, you'd need to attribute the lines with an elevation

and clean out the non-contour detail first to minimize further processing.



#6
zetah

zetah

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • No Country Selected

David thanks for your suggestion

I did try that tool, but reconstruction algorithm is poor for unlabeled data as my source is, because it reconstructs gaps on minimal distance base, which is simplest possible approach I guess and can't be used in my case.

I'm really surprised that there is no publicly available tool, as this task doesn't seem to me like an obscure process. But then I'm not a cartographer to know.



#7
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

Without elevation, there's no way to know which line end to connect to which other. 

 

With only vector and no elevation, it could be possible to search for endpoints and look if there's another endpoint near and connect them, but I doubt the result would be really great.

 

Your data still need a lot of cleaning (you can't have intersecting contour) and you have a lot of them in the upper left of your sample. 

 

Contour line should pass behind the stream in that area. You also have something like a dashed symbol or contour not connected to anything else and that's impossible.



#8
rudy

rudy

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 747 posts
  • Gender:Male
  • Location:Canada
  • Canada

Of course, this all assumes that the original publisher of the topographic map has provided you with the permission to extract and use the contour information. Or maybe you're hoping that they won't notice . . . .



#9
zetah

zetah

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • No Country Selected

Thanks Francois I should clean segmented bitmap of course, and acceptable connection should be possible without any knowledge about z-value or else nor caring about gap size or curve density. As I mentioned, there are couple of reliable methods reported, some dating decades ago. Here is for example one method, I noted above: http://iparla.inria....04/SG04/K13.pdf On paper, there are also methods by using b-splines, FEMs or some most obvious ideas if you think about this problem as: - do spline fit on existing lines and connect all gap points within certain radius, - find some sweet spot depending on connected curves direction angle and connection line direction angle - decide which connection line to keep This is simple enough, but why can't similar method be found in GIS software? Even GIS flagship gdal doesn't offer such functionality, not mentioning expensive commercial applications like ArcGIS (to try it, I had to contact friend to get access, as I surely can't afford the license) OTOH, if I should look in image processing tools I have to choose something robust enough as curve reconstruction is such niche. I plan to go with Python, if I can't find ready-made tool.

#10
zetah

zetah

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • No Country Selected

Rudi, thanks for your concerns. Maps are owned by institute (of meteorology) I work for. These are old maps, and new more accurate data is also available to me without any restrictions. If you are curious, I'm doing a personal project, and I want to demonstrate "something" if I succeed in making it DEM.

#11
Charles Syrett

Charles Syrett

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 537 posts
  • Canada

Potential copyright issues aside, why not just draw the contours? It's faster and easier than you might think. Of course, if your map area is considerably larger than the sample you've posted, then maybe drawing would take too long.


Charles Syrett
Map Graphics
http://www.mapgraphics.com



#12
rudy

rudy

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 747 posts
  • Gender:Male
  • Location:Canada
  • Canada

Automation is the way to go, especially if you are dealing with multiple tiled sheets.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->