-1

I have to draw a curve line on google map from a selected known point (LatLng) to a distance of like 200meters. The point (LatLng) after 200m should not be in Water(Sea). So,

How to:

1. Find the other point(LatLng) in 200m from pickup point.

2. The point(LatLng) should not be in water(sea).

enter image description here

Edited question:

Please ignore the 'curve line'. It can be a straight line, main problems are the 2 points that I have mentioned above.

Amir Raza
  • 2,320
  • 1
  • 23
  • 32

1 Answers1

1

This is an incomplete answer to a somewhat ambiguous question.

You indicate "curve line" but don't specify the curve function so it's impossible to provide help specifically on that.

If by "curve line" you mean circle around a point then you may be interested in the SphericalUtil class in the android-maps-utils which provides for finding "offsets" (computeOffset) from a point - but this assumes a circle from a center point - which is difficult to apply to your unknown curve function. And ofcourse the map itself provides for addCircle.

Also, to determine if any one point on the Earth's surface is in water you can use Google Maps Reverse Geocoding as in this answer: https://stackoverflow.com/a/9644812/2711811 . It mentions using 'type' field which is 'natural_feature' for water.

But this answer leaves open the general issue of "how to find a point not in water 200 meters from a center point" without an indeterminate, iterative approach - (i.e. keeping picking random points until not in water - which fails if the center point is on a 150-meter island). To solve this you'd have to limit your point space to land which means having knowledge of land/sea.

Example random point at 200 meters from center point:

SphericalUtil.computeOffset(pickupPoint, 200, new Random(System.currentTimeMillis()).nextDouble * 360)

Feel free to add more detail to your question.

  • Please ignore the 'curve line' in the question It can be a straight line. The main problem is to **find a point from a known point at the distance of 200m** and **That point should not be in water.** – Amir Raza Jul 10 '19 at 06:43