Custom editable point in Google Maps Polyline - google-maps-api-3

I have an array of coordinates which length is about 3k. I draw the path with google.maps.Polyline. Is it possible to do each 100 (100, 200, 300 ...) point editable?

Related

What is depth information among an image?

Given pixel location (x,y) in an image, how to get the depth information of this pixel?
In other words, I just obtain (x,y) location of a 3D point in the image plane using projection matrix and now I want to obtain a depth map. What pixel values should I take to obtain such depth map?
NB : I am trying to follow this code :
!(https://github.com/balcilar/DenseDepthMap)

Can I use homography to project camera image points to the ground (2D plane)?

My problem is quite simple yet I struggle to solve it correctly.
I have a camera looking towards the ground and I know all the parameters of the shot. So, using some maths I was able to compute the 4 points defining the field of view of the camera (the coordinates on the ground of each image's corners).
Now, from the coordinates (x, y) of a pixel of the image, I would like to know its real coordinates projected on the ground.
I thought that homography was the way to go, but I read here and there that "homography maps a plane seen from a camera to the same plane seen from another" which is a slightly different problem.
What should I use, please?
Edit: Here is an example.
Given this image:
I know everything about the camera that took the picture (height, angles of view, orientation), so I could calculate the coordinates of the four corners forming its field of view on the ground, for example (in centimeters, relative to the camera position, clockwise from top-left): (-300, 500), (300, 500), (100, 50), (-100, 50).
Knowing that the coordinates on the image of the blade of grass are (1750, 480), how can I know its actual coordinates on the ground?
By "knowing everything" about the camera, do you mean you have the camera FOV, rotation and translation with respect to the ground plane? Then it's trivial, right?
Write the camera matrix K = [[f, 0, w/2],[0, f, h/2],[0, 0, 1]]. Let R and t be respectively the 3x3 rotation matrix and 3x1 translation from camera to ground. A point on the ray going through a given pixel p=[u, v, 1] has camera coordinates r = inv(K) * p. Express it in world coordinates as R * r + t, intersect with the ground plane and you are done.

Find all lat/long under certain radius

I have set of lat/long which are stored in database and I have to find all the lat/long from the database which are lies between the given lat/long(e.glatitude = 37.4224764,and longitude=-122.0842499) and given radius(say 5miles).For this I need to do some addition and subtraction like:
37.4224764 + 5mile
37.4224764 - 5mile
and
-122.0842499+5mile
-122.0842499-5mile
But I don't know how the conversion works here.
You're a little vague in your requirements, do you just want to find out the coordinates of a point a certain distance from your current location in a given direction? Or get a circle of a radius of a particular distance around your coordinates? Or draw a line of a certain length from your coordinates to another point a particular distance away?
I assume you'd probabaly want to use the Geometry spherical library, e.g.
var latLng = new google.maps.LatLng(geometry.location.lat, geometry.location.lng);
var newLatLng = google.maps.geometry.spherical.computeOffset(
latLng,
1000,
0
);
see also https://developers.google.com/maps/documentation/javascript/geometry#Distance
PS: you need to add the geometry library parameter when loading the map:
<script src="https://maps.googleapis.com/maps/api/js?v=3&libraries=geometry"></script>

optimal zoom distance to show all polyLines at map load

I have a map with multiple polyLines.
I want a function that I can send a group of polylines to, and it return the tightest possible zoom range to show the lines entirely.
Add all the points you want visible to an empty google.maps.LatLngBounds object (with .extend()) then run .fitBounds() on the resulting bounds.
All the points you want visible are all the vertices of all the polylines.

How to get an area (multiple 2) of LocationRect in bing maps?

I have an application that is using bing maps.
I can get the boundary of the current show map - for example, if my map is on Canada, then I will get the boundary of Canada (A rectangle):
LocationRect bounds = map.Bounds;
bounds has - Height, Width, East(point of type double), West, North, South, Center.
How can I get the bounds * 2? (In math I think it's Area * 2).
Explanation:
I have the bounds of the map (A rectangle).
I want to enlarge this bounds to be bigger twice.
If my rectangle was 2cm, 5cm -> it will become 4cm, 10cm.
If I understand it right it is a simple question if not... :-)
You have a Black rectangle that you know the ABCD coordinates.
Calculate the distance between AD Which will be your Y and the distance between AB that will be your X.
In order to get get the EFHG coordinates of a new rectangle that you need to follow the sketch, just add or subtract from vertexes coordinates of the Black rectangle in order to get the Blue rectangle.
Of course, you need to check all the time that the coordinates of the blue rectangle do not exceed the maximum coordinates of the map.

Resources