[ https://issues.apache.org/jira/browse/LUCENE-8133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16334344#comment-16334344 ]
Karl Wright commented on LUCENE-8133: ------------------------------------- One thing to note is the javadoc for createGeoPolygon(): {code} /** Create a GeoPolygon using the specified points and holes, using order to determine * siding of the polygon. Much like ESRI, this method uses clockwise to indicate the space * on the same side of the shape as being inside, and counter-clockwise to indicate the * space on the opposite side as being inside. * @param pointList is a list of the GeoPoints to build an arbitrary polygon out of. If points go * clockwise from a given pole, then that pole should be within the polygon. If points go * counter-clockwise, then that pole should be outside the polygon. * @return a GeoPolygon corresponding to what was specified. */ {code} In other words, the behavior is quite different depending on the order the points come in. The code considers the order to determine the "pole" -- that is, the point that's actually within the polygon. Here are the points in the test case: {code} + points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(-23.434456), Geo3DUtil.fromDegrees(14.459204))); + points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees( -23.43394), Geo3DUtil.fromDegrees(14.459206))); + points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(-23.434196), Geo3DUtil.fromDegrees(14.458647))); + points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(-23.434452), Geo3DUtil.fromDegrees(14.458646))); {code} My guess is that the "pole" chosen for this ordering is in the part of the sphere that is "everything but" the polygon that was intended. That *should* work nevertheless. > Small polygon fails with misleading error: Convex polygon has a side that is > more than 180 degrees > --------------------------------------------------------------------------------------------------- > > Key: LUCENE-8133 > URL: https://issues.apache.org/jira/browse/LUCENE-8133 > Project: Lucene - Core > Issue Type: Bug > Components: modules/spatial3d > Reporter: Ignacio Vera > Assignee: Karl Wright > Priority: Major > Attachments: LUCENE-8133.patch, image-2018-01-22-12-52-21-656.png, > image-2018-01-22-12-55-17-096.png > > > Hi [~karl wright], > I am trying to create a polygon that is valid but I am getting an error which > is probably incorrect. I think it is a problem with precision. > I will attach a test. > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org