coordinate-transformation

Converting Southing/Easting GPS coordinates to Latitude/Longitude

折月煮酒 提交于 2019-12-06 06:38:14
I am developing a web application using JQuery Framework and am using Geolocation to determine the locations of our hardware stations to display on Google Maps. In our database the locations of the sites are stored in Southing/Easting format. I need a way to convert Southing/Easting coordinates to Latitude/Longitude that Google Maps can understand. Can anyone please tell me the formula or the best way to approach this problem? I have done searches on Southing/Easting however nothing came up, more like northing/westing etc and even then, not much info.. The programming part I don't really need

How to rotate 2 objects independently in pygame and pyopengl

别来无恙 提交于 2019-12-06 05:21:00
I'm trying to rotate 2 objects independently but when I run the code both objects rotate in the same direction enter code here here i save the matrix and rotate a square under the cube def rotate_square(): glColor3f(1,1,1) glMatrixMode(GL_MODELVIEW) glPushMatrix() glRotatef(45,0,1,0) glBegin(GL_LINES) glVertex3fv(v1); glVertex3fv(v2); glVertex3fv(v1); glVertex3fv(v3); glVertex3fv(v3); glVertex3fv(v4); glVertex3fv(v2); glVertex3fv(v4); glEnd() glPopMatrix() main function def main(): pygame.init() screen = pygame.display.set_mode(SCREEN_SIZE, DOUBLEBUF|OPENGL) resize(*SCREEN_SIZE) print

Custom y-axis scale and secondary y-axis labels in ggplot2 3.1.0

Deadly 提交于 2019-12-05 15:06:27
问题 Edit 2 The current developmental version of the ggplot2-package does solve the bug mentioned in my question below. Install the dev version using devtools::install_github("tidyverse/ggplot2") Edit It seems as the faulty behaviour of sec_axis in ggplot2 3.1.0 is a bug. This has been recognized by the devs and they are working on a fix (see thread on GitHub). Goal I have a graphic where the y-axis ranges from 0 to 1. I'd like to add a secondary y-axis that ranges from 0 to 0.5 (so exactly half

Offset LatLng by some amount of meters in Android

我的未来我决定 提交于 2019-12-05 09:08:51
I have a LatLng object and I want to shift it's coordinates 500 meters to the east. I couldn't find a built-in method for that. I've seen https://gis.stackexchange.com/a/2964 but my results are just too inaccurate (about 15%) to use practically. How can I make a precise shift in meters? Note: I am NOT looking for shifting a Google Maps camera, I know how to do that. I've tried: static final double KILOMETERS_PER_DEGREE = 111.111; static LatLng offsetLongitude(LatLng initialCoords, float horizontalOffsetInMeters){ double degreeOffset = 1.0 / KILOMETERS_PER_DEGREE * horizontalOffsetInMeters /

Transforming coordinates of one rectangle to another rectangle

和自甴很熟 提交于 2019-12-05 09:01:37
in the above image I have shown two rectangles rectangle 1 whose x can vary from -900 to 13700 and Y can vary from -600 to 6458 rectangle 2 whose coordinate X can vary from 0 to 3000 and y can vary from 0 to 2000 Also: rectangle 2 has its starting point at left top position(0,0) whereas rectangle 1 has starting point( width/2, height/2). What I need to do : to convert a point of rectangle 1 to point of rectangle 2 using scaling or translation. So, what should be scaling factor for x and y coordinates in order to transform the coordinate of rectangle 1 to rectangle 2 ? Matthew Watson If:

Html5 Canvas Transformation Algorithm - Finding object coordinates after applying transformation

孤街浪徒 提交于 2019-12-05 06:43:42
问题 On html5 canvas I am drawing objects (rectangle, circle, etc...), these objects have transformation properties like scale, skew, rotation etc... These objects can be nested. Problem occurs when I after applying transformations, I want to find exact x, y coordinate of given object, but its going over my head. To all experts who is into interactive computer graphics; please help me solve this problem. Thanks in advance. 回答1: All affine transformations in 2D can be expressed as a matrix of the

Transform from relative to world space in Processing

…衆ロ難τιáo~ 提交于 2019-12-05 05:56:07
问题 What is a good way of transforming a local relative point, into the world (screen) space in Processing? For example, take the Flocking example that comes with the Processing PDE. How would I implement a relativeToWorld method and a worldToRelative method in the Boid class. These methods would take into consideration, all the transforms done in the render method. I was thinking I would want to transform PVector objects, so the method signatures might look something like: PVector

How to convert Earth Centered Inertial (ECI) coordinates to Earth Centered Earth Fixed (ECEF) AstroPy? Other?

泄露秘密 提交于 2019-12-04 19:14:10
I have position (x,y,z) and velocity (Vx,Vy,Vz) vectors in Earth Centered Inertial Coordinates (ECI) for a satellite orbit, and ultimately want to end up with geodetic coordinates (Latitude, Longitude, & Altitude). According to this other Stack Overflow question it seems that I need to convert to Earth Centered Earth Fixed (ECEF) coordinates as an intermediate step (so ECI --> ECEF --> Lat/Lon/Alt). I know ECI and ECEF share the same origin point (the center of mass of Earth) and the same z-axis that points to the North Pole. However, I am not sure what actual equations or adjustments I need

cv::undistortPoints() - iterative algorithm explanation

此生再无相见时 提交于 2019-12-04 18:45:05
I'm trying to understand the logic behind the OpenCV's cv::undisortPoints()' iterative approximation algorithm. The implementation is available at: https://github.com/Itseez/opencv/blob/master/modules/imgproc/src/undistort.cpp (lines 361-368). The way I see it: using last best guessed pixel position (x, y), try to find better guess by applying inverse of the 'distortion at current best guess', and adjust the pixel position in regard to the initial distorted position (x0, y0) use initial distorted position (x0, y0) as a first 'best guess' But the above doesn't really tell why this can be done..

OSM: convert ties from projected coordinates in spherical mercator “EPSG:900913” to “EPSG:4326” coordinates

本秂侑毒 提交于 2019-12-04 15:05:05
I'm using a map with a layer (from the example): var lonLat = new OpenLayers.LonLat(40.4088576, -86.8576718) .transform( new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984 map.getProjectionObject() // to Spherical Mercator Projection ); on moveend i'm get center coordinates: map.getCenter(); map.getZoom(); and zoom level: 4925535.4503328, -9668990.0134335, 12 Using algorithm from documentation public PointF TileToWorldPos(double tile_x, double tile_y, int zoom) { PointF p = new Point(); double n = Math.PI - ((2.0 * Math.PI * tile_y) / Math.Pow(2.0, zoom)); p.X = (float)((tile_x