[gdal-dev] Replace holes by multiple polygons

2017-02-02 Thread agerrius
Hi, I'm trying to use polygons with holes in another application that does not support the concept of holes. So my idea is to split the polygons with holes into a number of polygons, so that the same shape can be represented without using holes. Does GDAL have any functionality for this kind of p

Re: [gdal-dev] C# OGR reading OSM features "stalls"

2014-03-05 Thread agerrius
OK, I will do that. I had thought about that before, it is doesn't feel intuitive to read tens of thousands of features from a layer and then just ignore/delete them. I had hope that with the filter I could get better performance by not reading them at all. But it seems that's not how it works wi

Re: [gdal-dev] C# OGR reading OSM features "stalls"

2014-03-04 Thread agerrius
> Only set the filter on the multipolygons layer. But if I don't set any filter on the other layers I do get all other point and line features (for example highway, etc). And I don't want them, I for example only want landuse features. So I want no features to be returned from layers that don't h

Re: [gdal-dev] C# OGR reading OSM features "stalls"

2014-03-04 Thread agerrius
Even, In my actual application I am looping over all layers, but it still doesn't work. But from your feedback I now know what is going wrong. My problem is what to do with layers that don't contain the field I am filtering on. If I apply the filter to them and error is thrown (ERROR 1: 'landuse'

Re: [gdal-dev] C# OGR reading OSM features "stalls"

2014-03-03 Thread agerrius
Arno, I have made a small sample to show my problem. It uses the same OSM file as I mentioned above. Hopefully you can see what I did wrong from my code. If I read the data in non-interleaved mode it all works fine, I find 298 features on the layer: Ogr.RegisterAll();

Re: [gdal-dev] C# OGR reading OSM features "stalls"

2014-03-02 Thread agerrius
Even, No, this is not the same problem as before. With the changes we discussed before I did get the filter to work perfectly. But now when I add the do-while loop around it for the interleaved reading I get unexpected results again. I'll try to isolate the problem in a small sample program tonig

Re: [gdal-dev] C# OGR reading OSM features "stalls"

2014-03-02 Thread agerrius
Thanks for the answer. I do have a question about the interleaved mode. I have trouble to combine it with the SetAttributeFilter command on a layer. I have the impression that when the first "slice" of the interleaved reading doesn't contain any features that match the filter, that the reading sto

Re: [gdal-dev] C# OGR reading OSM features "stalls"

2014-03-02 Thread agerrius
Even, Thanks for the quick reply and the quick fix. I'm looking at implementing the interleaved reading in my code as well, since some files throw an error with the normal reading mode. Are you saying this issue will not happen with interleaved reading mode? Arno -- View this message in conte

[gdal-dev] C# OGR reading OSM features "stalls"

2014-03-02 Thread agerrius
Hi all, I'm using the OGR libraries from a C# application to read OSM data. But I have a problem now, with a certain file the reading of the features "stalls". It seems GetNextFeature() never returns anything. When I use ogrinfo -al on the same file it also seems to stall (probably at the same po

Re: [gdal-dev] OGR functionality to remove holes?

2014-01-21 Thread agerrius
Hi, Yes, that is indeed what I meant. Sorry, couldn't explain it more clear. This forum post shows a screenshot of how GlobalMapper updates the polygons to remove the holes. http://www.fsdeveloper.com/forum/showpost.php?p=613313&postcount=25 I have already implemented some logic that makes the

[gdal-dev] OGR functionality to remove holes?

2014-01-20 Thread agerrius
Hi all, Does OGR have any build in functionality to convert features with holes into features without holes? I don't mean delete the inner rings, but change the geometry so that it covers the same area with only the outer ring. I know GlobalMapper has such a function, but it would be useful if I

Re: [gdal-dev] SetAttributeFilter and OSM

2014-01-05 Thread agerrius
Thanks for checking, always good to understand why things happen as they do. One of the workarounds will do for me, so I'll use them in my application. Arno -- View this message in context: http://osgeo-org.1560.x6.nabble.com/SetAttributeFilter-and-OSM-tp5096352p5096417.html Sent from the GDA

Re: [gdal-dev] SetAttributeFilter and OSM

2014-01-05 Thread agerrius
Even, Thanks for the quick answer. I did some more testing. When using ogr2ogr it works fine indeed. When I use the ExecuteSQL it also works fine. And it seems to only fail the second time I call SetAttributeFilter. Here is some test code I use: using System; using System.Collections.Generic; u

[gdal-dev] SetAttributeFilter and OSM

2014-01-04 Thread agerrius
Hello, I'm using the GDAL/OGR libraries in a C# application and I have some trouble with the SetAttributeFilter function on an OGR layer. The filtering works fine when I load a SHP file, but when I load an OSM file it doesn't work. I still get all the features on the layer. Is this a known limita