I have a polygon in land cover with 4 coordinates (north-south, east-west) and I would like to compute the latitude and longitude.
For example, Bounding Box: West = -10.61982, East = 44.82124, North = 71.18545, South = 34.56192
Does anybody know the basic steps?
It seems that is the inverse of the following problem:
How to translate a given coordinate into a bounding box of "diameter" x?
Thank you!
Related
I'm trying to associate a set of points (lat, long) to an edge using osmnx library in Python.
I would like to find the nearest points to an edge within a distance x.
I have an edge and I would like to draw a circle and count how many points are into the circle, with a given radius. I have tha lat and long coordinates of each point but I don't know how to calculate the lat, long coordinate of the edge. I also have the coordinates lat, long of the nodes connected by that edge.
Thank you for your help.
import pandas as pd
from shapely.ops import transform
from functools import partial
import pyproj
from shapely.geometry import Point
mid_point = Point(lon,lat) # UNPROJECTED CO-ORDINATES OF MID-POINT OF AN EDGE
node_point = Point(lon_node, lat_node)# UNPROJECTED CO-ORDINATES OF THE NODE
x = 500 #DISTANCE IN METERS
#TRANSFORM INTO PROJECTED CO-ORDINATES
project = partial(pyproj.transform,pyproj.Proj(init='epsg:4326'),pyproj.Proj(init='epsg:3112'))
mid_point_projected = transform(project, mid_point)
node_point_projected = transform(project, node_point)
#CREATE BUFFER CIRCLE WITH DISTANCE X METRES WITH CENTRE AT EDGE MID-POINT
buffer_circle = mid_point_projected.buffer(x)
#PERFORM POINT-IN-POLYGON ANALYSIS TO CHECK WHETHER THE NODE FALLS WITHIN THE BUFFER CIRCLE
print(buffer_circle.contains(node_point_projected))
POINTS TO BE NOTED:
EPSG Geodetic Parameter Dataset is a structured dataset of Coordinate Reference Systems and Coordinate Transformations, accessible through this online registry (www.epsg-registry.org)
EPSG 4326 represents World Geodetic System (WGS84) (https://epsg.io/4326)(points on the Earth's surface represented in terms of latitude and longitude)
I have transformed it into EPSG 3112 representing GDA94 / Geoscience Australia Lambert (https://epsg.io/3112). You should transform it into the corresponding EPSG code for your study area.
I have a set of GPS coordinates 12.9611159,77.6362214. What exactly do these mean? How can I convert them to degrees of longitude and latitude? What formula should I use to get accurate distance between two sets of coordinates when the order of distance is 10km.
Most likely 12.9611159 is the latitude in degrees, 77.6362214 the longitude. In that case, the coordinate is in India. If latitude and longitude are reversed, you end up in the Greenland Sea.
You can easily check this by entering the coordinate pair in the Google maps search box. Google expects latitude first.
For the distance, in python you can easily use the haversine package:
from haversine import haversine
my_coord = (12.9611159,77.6362214)
other_coord = (12.9, 77.6)
distance = haversine(my_coord, other_coord)
This will give you the distance in km.
look at the picture above, see a black circle.
black circle Coordinates is lat(126.897453), lon(37.530028)
if the red rectangle is square(vertical and horizontal are 20m), I want to know the blue circle of coordinates
please let me know calculation formula.
In advance, thanks for your answer!
have a good time :)
This task is solved by first transforming the spherical lat/long coordinates to a cartesian x,y coordinates with unit meters.
Then you calculate the location with very basic addition. (x = x-20, y=y-20/2)
Then you transform the location back to lat/long coordinates.
Currently I'm trying the following: I have points from google earth (WGS84) which I want to transform to a local x,y coordinate system: a tangential plane with y positive from south to north and x positive from west to east.
There is no need for the plane to be part of a global coordinate system more than the relation (x=0, y=0) = (lat,lon). The scale at which I'm working is in the order of say 100 kilometers (maximum of for example 200 km's). Very small errors (due to for example the curvature of the earth) are acceptable.
I have relatively little understanding of this topic as of yet. Can anybody help me out? Where would I need to look for example.
Thanks!
I haven't found the answer mathematically but have found that the package basemap (of the mpl_toolkit) should help with this respect (from wgs84 to a transverse mercator projection).
as topic, the Coordinates value (Latitude and Longitude) is known , these Coordinates will compose as polygonal area , my question is how to calculate the area of the polygonal that is base the geography ?
thanks for your help .
First you would need to know whether the curvature of the surface would be significant. If it is a relatively small then you can get a good approximation by projecting the coordinates onto a plane.
Determine units of measure per degree of latitude (eg. meters per degree)
Determine units of meature per degree of longitude at a given latitude (the conversion factor varies as you go North or South)
Convert latitude and longitude pairs to (x,y) pairs in the plane
Use an algorithm to compute area of a polygon. See StackOverflow 451425 or Paul Bourke
If you are calculating a large area then spherical techniques must be used.
If I understand your question correctly - triangulation should help you. Basically you break the polygonal to triangles in such a way that they don't overlap and sum their areas.