-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues checking if location is within set polygon #4
Comments
Can you provide an example? |
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
-->I’m using your package with another package and I used wikimapia API for getting the coordinates of the polygon. So in this capture you can see that the red pin is the current location. But containslocation returns false. When I move it in a different area within the polygon it returns true but sometimes it doesn’t. Anyway how to debug this issue? Sent from Mail for Windows 10 From: kb0Sent: Thursday, July 9, 2020 3:22 PMSubject: Re: [kb0/maps_toolkit] Issues checking if location is within set polygon (#4) Can you provide an example?—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
Virus-free. www.avast.com
|
Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
10
[image: Capture.PNG]
In the emulator the red pin is the current coordinates that is being
compared I used wikimapia API for plotting the polygon and that the red
highlight in the map as you can see the red pin is within the polygon but
contains.location returns false in this coordinates. If I move it within
the same polygon it returns true. How fix on this issue?
|
|
[{"x":55.4695522,"y":25.3937088},{"x":55.4680877,"y":25.3945885},{"x":55.4669666,"y":25.3952887},{"x":55.4651588,"y":25.3955238},{"x":55.4634045,"y":25.3957539},{"x":55.461688,"y":25.395926},{"x":55.4603147,"y":25.396064},{"x":55.4590219,"y":25.3962459},{"x":55.4580186,"y":25.396384},{"x":55.4564952,"y":25.3967619},{"x":55.4557013,"y":25.397467},{"x":55.4548966,"y":25.3981769},{"x":55.4546231,"y":25.3986979},{"x":55.4543602,"y":25.3991751},{"x":55.4540169,"y":25.3991849},{"x":55.4538935,"y":25.3997689},{"x":55.4537487,"y":25.4004544},{"x":55.4535448,"y":25.4012299},{"x":55.4526758,"y":25.4010844},{"x":55.4519248,"y":25.4040403},{"x":55.4517852,"y":25.4040112},{"x":55.4487705,"y":25.4027515},{"x":55.4485558,"y":25.4026156},{"x":55.4480168,"y":25.4021663},{"x":55.4498431,"y":25.4003286},{"x":55.4510986,"y":25.3985452},{"x":55.4533194,"y":25.3953276},{"x":55.454607,"y":25.393263},{"x":55.4548966,"y":25.3928947},{"x":55.4551541,"y":25.3923422},{"x":55.4552613,"y":25.3913827},{"x":55.4551005,"y":25.3903843},{"x":55.4553687,"y":25.3899676},{"x":55.4563611,"y":25.389815},{"x":55.4573321,"y":25.3897108},{"x":55.4584693,"y":25.3895291},{"x":55.4590433,"y":25.3894467},{"x":55.4602503,"y":25.3892553},{"x":55.4609638,"y":25.3891559},{"x":55.4621171,"y":25.3889694},{"x":55.4635441,"y":25.3890759},{"x":55.4651105,"y":25.3893376},{"x":55.4662719,"y":25.3897823},{"x":55.4674708,"y":25.3902487},{"x":55.4683774,"y":25.3906583},{"x":55.4692679,"y":25.3910217},{"x":55.4708289,"y":25.3916445},{"x":55.4719017,"y":25.3917995}]
this are the polygon coordinates
25.392898, 55.455251
this is a sample coordinate that does not work.
25.394104, 55.454473
this is a coordinate that returns true
…On Thu, Jul 9, 2020 at 5:09 PM kb0 ***@***.***> wrote:
1. No image, only text [image: Capture.PNG]
2. Can you provide dart code with coordinates of polygon, and
coordinates of point? Something, like:
PolygonUtil.containsLocation(
LatLng(20.0, 33.5),
[LatLng(28, -82), LatLng(29, -83), LatLng(30, -85), LatLng(28, -82)],
true)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOW6FULILUT5HAV2DOWYXHLR2W6SBANCNFSM4OVKEQOQ>
.
|
any update regarding this issue? |
Sorry although I am not author of this package, am writing this to ask you that are you sure are those co-ordinates for points correctly ordered? |
Hi, I used wikimapia's api for getting the coordinate points and then saved it to our database. http://wikimapia.org/#lang=en&lat=25.390714&lon=55.457182&z=15&m=w&show=/22012924/Al-Rashideya-1 this is the link for the plotted coordinates. |
@ChristianAdrian you should check order of your testing points. I add test for your case at https://github.com/kb0/maps_toolkit/blob/master/test/polygon_util_test.dart. It's work as expected:
|
Hi, sorry my example was not clear but the value of x is the lng and the value of y is the lat final polygon = makeList([
PolygonUtil.containsLocation(
its supposed to be like this. But I'm still getting some parts within the polygon return false. |
@ChristianAdrian I add test with reverse order of coordinates (latitude <-> longitude) - 'contains issue-4-2' (923579b) - it's work on your data |
yes that returns true reference from my first this is why I cant figure out the problem because some of the plots within the polygon works but some does not |
Fix point in tests, point
|
Thanks, I have found the problem it's with the other package I'm using to get the location |
some areas within the set polygon returns false.
The text was updated successfully, but these errors were encountered: