Add point or crosshair to center of Google earth engine timelapse - google-maps-markers

Google earth engine allows me to view a timelapse of satellite imagery at specific (longitude, latitude) coordinates, e.g. https://earthengine.google.com/timelapse/#v=-9.16696,-58.55014,12,latLng, whose three arguments are latitude, longitude and zoom level.
Is it possible to modify the timelapse to include a marker, point or crosshair at its center -- in this example, at (latitude, longitude) = (-9.16696, -58.55014)? How should I go about doing that?

Related

How to translate MKT expression to D3 options on Albers projection?

This is the standard MKT expression (here also translated to Proj.4 string) of Albers conicEqualArea for official Statistical Grid of Brazil:
PROJCS["Conica_Equivalente_de_Albers_Brasil",
GEOGCS["GCS_SIRGAS2000",
DATUM["D_SIRGAS2000",
SPHEROID["Geodetic_Reference_System_of_1980",6378137,298.2572221009113]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Albers"],
PARAMETER["standard_parallel_1",-2],
PARAMETER["standard_parallel_2",-22],
PARAMETER["latitude_of_origin",-12],
PARAMETER["central_meridian",-54],
PARAMETER["false_easting",5000000],
PARAMETER["false_northing",10000000],
UNIT["Meter",1]]
The DATUM is the WGS 84 ("SIRGAS2000" is a alias for it).
How to translate all details to the D3.js v5 parametrization?
I try the obvious, as center and parallels, but it was not sufficient
var projection = d3.geoConicEqualArea()
.parallels([-2,-22]) // IS IT?
.scale(815)
//.rotate([??,??]) // HERE THE PROBLEM...
.center([-54, -12]) // IS IT?
PS: where the D3 documentation for it? The D3 source-code of geoConicEqualArea() have no clues.
The parts that translate to a d3 Albers projection are as follows:
PROJECTION["Albers"],
PARAMETER["standard_parallel_1",-2],
PARAMETER["standard_parallel_2",-22],
PARAMETER["latitude_of_origin",-12],
PARAMETER["central_meridian",-54],
You have the parallels, now you need to rotate. Also note, for any D3 projection, the rotation is applied to the centering coordinates. Generally, you'll want to rotate on the x and center on the y:
d3.geoAlbers()
.parallels([-2,-22])
.center([0,-12])
.rotate([54,0])
.translate([width/2,height/2])
.scale(k)
I've rotated in the opposite direction along the x axis (rotated the earth under me so that I'm overtop of the central meridian, hence my rotation by -x). I've then centered on the y. Lastly I translate so that the intersection of the central longitude and meridian is centered in the map and apply a scale value that is appropriate.
If I want to center on a different area but keep the projection the same, I can modify projection.center(), but keep in mind that the coordinates provided here are relative to the rotation. I can also use projection.fitSize() or projection.fitExtent(), both of which set 'translate' and 'scale' values for the projection. None of center/scale/translate change the distortion in the D3 projection.
Of course this isn't a true replication of your projection as the coordinate space units are pixels, you will remain unable to measure distances in meters directly without some extra work.
See also

How to fit a rectangle into a space (get relative camera position) having its dimentions and shape?

Say we have a web cam image of a road. We have picked 4 connected 2d lines of a rectangle, and we know there are 90deg angles between them. We have set their real life dimentions. How one can get 3d camera position relative to that rectangle from such data?
Having 4 pairs of corresponding coordinates - real word ones and coordinates at camera matrix (in photo image coordinate system), one can calcalate matrix of perspective transformation, for example, with OpenCV function getPerspectiveTransform.
Then apply decomposeProjectionMatrix
If you are using another means/libraries for image acquisition/treatment, they might contain something similar

Map Autodesk forge viewer (ThreeJS) Coordinates to Original CAD Coordinates

I already know about the GlobalOffset thing, but still not able to map both.
All what I have is an X,Y,Z Values from the original CAD (before extraction and preparation) and I want to find them on the forge viewer to place objects, or any other operations.
According to Philippe, the viewer will move models or drawings around to the center of the viewport by minus the viewer.model.globalOffset.
Therefore, you have to minus the point location (x1, y1) with the (x2, y2) value of the globalOffset, then you will get what you want.

MKMapview fix user at bottom of map

I'm creating a navigation app and want the map to show the users location at the bottom of the map, like in Maps app when routing/navigating. However you can only determine which coordinate to focus on by using the centre coordinate.
Therefore I need to calculate an offset distance and bearing and calculate a coordinate that this represents the central coordinate that will allow the displaying of the users location at the bottom of the map.
This is all complicated by the 3D view where the camera pitch and altitude affects the relationship of distance between the offset coordinate and the users location.
Is there an easier way to do this or does someone know how to calculate this?
Thanks (a lot!)
D

Projecting feature locations onto D3.js geo projections

I'm trying to add some dots representing the locations of various features onto some of D3.js's geographic projections. I would like the dots to rotate and get clipped the same as the country paths, but I'm having some difficulty getting this to work.
For a given projection, I can obtain the updated coordinates by updating the projection according to the drag as in the demo, then calling projection() on the coordinates that I want to update, but this does not clip the circles correctly (you can see the circles on the opposite side of the globe). Would it be possible to get an example of this? To recap, I'd like to draw a circle around, say, New York city, then be able to rotate the globe and have the circle "set".
Thanks!
Lauren

Resources