Selon Luca Delucchi <[email protected]>: > Hi everybody, > > I created a script to filter some lidar data, and It worked perfectly > some weeks ago. > Now I have to run with different data but I obtain the following error > when I try to overlaps two geometry. > > ERROR 1: IllegalArgumentException: Points of LinearRing do not form a > closed linestring > > The code that I'm using is something similar to this > > import osgeo.ogr as ogr > import osgeo.osr as osr > # this is the input vector file to read the features for filter the lidar > point > inDatasource = ogr.Open('/incoming/james_lidar.json') > inLayer = inDatasource.GetLayer() > inFeature = inLayer.GetFeature(0) > geom = inFeature.geometry() > geom.ExportToWkt() > 'POLYGON ((661300 5115700,661300 5117600,662300 5117600,662300 5115700))' > # this is the polygon of a lidar tile bounding box > wkt = 'POLYGON((660000 5116000,660000 5118000,661793 5118000,661793 > 5116000,660000 5116000))' > poly = ogr.CreateGeometryFromWkt(wkt) > geoms.Overlaps(poly) > ERROR 1: IllegalArgumentException: Points of LinearRing do not form a > closed linestring > > What I'm doing wrong?
Just as suggested by the error message, your polygon is not closed. You must repeat the first point as last point to form a valid polygon. > > -- > ciao > Luca > > http://gis.cri.fmach.it/delucchi/ > www.lucadelu.org > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev > -- Spatialys - Geospatial professional services http://www.spatialys.com _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
