Questions tagged «attributeerror»

1
arcpy.geometry __geo_interface__和AsShape()函数:精度和孔的损失
我正在将arcpy几何序列化为geojson,以便以后可以将它们“水化”为几何形状,并且在周期中遇到两个问题: 问题1:精度 R0 = arcpy.SearchCursor(self.shpTest, "FID=0").next().getValue("Shape") geojson = R0.__geo_interface__ R1 = arcpy.AsShape(geojson) self.assertTrue(R0.equals(R1)) <<< THIS FAILS 如果我检查字符串表示形式,则坐标略有变化: geojson2 = R1.__geo_interface__ print geojson print geojson2 {'type': 'Polygon', 'coordinates': [[(442343.5516410945, 4814166.6184399202), (442772.17749834526, 4811610.7383281607), (441565.67508534156, 4811499.6131059099), (440772.50052100699, 4814184.7808806188), (442343.5516410945, 4814166.6184399202)]]} {'type': 'Polygon', 'coordinates': [[(442343.55169677734, 4814166.6185302734), (442772.17749023438, 4811610.73828125), (441565.67510986328, 4811499.6130981445), (440772.50048828125, 4814184.7808837891), (442343.55169677734, 4814166.6185302734)]]} …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.