Questions tagged [polygons]

Polygons are multi-sided objects. This heading should be used when describing issues involving multiple polygons and how they relate to each other, for example, overlap detection.

Polygons are multi-sided objects. This heading should be used when describing issues involving multiple polygons and how they relate to each other, for example, overlap detection.

478 questions
25
votes
6 answers

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

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…
David 'the bald ginger'
  • 1,276
  • 3
  • 20
  • 37
24
votes
2 answers

Finding adjacent polygons in R (neighbors)

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…
Megan E.
  • 297
  • 2
  • 6
19
votes
4 answers

Identify if point is in the polygon

As per my requirement, I am drawing polygons on google map shown in the image below.(using maps v2) Now I need to show an alert when user enters that particular polygons. How to identify if my current location is with in the polygon. (Need…
Supriya
  • 1,000
  • 1
  • 7
  • 16
18
votes
5 answers

Merging multiple adjacent rectangles into one polygon

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…
Adam Kiss
  • 11,411
  • 8
  • 46
  • 79
17
votes
2 answers

How do I Add and Remove Polygons on Google Maps v3?

I'm trying to show and remove polygons onto a Google Map, using v3 of the API. In my JavaScript, I've already got an MVCArray of some custom Lat-Longs. I'm trying to figure out how to add these polygons and then, based upon some other JavaScript…
Pure.Krome
  • 78,923
  • 102
  • 356
  • 586
16
votes
2 answers

Getting a bounded polygon coordinates from Voronoi cells

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…
amaatouq
  • 1,817
  • 3
  • 24
  • 46
14
votes
2 answers

Voronoi diagram polygons enclosed in geographic borders

I am trying to create Voronoi polygons (aka Dirichlet tessellations or Thiessen polygons) within a fixed geographic region for a set of points. However, I am having trouble finding a method in R that will bound the polygons within the map borders.…
Bryan
  • 1,517
  • 3
  • 16
  • 29
14
votes
2 answers

Dissolve holes in polygon in R

I am running some geoprocessing tasks in R, in which I am trying to create some polygons for clipping rasters of environmental information. I am buffering somewhat complex polygons, and this leaves small subgeometries that I would like to get rid…
Pascal
  • 1,448
  • 2
  • 14
  • 33
14
votes
1 answer

Combine Voronoi polygons and maps

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…
Maciej
  • 3,105
  • 1
  • 24
  • 43
13
votes
1 answer

Drawing Polygons in Swift

I need to highlight an irregular shape when the user taps on it. My idea on how to do it was to draw a polygon that matches the shape, fill it with a color and change the opacity to make it translucent. Unfortunately I can't find anything on how…
Floyd Resler
  • 1,542
  • 3
  • 19
  • 36
13
votes
1 answer

Finding the intersection of two 3D polygons

a.k.a. Polygon clipping algorithm in 3D a.k.a. Finding the collision manifold between 2 colliding polygons Most algorithms for polygon clipping are described in detail for 2D and described as being extendable to 3D but without details. For example…
Richard Tingle
  • 15,728
  • 5
  • 47
  • 71
12
votes
2 answers

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

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,…
Kiefer
  • 143
  • 1
  • 8
12
votes
4 answers

Split polygon parts of a single SpatialPolygons Object

In R, I have single SpatialPolygons object (i.e. multi-polygons) containing several hundred polygons. I would like to split this SpatialPolygons object into a list of Polygons (i.e. holes should remain attached to the parent polygon). Any idea how…
jatobat
  • 679
  • 3
  • 8
  • 19
12
votes
1 answer

How to fill a polygon with a custom hatch in matplotlib?

I'm using python and matplotlib to create several closed polygons. I then need to fill them with a hatch, which can be done through…
Josiah
  • 319
  • 6
  • 8
11
votes
2 answers

Converting a polygon with holes into multiple simple polygons without holes

I am dealing with IfcFace. I'm given a simple polygon with holes and I need to convert it into multiple simple polygons without holes for my CAD to further process it. A little demo ilustration: My best approach is to do a constrained delaunay…
Dominic Hofer
  • 5,178
  • 4
  • 14
  • 23
1
2 3
31 32