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.

474 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,296
  • 3
  • 20
  • 38
25
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.
  • 317
  • 1
  • 3
  • 7
23
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,811
  • 9
  • 48
  • 81
22
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,078
  • 1
  • 8
  • 16
17
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
  • 2,297
  • 5
  • 29
  • 50
15
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,751
  • 4
  • 18
  • 23
15
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,786
  • 3
  • 22
  • 41
14
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
  • 163
  • 2
  • 8
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,771
  • 4
  • 17
  • 30
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,590
  • 2
  • 16
  • 35
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,255
  • 1
  • 28
  • 43
13
votes
1 answer

How to add labels on top of polygons in leaflet

I am working with the leaflet R package. I have a zoning system made of polygons and I'd like to lay their IDs on top of them. Below is an illustration (with another software) of my objective. Thanks for your suggestions!
wrocg
  • 145
  • 1
  • 1
  • 4
13
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
  • 749
  • 3
  • 8
  • 21
13
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
  • 329
  • 4
  • 8
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
  • 16,906
  • 5
  • 52
  • 77
1
2 3
31 32