B4A Class [B4X] GPSPolyMap - check if GPS location is inside a polygon - Biswajit    May 11, 2020   (19 reactions) With this class, you can check if the GPS location coordinate is inside a polygon.
You can use this class to check whether the user is inside a building, shopping mall or any custom shape.
This class is only for B4A and B4I.
Here is how can you get the coordinates of an establishment (school, offic B4i Code Snippet Point inside a polygon (Ray casting algorithm) - marcick    Mar 23, 2016   (7 reactions) Based on this source http://rosettacode.org/wiki/Ray-casting_algorithm
I've adatped the code to B4i (should be identical for B4J and B4A too) and I want to share it in this so helpful forum.
You need to call the sub with a Point(LatLng) and a list(LatLng) that contains the sequence of vertex of the B4A Question Parse KML Polygones, Save, check if inside? - roumei (first post)    Nov 24, 2020   (2 reactions) I use this code to check whether a point is inside a polyon:
Type ePoint(X As Double, Y As Double)
Public Sub IsPointInPolygon(polygon() As ePoint, X As Double, Y As Double) As Boolean
Dim result As Boolean = False
Dim j As Int = polygon.length - 1
For i = 0 To polygon.length - 1
B4A Question Polygon calculation - klaus (first post)    Mar 21, 2016   (7 reactions) Attached you find a small project which returns if a point is inside the polygon, in the surrounding with a given distance or outsides the surrounding.
It is an evolution of this project.
The routine checks first if the point is in the polygon and then check if the distance of the point to the each Games Useful Formulas - stevel05 (first post)    Apr 20, 2017   (2 reactions) Is a point inside a polygon:
Converted from a C routine taken from here: http://www.codeproject.com/Tips/84226/Is-a-Point-inside-a-Polygon
There is an explanation of it's workings and it's license in the link.
Private Sub pnpoly(nvert As Int, vertx() As Int, verty() As Int, testx As Int, testy As B4A Question Polygon Geofences - Troberg (first post)    May 12, 2015   (2 reactions) The algoritm for finding out if a point is within a polygon is pretty straightforward:
Pick a point that you know is outside the polygon (such as the smallest X and smallest Y, both -1). Then, simply see how many polygon border lines a line between that point and the point you want to test intersec B4J Question jgoogle map question - inakigarm (first post)    Jun 10, 2016   (1 reaction) Search for "point inside a polygon" and possibly the questions are answered at post #2 (point) and #5 (area) B4A Code Snippet Geo-Zone Determination (Point in Polygon) - klaus (first post)    Jun 01, 2016   (3 reactions) You can have a look at this project PointInPolygonSurrounding.
The only point is that the program, in this project, returns if the point is in the polygon, in an outer surrounding within a given distance or out of the surrounding.
The code could easily modified to check the inverse.
In the CheckPoi B4A Question Converting map lat/lng to screen point when close to 180 degrees meridian (Solved) - RB Smissaert (first post)    Dec 02, 2024 Not worked on this idea yet, but solved 2 problems demonstrated in the posted image.
One was that adding random map points inside a polygon that was drawn round a point on the 180 degree meridian didn't work OK.
This was caused by a Sub that checked if a lat/lng point was inside that polygon didn't B4J Question Maps: Marker distance from a polygon - Erel (first post)    Feb 16, 2021   (1 reaction) If it doesn't need to be 100% accurate then you can treat the circle as a square and test whether any of the four points is inside the polygon (assuming that the circle is small relatively to the polygon).
https://www.b4x.com/android/forum/threads/geo-zone-determination-point-in-polygon.53929/#cont Page: 1   2   3   4   5   6   7   Powered by ColBERT |