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
5
votes
2 answers

Find best matching overlapping polygons in R

I have two shapefiles that I have read into R using readOGR() as SpatialPolygonsDataFrame objects. Both are maps of New Zealand with different internal boundaries. One has about 70 polygons representing territorial authority boundaries; the other…
Peter Ellis
  • 5,694
  • 30
  • 46
5
votes
2 answers

Fast algorithm to uncross any crossing edges in a set of polygons

I have a number of polygons each represented as a list of points. I'm looking for a fast algorithm to go through the list of polygons and uncross all of the crossed edges until no crossed edges remain. Psudocode for current version: While True: …
Nuclearman
  • 5,029
  • 1
  • 19
  • 35
5
votes
3 answers

Given an irregular polygon's vertex list, how to create internal triangles to build a flat 3D mesh efficiently?

I'm using Unity, but the solution should be generic. I will get user input from mouse clicks, which define the vertex list of a closed irregular polygon. That vertices will define the outer edges of a flat 3D mesh. To procedurally generate a mesh in…
Petruza
  • 11,744
  • 25
  • 84
  • 136
5
votes
1 answer

Save Latitude/Longitude of polygons With Google Maps V3

for a service providers website I am using the code below (stole it from here) to display a map and draw areas each provider covers. How can i return and store the arrays of latitudes/longitudes of each shape i draw? i need to save it into database…
Eyal
  • 108
  • 3
  • 10
4
votes
1 answer

Algorithm to Decompose Complex Polygons

I am trying to create the polygons for a Doom 2 level from the information contained in the WAD file. I have the walls done, all that is left is the 'flats', the floor and ceiling areas. A Doom map is divided into 'sectors', each evaluates to a…
Jim Noble
  • 492
  • 6
  • 12
4
votes
1 answer

Coordinate Reference System of Raster & Polygons in R

I have several polygons & I like to extract mean values from several raster layers within these polygons. When I added those to ArcMap I realized that the projections of the two data types do not match. I could solve the problem for the display in…
te_ar
  • 115
  • 1
  • 13
4
votes
2 answers

How to efficiently convert a set of geohashes into a polygon?

I have been looking for a efficient way to convert a set of geohashes into polygons in Python, besides sometimes I obtain multipolygons instead of polygons, probably because some inner geohashes are missing. I am currently using python-geohash and…
Alberto Bonsanto
  • 17,556
  • 10
  • 64
  • 93
4
votes
3 answers

Constructing the contour of a polygon (in particular a triangulation)

How would I go about constructing the contour of 2d polygon which is formed of only triangles and it can have holes and the external contour can be concave/convex and the holes can also be concave/convex. From what I'm reading over here it seems…
xxxxxxx
  • 5,037
  • 6
  • 28
  • 26
4
votes
3 answers

Thousands of polygons in Android Google Maps API burden the main thread

I'm developing an app to draw a movement path from given GPS location from a text file. So far, i'm successfully be able to load the data and draw the path. My solution is, the path must be drawn to a rectangle because it contain data (e.g color…
luca ditrimma
  • 765
  • 1
  • 7
  • 22
4
votes
1 answer

How to calculate the normal of points on a 3D cubic Bézier curve given normals for its start and end points?

I'm trying to render a "3D ribbon" using a single 3D cubic Bézier curve to describe it (the width of the ribbon is some constant). The first and last control points have a normal vector associated with them (which are always perpendicular to the…
Robert
  • 5,735
  • 3
  • 40
  • 53
4
votes
3 answers

Adjacency or Edge List to Faces

How to go from an edge list or adjacency list representation of a planar graph to a face list? For example, with this graph (which is not 0-indexed, oddly enough): I'd want a list that looks something like…
user4159038
4
votes
1 answer

CUDA efficient polygons fill algorithm

I need efficient fill algorithm to fill closed polygons (like ex. Scanline fill), which I can run on CUDA. Have you got any suggestions? Thanks in advance for any replays!
MattheW
  • 808
  • 11
  • 25
4
votes
1 answer

OpenGL Smooth Polygon

I am trying to make this a smooth polygon using OpenGL, but it is not doing anything. Can someone please explain what I am doing wrong? glColor4ub(r, g, b, a); glEnable(GL_POLYGON_SMOOTH); glHint(GL_POLYGON_SMOOTH_HINT,…
Matt
  • 1,151
  • 3
  • 13
  • 34
4
votes
1 answer

Is it possible to check if a polygon intersects with itself using Clipper?

Can I use Clipper to check if my polygon contour intersects with itself (if it is a complex or a simple polygon)? I know that it does not make the polygon invalid, but in my case I want to avoid self intersecting polygons.
arthur.sw
  • 11,052
  • 9
  • 47
  • 104
4
votes
2 answers

Distance To Move Two Polygons So They Touch Edges

Best described in the image below. I need to know the minimum distance to move a reference polygon (shown in red) in one axis (just y) such that will just touch the other polygon. If it's inside the polygon, it will need to move outwards. I tried…
Jacob Parker
  • 111
  • 7