polygon

Google maps display polygon

Hello all If i enter in google maps a point with this format:40.77065496240177 22.69926567871095 it will display a point in the map. How can i enter a polygon in the same way. I ask this to check the validity of the polygon and to visualize. Also if this is not visible i google maps is it more easier in google earth? ...

GPC Polygon Initialization

I am using the GPC Polygon Clipping lib and want to create a polygon programatically. I only see code for how to create one from a file. How can I do the initialization in my code? ...

Library for polygon operations

I've recently encountered a need for a library or set of libraries to handle operations on 2D polygons. I need to be able to perform boolean/clipping operations (difference and union) and triangulation. So far the libraries I've found are poly2tri, CGAL, and GPC. Poly2tri looks good for triangulation but I'm still left with boolean ope...

SQL Geography River Removal

How do you remove the 'holes'/linestrings/.etc from a GeographyCollection? Secondary, how do you join MPolygons that don't intersect into one polygon? We have a roll up of zipcodes to a geographic map, but we have holes in the shape. Researched this and that, but I have not found a good way to remove the inner holes. ConvexHull creat...

How to create closed areas (convex polygons) from set of line segments ?

The following problem is in 2D, so some simplifications can be made when suggesting answers. I need to create closed areas (defined either by line segments or just set of points - convex polygon) from a set of points/line segments. Basically I used Voronoi to generate "roads". Then I changed some of the data. Now I need a way to loop t...

How to detect if a marker is inside a polygon in google maps

I've got loads of coordinates for a polygon in a database. I also have coordinates for an marker in my database. How do i detect if the marker is inside this polyon. Note: I use a cronjob to move the marker, and in this cronjob it needs to detect this. So javascript isn't involved! Shape of polygon is not just a circle or square. It c...

How to get the center of a polygon in google maps v3?

It doesn't need to be 100% correct, it can be the center of the bounding rectangle. Thank you in advance ...

Point of latitude and longitude inside a complex spherical polygon

Question What R package has a function that can determine if a coordinate is within a closed, complex spherical polygon (i.e., a point inside a polygon on Earth's surface)? Related Links JPL: Formulae and explanation Java: Spheres software SO: Point inside or outside polygon SO: Point straddling the meridian SO: Point in polygon hit ...

Where are the standard C implementations of sutherland-hodgman polygon clipping algorithm?

I have implemented my version of sutherland-hodgman polygon clipping algorithm, but I believe my implementation could be better. So I am wondering whether there is a standard implementation. Here is my implementation bool shclip(stPt** verts, int *n, float left, float right, float bottom, float top) { if (leftclip(verts, n, left) && ...

SDL: Performance SPriG vs SDL_gfx

Hi, I need to draw a polygon with thick lines. Now I have two possibilities: Draw them with the library SPriG, which provides line thickness. Split up the polygon in all it lines and draw them as polygons with a modified thickness (like explained in this tutorial (1 tutorial on the page).) with the SDL_gfx library. I'm not sure abou...

Google maps api,Postgis,Multipolygon

Hello all PostGis WKT format of Multipolygon is: MULTIPOLYGON( ((20.229 39.409,20.2241 39.401,20.220 39.410,20.229 39.409)), ((20.209 39.407,20.223 39.400,20.211 39.402,20.209 39.4076)) ) Google Maps api v3 Polygon is: var triangleCoords = [ new google.maps.LatLng(25.774252, -80.190262), new google.maps.LatLng(18.466465, -66....

Drag (move) a polygon using Google Maps v3

The Google Maps API for a Polygon does not offer a drag method. What would be an efficient way of implementing such a feature (i.e., sufficiently optimised so that it would not kill a four year old laptop)? Thank you! ...

library for representing 3D polyhedra

Are there any libraries that provide 3D polyhedra, and support calculating the intersection of two polyhedra? If it makes a difference, the polyhedra I want to model do not have 'holes' in them. The focus would be on correctness first and speed a close second! Ideally this library would: have existing tidy python bindings be free-st...

{R grid}: how to create a polygon half filled with color ?

(This question might be too difficult, and maybe not worth the hassle to solve - however, if there is an easy solution - I would be curious to know) Let's say I create an image (using the grid package) which looks like this: require(grid) grid.newpage() grid.polygon(x=c((0:4)/10, rep(.5, 5), (10:6)/10, rep(.5, 5)), y=c(rep...

Postgis random point inside a polygon

Hello all If i have a polygon in Postgis how can i find-calculate random points inside this polygon? ...

How Do I Calculate the Area of a Polygon in a MySQL Database When the Polygon's Points are Lat Longs?

Hi, How do I calculate the area of a polygon stored in a MySql database? The polygons' points are lat longs. So, degrees and minutes seem to be causing a problem. I've tried: SELECT AREA( my_polygon ) FROM `my_table` WHERE name = 'Newport' Because, the points are lat longs, I get weird results. (I'm not able to switch to Post...

Calculating the Area of a Polygon When the Polygon's Points are Lat Longs: Which Function is More Accurate?

Hi, I'm trying to find a way to calculate the area of a polygon using lat long coordinates in a Flex 3 site. Hong007 on Google Maps for Flash group was cool enough to post the following function: private function GetPolygonArea (polygon : Polygon):Number { var nVer : int = polygon.getOuterVertexCount(); ...

Help me understand Java Polygon Fill oddness

I am working with drawing polygons based on a given line. I have the logic working out well except in cases where it appears that the polygon intersects itself. However, it doesn't seem to be 100% consistent, nor does it make sense based on what I'm reading. Below are two images created using the same code. The yellow polygons are the on...

Is there a linear-time algorithm for finding the convex hull of a complex polygon?

I know there's a worst-case O(n log n) algorithm for finding the convex hull of a complex polygon and a worst-case O(n) algorithm for finding the convex hull of a simple polygon. Is there a worst-case O(n) algorithm for finding the convex hull of a complex polygon? A complex polygon is a polygon where the line segments may intersect. ...

How to draw an incomplete Polygon using Java

What I am looking to do is to draw an incomplete polygon using Java. I have figured out how to draw only the polygon in one shot, or even fill the polygon. I can also draw the incomplete polygon by using line segments but the problem with this is the BasicStroke.JOIN_BEVEL does not apply to line segments. Here is how I do it with the lin...