[gdal-dev] Countour polygons instead of lines

Vincent Mora vincent.mora at oslandia.com
Thu Oct 19 05:47:36 PDT 2017


Hi Gregers,

Thanks for your reply.

The question was not "how to" yet, but "shall I" ;o)

I think I did something similar to the "ends matching" in a python
script that creates those polygons (in a particular context that also
requires tiling).

What I'd like to know, is if there is a reason why it's not already
available in gdal, since there is the need for that and apparently algos
to reach the goal.

> You cannot always make polygons with them unless you are on a perfect
island

I'm not sure I understand the that. The polygons I have in mind are
polygons with holes (multipolygons for a given class actually), is it
related to what you're saying ?


V.


Le 19/10/2017 à 14:23, Hans Gregers Hedegaard Petersen a écrit :
> Hi Vincent,
>
>> I know this is old stuff (references below), but making polygons instead
>> of lines would be a great option for gdal_contour IMO.
>>
>> It could be also another program included in gdal/app (if it is already,
>> I can't find it).
>>
>> What do you think, shall I add that ? If yes, first or second option ?
> I had a similar problem years ago, and after making consistent
> orientation [1] it is simply a matter of running through the lines and
> matching starting points with endpoints in the linestrings.  This is a
> rather fast operation on a spatially indexed dataset.
>
> You cannot always make polygons with them unless you are on a perfect
> island - for instance I processed Denmark in tiles (over 43000 tiles
> of 1x1km) and then "glued" the linestrings together afterwards. Speed
> was essential, so I first glued all linestrings in a tile (which would
> make a large number of closed linestrings), then between tiles (but
> only for those that were not yet closed).
>
>
> Cheers,
>
> Gregers
>
>
> [1]: https://trac.osgeo.org/gdal/ticket/3129




More information about the gdal-dev mailing list