Android Question Polygon around multiple lat/lon points

RB Smissaert

Well-Known Member
Licensed User
Longtime User
I need to write some code to get a polygon (list of lat/lng points) that surrounds a number of lat/lng points on a map.
This polygon needs to surround the points tightly, so a simple rectangle (which would be very easy to code) won't do.
This link looks promising:
https://github.com/mapbox/concaveman
And I wonder if maybe somebody of this group has already coded this for B4A.
In that case I would be very interested to see that code.

RBS
 

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Didn't think it would be a problem but have tested now for the positive to negative longitude change we do have in the UK and that is indeed fine.
Will test now for your mentioned wraparounds.
RBS
 
Upvote 0

emexes

Expert
Licensed User
Will test now for your mentioned wraparounds.

The problem will occur if degrees longitude is eg 358 rather than -2.

I have a vague recollection that most Mod operators don't play well with negative numbers.

Angle = (Angle + 180) Mod 360 - 180

feels like it should work.

Lol I'm just watching an English TV program here, mentioned something about a car worth 70 million.
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
The problem will occur if degrees longitude is eg 358 rather than -2.

I have a vague recollection that most Mod operators don't play well with negative numbers.

Angle = (Angle + 180) Mod 360 - 180

feels like it should work.

Lol I'm just watching an English TV program here, mentioned something about a car worth 70 million.
> English TV program here, mentioned something about a car worth 70 million
Yeah, just sold that car, shame I didn't realise it was worth that much.

RBS
 
Upvote 0
Top