我正在使用以 WKT 格式存储多边形的 MySQL 数据库。数据库中的许多多边形都有重复的点(例如,在下面的示例中,点 -122.323502 47.600959 重复了 3 次)。
当尝试在这些多边形上调用 RGeo::Cartesian::Factory.parse_wkt() 时,结果为零。
如何在不修改多边形数据的情况下从这些多边形创建 RGeo 对象。
poly = "MULTIPOLYGON(((-122.362163 47.618641,-122.344621 47.592555,-122.332017 47.592458,-122.32748 47.59241,-122.326109 47.592652,-122.324738 47.592895,-122.323147 47.593478,-122.321412 47.59411,-122.320826 47.594984,-122.320669 47.596296,-122.321149 47.598627,-122.323502 47.600959,-122.323502 47.600959,-122.323502 47.600959,-122.324071 47.601688,-122.320757 47.601688,-122.32073 47.604262,-122.320767 47.607663,-122.320746 47.609703,-122.320723 47.611938,-122.320714 47.612812,-122.320772 47.614075,-122.320799 47.618495,-122.362163 47.618641)))"
parsed_poly = RGeo::Cartesian::Factory.new().parse_wkt(poly)
=>nil