GDAL FlattenTo2D делает Geom нулевым - PullRequest
0 голосов
/ 08 июня 2019

У меня есть df, который имеет geoms как ogr geom в 3D.Я пытался конвертировать в 2D, но он очищает геом.

ipdb> df['default_geom'][0]
        <osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x7f83a9cb27b0> >

ipdb> df['default_geom'][0].ExportToWkt()
        'POLYGON ((-115.240767591292496 36.065560195680817 0,-115.241348136946002 36.065425084438168 0,-115.241322113923204 36.063269315122703 0,-115.240267897305003 36.063317147453262 0,-115.240208999282899 36.061408728686892 0,-115.241500777625902 36.061240907431618 0,-115.241619980337006 36.059512559015232 0,-115.242585075577907 36.059428687379608 0,-115.242674563454599 36.057736323718117 0,-115.241768917543595 36.057640168979759 0,-115.241902964798498 36.055959788158681 0,-115.238532725427604 36.05610326488739 0,-115.2381920799033 36.0615402938325 0,-115.237090968987005 36.061588194891307 0,-115.236986303475405 36.063349460793027 0,-115.239179174362903 36.063360808859777 0,-115.239134171002902 36.066013257150068 0,-115.240767591292496 36.065560195680817 0))'

ipdb> df['default_geom'][0].FlattenTo2D()

ipdb> df['default_geom'][0].FlattenTo2D().ExportToWkt()
            *** AttributeError: 'NoneType' object has no attribute 'ExportToWkt'
...