TRENDING NEWS

POPULAR NEWS

How Do I Calculate A Latitude Longitude Polygon From A Latitude Longitude Point

Geolocation: How do you convert latitude and longitude to a zipcode?

There are two options - reverse geocode using software like google, bing, mapquest it will return the address string for the location and you can separate zip from the string- find a polygon file for zip codes for the area or global zip code polygon (there any many free and paid sources) and identify the polygon your lay long falls in returning the zip code. You can use qgis,  arcgis , Mapinfo or from a wide range of software If you have too few points and they belong to many countries I would prefer the former approach as you can leverage someone else's infrastructure . If you have too many points in one country say US, the latter approach may be better

What is a good way to test for point polygon or polygon/polygon collisions in Python, for a space game? Rectangular or circular collisions are not precise enough.

Finding if two polygons Intersect in python?

Point-in-polygon test, 10GB of lat/lng, 2000 polygons currently takes 6 hrs with R-tree on ploygons. Any suggestions on how to speed up?

Submit queries in parallel to multiple machines.  If you're using PostGIS, set up a Postgres cluster.  Make sure each machine has at least 16GB of RAM.  Essentially, all of your data would fit in RAM this way.  Use a SSD too while you're at it.If you're using a service, pay them more money for more computational bandwidth, RAM, and iops.R-tree?  You'll want to use spatial index.  If PostGIS, use GiST.

Given a set of points, how do I find the polygon that is created from the edge points and encompass all of the remaining points?

What you’re asking about is called the “convex hull.” There are a number of algorithms for finding the convex hull:Convex hull algorithms - Wikipedia

Website Building Question about a zip code proximity calculator?

I think the simplest and cheapest solution will be to use Google MAPS API.
You need to make a call and will get response back.

Follow tutorial here:
http://briancray.com/2009/04/01/how-to-calculate-the-distance-between-two-addresses-with-javascript-and-google-maps-api/#finaljscode

Generally search for any API which can provide distance or radius between two postcodes (zip codes)

Algorithm for calculating areas on a map?

I've had to do this numerous times in the past myself, e.g. for screen rasterization or calculating the center of gravity for arbitrarily shaped polygonal objects. The simplest method I've found is to deconstruct the shape into monotone polygons, you can implement it with about 15 lines of code.

**UPDATE** Ok, that makes it a *little* bit more tricky, but not much. Converting from lattitude/longitude to 3D cartesian coordinates is straightforward:

x = cos(longtitude) * cos(latitude)
y = sin(longtitude) * cos(latitude)
z = sin(latitude)

Use the monotone polygon deconstruction algorithm I pointed you at and you'll be almost there. What you do in the last stage depends on whether you can treat those polygons as flat, or whether you have to take into account the curve of the earth's surface across the surface of the triangle.

If you can do the first method then you need to rotate each 3D triangle into a different space in which the triangle normal is perpendicular to the surface of the earth. This will set all z values to 0, effectively turning your 3D triangle2 into 2D ones, at which point you just apply the normal 2D area calculation. The second link below has more detail, along with some code.

If your lecturer (assuming that's what this is for) is a sadist and is making you calculate the area proper, taking earth's curvature into account, then you'll have to do it as a double-integral. Integrate over both longitude (x) and latitude (y), calculate the Cartesian coordinates of the four points f(x, y), f(x+dx, y), f(x, y+dy) and f(x+dx, y+dy) and then calculate the area of the resulting quad. Any 4-unit high school math student should find this quite manageable, otherwise head over to the Dr Math page and ask them for more info. Good luck!

Given coordinate of a polygon and a point. How do I compute if the point is located inside the polygon?

A polygon is a 2D-shape. Polygon P is a set of [math]p_i[/math] points [math](x_i,y_i)[/math]If the points are ordered counterclockwise (Figure 1), we may use the cross product property to define if a point q=(x,y) is inside P.We have to start with [math]p_0[/math] and compute the cross product:[math](p_0-q) \times (p_1-q)[/math]If this cross product is positive, then vector [math]\vec {qp_1}[/math] is counterclockwise from [math]\vec {qp_0}[/math]You have to calculate all cross products in this sequence as in Figure 2:[math](p_0-q) \times (p_1-q)[/math][math](p_1-q) \times (p_2-q)[/math][math](p_2-q) \times (p_3-q)[/math][math]\dots[/math][math](p_{n-1}-q) \times (p_n-q)[/math][math](p_n-q) \times (p_0-q)[/math]If all these cross products are positive, then point q in inside P.If some of them are negative, then q is outside P. Figure 3 shows case when point q is outside P.CROSS PRODUCTSYou will find this on “Introduction to Algorithms” (by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein pp. 1016):[math]p_1 \times p_2 = x_1y_2 - x_2y_1[/math]If [math]p_1 \times p_2[/math] is positive, then [math]p_1[/math] is clockwise from [math]p_2[/math] with respect to the origin (0,0). When cross product is negative, [math]p_1[/math] is counterclockwise from [math]p_2[/math].(*) [math]p_1[/math] is clockwise from [math]p_2[/math] with respect to the origin (0,0) is equivalent to say that [math]p_2[/math] is counterclockwise from [math]p_1[/math] with respect to the origin (0,0)If we need to check if [math]p_1[/math] is clockwise or counterclockwise from [math]p_2[/math] with respect to a common endpoint [math]p_0[/math], we then compute the cross product:[math](p_1-p_0) \times (p_2-p_0) = (x_1-x_0)(y_2-y_0) - (x_2-x_0)(y_1-y_0)[/math]If this cross product is positive, then [math]p_2[/math] is counterclockwise from [math]p_1[/math] with respect to the [math]p_0[/math].

How do you place rays on edges of a polygon so they point away?

Let’s get start with orthogonal vectors. Two vectors are orthogonal to each other if and only if their inner product is zero.The dot product or inner product of [math]a=(x_a,y_a)[/math] and [math]b=(x_b,y_b)[/math] is the number:[math]a \cdot b = x_ax_b + y_ay_b[/math][math]p_1[/math] and [math]p_2[/math] are orthogonals to [math]p[/math]. We choose the vector is clockwise from [math]p[/math], that is [math]p_1[/math] (as you want to point away from the polygon…as you will note later).Polygon P is a set of [math]p_i[/math] points [math](x_i,y_i)[/math], and I assume the points are ordered counterclockwise in your arraySo all you have to do is start by calculating the orthogonal vector clockwise from [math](p_1,p_0)[/math]:[math](p_1-p_0)=(x_1-x_0,y_1-y_0)[/math]Then, orthogonal vector clockwise from [math](p_1-p_0)[/math] is the vector with origin [math](0,0)[/math] and endpoint [math](y_1-y_0,-x_1+x_0)[/math]Orthogonal vector clockwise from [math](p_2-p_1)[/math] is the vector with origin [math](0,0)[/math] and endpoint [math](y_2-y_1,-x_2+x_1)[/math][math]\dots[/math][math]\dots[/math]Orthogonal vector clockwise from [math](p_n-p_{n-1})[/math]Orthogonal vector clockwise from [math](p_0-p_n)[/math]On the polygon above we have:On segment [math]p_op_1[/math]:(3-3,-4+1) = (0,-3). y<0, then is going downOn segment [math]p_1p_2[/math]:(1-3,-5+4) = (-2,-1). x<0, then is going left. y<0, then is going down[math]\dots[/math]On segment [math]p_7p_8[/math]:(13-9,-7+9) = (4,2). x>0, then is going right. y>0, then is going up

Do all polygons have a point such that all vertices are equidistant from this point?

Regular polygons do, because you can inscribe and circumscribe a circle around all regular polygons. Also any rectangle and any triangle. And any regular trapezoid. And any kite with 90 degrees connecting the mismatched lengths.Irregular polygons, parallelograms (non rectangular), kites (lacking lateral right angles), and any shape that cannot be inscribed with all of its vertices along the same circle… will not have a point that is equidistant from all vertices.

How can you find the lat/long coordinate of a certain point in Android Google Maps?

This work around might help.1. Open Google Map , pinned the place you want the coordinate.2. Under the pinned information there are 2 options 'star' and 'share' , select 'share' to text app, like Massaging.3. You'll find the shorten url like //goo. Copy and paste i Chrome.4. The browser will pop up for using Maps app, select it.5. Your desired coordinate will be in the Maps search bar, use it as you want.

TRENDING NEWS