[jira] [Updated] (LUCENE-7970) Improve generation of circle plane
[ https://issues.apache.org/jira/browse/LUCENE-7970?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ignacio Vera updated LUCENE-7970: - Attachment: LUCENE_7970.patch Hi [~karl wright], Not sure if we have something to do here as I think current implementation might be the best one to approximate the circle using one plane intersecting the spheroid. I don't think I can assure that any other implementation would be more precise. Anyway, I was thinking what is needed to support circles in a spheroid and of course it needs a totally different approach and eventually in some cases you need to use brute force. I want to share what I think it would be a viable solution if Geo3d ever needs to add precision to circles in spheriods like WGS84: The new shape should have two planes: innerElipse: plane cutting the spheriod producing the maximum ellipse within the circle. Anything within this plane is within the circle. outerElipse: plane cutting the spheriod producing the maximum ellipse contaning the circle. Anything not within this plane is not within the circle. There is only one gray area between the two planes (within outerEllipse, not within innerEllipse) where brute force will be needed. I attach my implementation for such a shape. It seems to work for WGS84, except for verly large and very small angles. I was unable to find the mathematical model to generate those planes (is that possible to solve mathematically?). Thanks! > Improve generation of circle plane > --- > > Key: LUCENE-7970 > URL: https://issues.apache.org/jira/browse/LUCENE-7970 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/spatial3d >Reporter: Ignacio Vera >Assignee: Karl Wright > Attachments: LUCENE_7970.patch, LUCENE-7970.patch, > LUCENE-7970-proposed.patch > > > Hi [~Karl wright], > How circles are currently build do not behave very well when the planet model > is not an sphere. when you are close to the border in WGS84 you might get > false positves or false negatives when checking if a point is WITHIN. I think > the reason is how the points to generate the circle plane are generated which > assumes a sphere. > My proposal is the following: > Add a new method to PlanetModel: > public GeoPoint pointOnBearing(GeoPoint from, double dist, double bearing); > Which uses and algorithm that takes into account that the planet might not be > spherical. For example Vincenty's formulae > (https://en.wikipedia.org/wiki/Vincenty%27s_formulae). > Use this method to generate the points for the circle plane. My experiments > shows that this approach removes false negatives in WGS84 meanwhile it works > nicely in the Sphere. > Does it make sense? -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (LUCENE-7970) Improve generation of circle plane
[ https://issues.apache.org/jira/browse/LUCENE-7970?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ignacio Vera updated LUCENE-7970: - Attachment: LUCENE-7970-proposed.patch Attached is the changes I have done. I changed the way the circle plane points are calculated to consider the planetModel. > Improve generation of circle plane > --- > > Key: LUCENE-7970 > URL: https://issues.apache.org/jira/browse/LUCENE-7970 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/spatial3d >Reporter: Ignacio Vera > Attachments: LUCENE-7970.patch, LUCENE-7970-proposed.patch > > > Hi [~Karl wright], > How circles are currently build do not behave very well when the planet model > is not an sphere. when you are close to the border in WGS84 you might get > false positves or false negatives when checking if a point is WITHIN. I think > the reason is how the points to generate the circle plane are generated which > assumes a sphere. > My proposal is the following: > Add a new method to PlanetModel: > public GeoPoint pointOnBearing(GeoPoint from, double dist, double bearing); > Which uses and algorithm that takes into account that the planet might not be > spherical. For example Vincenty's formulae > (https://en.wikipedia.org/wiki/Vincenty%27s_formulae). > Use this method to generate the points for the circle plane. My experiments > shows that this approach removes false negatives in WGS84 meanwhile it works > nicely in the Sphere. > Does it make sense? -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (LUCENE-7970) Improve generation of circle plane
[ https://issues.apache.org/jira/browse/LUCENE-7970?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ignacio Vera updated LUCENE-7970: - Attachment: LUCENE-7970.patch Hi [~daddywri], I attached a test with my expections. The test perform the following operations: 1) Generates a circle 2) Generate a point 3) calculates the surface distance between the center of the circle and the point 4) if distance is bigger than radius the it is out-of-set else in-set. This works for the Sphere but you get errors when doing it in WGS84. My naive idea is that considering {{circle.center + radius}} and {{circle.center - radius}} as the upper and lower point for a circle is only correct for the SPHERE but it needs to be properly calculated for other planets, for example using Vincenti formula. make sense? or there is a falw in my reasoning? > Improve generation of circle plane > --- > > Key: LUCENE-7970 > URL: https://issues.apache.org/jira/browse/LUCENE-7970 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/spatial3d >Reporter: Ignacio Vera > Attachments: LUCENE-7970.patch > > > Hi [~Karl wright], > How circles are currently build do not behave very well when the planet model > is not an sphere. when you are close to the border in WGS84 you might get > false positves or false negatives when checking if a point is WITHIN. I think > the reason is how the points to generate the circle plane are generated which > assumes a sphere. > My proposal is the following: > Add a new method to PlanetModel: > public GeoPoint pointOnBearing(GeoPoint from, double dist, double bearing); > Which uses and algorithm that takes into account that the planet might not be > spherical. For example Vincenty's formulae > (https://en.wikipedia.org/wiki/Vincenty%27s_formulae). > Use this method to generate the points for the circle plane. My experiments > shows that this approach removes false negatives in WGS84 meanwhile it works > nicely in the Sphere. > Does it make sense? -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org