6 votes

Converting latitude, longitude (EPSG:4326) into EPSG:3857?

from pyproj import Proj, transform P3857 = Proj(init='epsg:3857') P4326 = Proj(init='epsg:4326') x,y = transform(P4326, P3857, lon, lat)
Marcel Wilson's user avatar
5 votes
Accepted

Postgresql - problem updating row with complex calculation

The part being equal to zero is likely ((vitality + root_injuries + stem_injuries + crown_injuries)/16)) should the sum be less than 16. Try dividing by 16.0 instead so you will have decimal results.
JGH's user avatar
  • 39.8k
4 votes

Converting from ECEF to geodetic coordinates

You can use this function to perform the conversion of ECEF coordinates to Geodetic coordinates. The function is implemented in python but can be easily written in java. Example: import math def ...
Leo Cardona's user avatar
  • 1,343
4 votes

How to add meters to EPSG:4326 coordinates?

As explained by Mr. Che, general answer is to project in a metric system (for example, for Europe, you can use EPSG 3035). However, if all your points are within a small area (~some dozens of km), an ...
Hugo Palmer's user avatar
4 votes

How can I calculate the coordinates of a point on the intersection of two parallel lines with a bisecting line with pyQGIS?

Combining grass:v.parallel and saga:convertlinestopolygons (both processing methods) in a PyQGIS code, it is possible to accomplish this task. For this situation: and this code: import processing ...
xunilk's user avatar
  • 29.4k
4 votes
Accepted

ECEF coordinates to geodetic coordinates: Where is error in calculation?

About the ATAN2 function: Your definitions for lambda (longitude) and psi (geocentric latitude) have a domain restriction: lambda = ATAN(y/x) , with x > 0. (i.e., just for -PI/2 < lambda &...
Gabriel De Luca's user avatar
4 votes
Accepted

Calculate distance between location and way segment

In such cases the best strategy is to use existing solution/library, and in this case that would be turf.js library and it's method turf.nearestPointOnLine (see https://turfjs.org/docs/#...
TomazicM's user avatar
  • 22.8k
3 votes
Accepted

Translating latitude and longitude into "polar coordinates" around a point

Your cartesian to polar transformation would be valid after first projecting all your dataset in an azimuthal equidistant projection centered on your point of interest. You can find all details on ...
radouxju's user avatar
  • 49.3k
3 votes

Bearing to X,Y, Z

Form (whole circle) bearing, zenith angle and horizontal distance to X, Y, Z X = X0 + h_distance * sin(deg / 360 * pi()) Y = Y0 + h_distance * cos(deg / 360 * pi()) Z = Z0 + h_distance / tan(zenith / ...
Zoltan's user avatar
  • 7,112
3 votes
Accepted

How to generate missing points in GPS trajectories?

GPSBabel has a function for this. To take a GPX input file and interpolate points so that each is 30 seconds apart: gpsbabel -i gpx -f INPUT.gpx -x interpolate,time=30 -o gpx -F OUTPUT.gpx Arguments:...
Simbamangu's user avatar
  • 14.8k
3 votes

Finding line equation (on Earth) using two GPS coordinates

If you think the Earth as a sphere, you probably looking for the great circle (orthodrome), the shortest path on the surface of the sphere. You should find the circle which is in the plain of the two ...
Zoltan's user avatar
  • 7,112
3 votes

How to determine left and right side of crossing lines?

Consider using the cross product approach as discussed here. Pure mathematical approach that does not rely on any third party module. I would take the start point and test against the line. I think ...
Hornbydd's user avatar
  • 42.6k
2 votes

Doing Math calculations within ArcMap Dynamic Text?

You can use the Data Driven Page Display Expression option . So in your case the display expression on the Display tab of the Layer properties would be SHAPE.AREA/10000 http://desktop.arcgis.com/en/...
Kari's user avatar
  • 115
2 votes

Math formula for transforming from EPSG:4326 to EPSG:3857

I got a C# code for using in unity engine. Here the code below : public static double[] latLonToMeters(double lat, double lon) { //Debug.Log(Mathd.Tan((90d + lat) * Mathd.PI / 720)); //Debug....
user144482's user avatar
2 votes

Estimating resolution of vector data?

Great question - I’ve seen this type of question pop up numerous times and unfortunately, many people undertaking quantitative GIS analysis ignore the CRITICAL component of calculating uncertainty in ...
Alex P's user avatar
  • 131
2 votes

Getting lat/lng of an object X inches from the GPS?

Someone can please correct me if I'm wrong, but: The distance left/right in degrees of longitude depends on the latitude you are at. Calculating longitude length in miles? explains how that works. ...
Mark Ireland's user avatar
2 votes

How to add meters to EPSG:4326 coordinates?

You can't just add an constant value to geograghic coordinates in EPSG:4326: WGS 84 coordinate system, because the length of two arcs between two different pairs of point on a sphere is depend on ...
Comrade Che's user avatar
  • 7,016
2 votes
Accepted

How to run a Epanechnikov (parabolic) decay in QGIS 3.6 field calculator

Your formula is correct and valid in QGIS, and will yield a Gaussian kernel: However, the field you are trying to calculate needs more digits, since the exp decay you defined is very "slow" (the ...
RafDouglas C. Tommasi's user avatar
2 votes
Accepted

Seeking documentation about non-iterative UTM to Lat-Long projection formulas

The part of the iterative method is not easy to understand. I found the document on which you rely on the following link: https://earth-info.nga.mil/GandG/publications/tm8358.2/TM8358_2.pdf ...
Gabriel De Luca's user avatar
2 votes
Accepted

High resolution x,y dataset for Mollweide projection convert to latitude and longitude coordinates

For the calculation of R, you will have to use half of your image width (144,000 / 2) = 72,000, which gives an R value of 25455.8441227. Also, since the projection origin is at the center of the ...
FSimardGIS's user avatar
  • 3,786
2 votes
Accepted

Converting to geodetic latitude, longitude

Actually, the latitudes and longitudes that we commonly use are geodetic, not geocentric. Unless specified that your latitudes are geocentric, they will most certainly be geodetic already. A geodetic ...
FSimardGIS's user avatar
  • 3,786
2 votes

How to determine left and right side of crossing lines?

Here is an approach using Postgis, it shouldn't be difficult to replicate in Python, code finds the azimuths from the intersection to the starting points, if it geom A's azimuth is greater than geom B'...
Elio Diaz's user avatar
  • 3,444
2 votes

How to determine left and right side of crossing lines?

Here is working code example in Python based on great answer of Elio in Postgis. from shapely.ops import LineString, Point import math def calc_azimuth(point1, point2): """Calculate ...
Davma's user avatar
  • 850
2 votes
Accepted

An application for measuring river length?

There is no single application that will do what you ask as you are underestimating the complexity of the problem. Medial Axis will indeed identify a centre line but then you need to prune the network/...
Hornbydd's user avatar
  • 42.6k
2 votes

Calculate GPS elevation angle (Python)

If you convert the coordinates from lat/long to a datum that uses meters such as UTM, and also make sure your elevation values are in meters, then you just need to use the Pythagorean theorem to find ...
Kartograaf's user avatar
  • 2,844
2 votes

Create a longer line segment from a shorter one?

You are using planar geometry equations (Euclidean distance measurement, etc.) on spherical coordinates, which will introduce errors. If your data only cover a limited geographical extent, try ...
Jan Šimbera's user avatar
  • 1,304
2 votes
Accepted

Create a longer line segment from a shorter one?

Proposal from @Jan Šimbera to convert coordinates to projected CRS EPSG:32737 (UTM zone 37S) and then use cartesian math would in this case work quite OK, since line length is only about 20km and ...
TomazicM's user avatar
  • 22.8k
2 votes
Accepted

Calculate the new x and y coordinate of the extent after rotating the map in MapViewer ArcGIS Online

Answer by @FelixIP: Calculate center coordinate (x_cent, y_cent) Subtract the center coordinate from current corner's (x - x_cent, y-y_cent) Apply the formula above Add the center coordinate back (x' ...
Hieu Pham's user avatar
1 vote
Accepted

Procedure of transforming coordinates?

There are two atomic procedures here. Convert the projected coordinates from the State Plane zone (in US survey feet) to latitude-longitude on NAD83. (specifically, Lambert conformal conic) Convert ...
mkennedy's user avatar
  • 18.7k
1 vote

Calculate angle between nodes or point in line in QGIS

There is the angle_at_vertex(geometry,vertex) fonction in field calculator that Returns the bisector angle (average angle) to the geometry for a specified vertex on a linestring geometry. Angles ...
J.R's user avatar
  • 14.6k

Only top scored, non community-wiki answers of a minimum length are eligible