我使用的是Solr4.3.0和最新版本的JTS和spatial4j。在我的schema.xml中,我使用“location_rpt”作为字段类型,就像文档中的描述一样。Documentation
<field name="standort" type="location_rpt" indexed="true" stored="true" />现在,当我的应用程序像这样创建一个FilterQuery时
standort:"IsWithin (POLYGON((16.243972778320312 48.27016879304729, 16.411170959472656 48.268340583150504, 16.44275665283203 48.19058119922813, 16.32396697998047 48.15921534239267,16.243972778320312 48.27016879304729)))一切都很好。我的问题是,当我试图使用一个更复杂的多边形(自相交)时,Solr只显示如下错误:
org.apache.solr.common.SolrException: com.spatial4j.core.exception.InvalidShapeException: Self-intersection at or near point (16.315572194579204, 48.26688289499306, NaN)相应的查询如下所示:
standort:"IsWithin (POLYGON((16.253585815429688 48.27748097861045, 16.506271362304688 48.23427822033628, 16.418380737304688 48.18646123261718, 16.286544799804688 48.28958948415696,16.253585815429688 48.27748097861045)))"有没有什么变通方法可以让自交的多边形查询起作用?
发布于 2013-07-12 21:22:57
不,不是真的。您可以在客户端使用JTS来清理您的多边形,以便当Solr获得它时,它是有效的。请参阅http://tsusiatsoftware.net/jts/jts-faq/jts-faq.html#G
https://stackoverflow.com/questions/17613561
复制相似问题