polygons

Combine Voronoi polygons and maps

杀马特。学长 韩版系。学妹 提交于 2019-11-28 20:43:40
I would like to combine Voronoi polygons with map, in order to use this later for spatial analysis. I have number of points and shapefile that i want to combine and then save as shapefile/spatial polygons. To get voronoi polygons i use function from this topic . My code is as follows: coords<-data.frame(LONG=c(16.9252,16.9363,16.9408,16.8720,16.9167,16.9461,16.9093,16.9457,16.9171,16.8506,16.9471,16.8723,16.9444,16.9212,16.8809,16.9191,16.8968,16.8719,16.9669,16.8845), LAT=c(52.4064,52.4266,52.3836,52.3959,52.4496,52.3924,52.4012,52.3924,52.3777,52.4368,52.4574,52.3945,52.4572,52.3962,52.3816

Finding adjacent polygons in R (neighbors)

蓝咒 提交于 2019-11-28 17:33:10
问题 I'm starting with a SpatialPolygonsDataFrame which has the data to create a map of the districts of Ghana (available at http://www.diva-gis.org/datadown). I'm trying to create a matrix with the names of the districts as row and column names and 0s/1s in the interior to indicate if two districts are adjacent (neighboring) or not. I've found several functions in spdep that seem promising, but I can't figure out how to use them for this purpose. I was able to create a "nb" file with the data

Marker cluster number in a polygon or/and infowindow

☆樱花仙子☆ 提交于 2019-11-28 11:50:34
When you click on some polygon you got infowindow with the name of these polygon, is possible to put in this infowindow number of markers inside this polygon (same like marker cluster number) or to put this number (marker cluster number) on the polygon? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <link rel="stylesheet" type="text/css" href=

Holes in a Polygon

こ雲淡風輕ζ 提交于 2019-11-28 11:48:23
问题 First off to those that want to make a comment about my low acceptance rating...im new, give me a break. I added this polygon code from this website: http://www.geocodezip.com/v3_polygon_example_donut.html There is an issue though, the radius is not accurate. So if I measure the distance between 2 cities, then draw this circle, it is way off, and gets worse the larger the circle. Any ideas? <script type="text/javascript"> function drawCircle(point, radius, dir) { var d2r = Math.PI / 180; //

Merging multiple adjacent rectangles into one polygon

梦想的初衷 提交于 2019-11-28 05:03:31
Background : I am working on a site for small shopping center, which has multiple rectangular "units" to rent. When a "shop" comes, it can rent one or multiple "units", and I'd like to generate a map consisting of shops (sans unrented units) Problem : I have a list of rectangles ( units ), defined by pairs of points – [[lefttop_x;lefttop_y];[rightbottom_x;rightbottom_y]] – and I want to merge them into polygons, so I can properly style them (which I will then render via Canvas/SVG/VML/Raphael.js). Units are always rectangles Units have different sizes Units are always adjacent (there is no

google maps API v3 - how to draw dynamic polygons/polylines?

白昼怎懂夜的黑 提交于 2019-11-28 03:35:50
I have 4 days of experience with Google Maps Javascript API and i find their documentation and information sharing confusing at best. Does anyone have experience or knowledge on how to draw polygons/polylines on a google map (using Javascript API V3) similar to this example? (which i found on this blogPost from 2008) So far as my research can tell me the example uses the Javascript API V2 directly or uses the GeometryControl utility library from V2 (which can be found here for reference). I cannot seem to find if the Javascript API V3 has any way of allowing such interface. I will be

Intersection of polygons

血红的双手。 提交于 2019-11-27 23:11:31
There are two polygons given. how can one determine whether one polygon is inside, outside or intersecting the other polygon? Polygons can be Concave or convex. argentage You want to use the separating axis theorem for convex polygons. Basically, for each face of each polygon you project each polygon onto the normal of that face and you see if those projections intersect. You can perform various tricks to reduce the number of these computations that you have to perform- for example, you can draw a rectangle around the object and assume that if two objects' rectangles do not intersect, they

How to simplify a single complex UIBezierPath polygon in iOS

為{幸葍}努か 提交于 2019-11-27 22:27:34
问题 Problem: I have a user generated polygon (via registering user's touches on screen) which can be simple or complex (complex means having unknown number of intersections) and I want to have a simple polygon resulting from the same points on the original polygon, something like an outline or a contour if you will. Possible solutions: I have found this, but it is a JavaScript solution and this is a perfect illustration of what I need but in ActionScript! I don't need the Path itself, the points

How do I find the polygon nearest to a point in R?

做~自己de王妃 提交于 2019-11-27 13:16:12
问题 I have a spatial points data frame and a spatial polygons data frame. For example, my polygons would be a polygon for each block in Manhattan. And the points are people, which are scattered all over, sometimes falling in the middle of a street, which is not part of a polygon. I know how to check if a point is contained inside a polygon, but how could I assign points to their closest polygon? ## Make some example data set.seed(1) library(raster) library(rgdal) library(rgeos) p <- shapefile

Getting a bounded polygon coordinates from Voronoi cells

爱⌒轻易说出口 提交于 2019-11-27 13:09:01
问题 I have points (e.g., lat, lon pairs of cell tower locations) and I need to get the polygon of the Voronoi cells they form. from scipy.spatial import Voronoi tower = [[ 24.686 , 46.7081], [ 24.686 , 46.7081], [ 24.686 , 46.7081]] c = Voronoi(towers) Now, I need to get the polygon boundaries in lat,lon coordinates for each cell (and what was the centroid this polygon surrounds). I need this Voronoi to be bounded as well. Meaning that the boundaries don't go to infinity, but rather within a