polygons

android maps v2 polygon transparency

北城以北 提交于 2019-12-07 05:15:27
问题 I'm using Google Maps v2 API for android and I don't manage to control the transparency of the fillColor. I would like to be able to see the map under a filled polygon. Is there a way to do that ? Thanks for any help ! 回答1: Well, let me describe how standard 4 bytes color is encoded: Standard pixel color consists of 4 bytes: A (alpha channel) - 0-255 (0 - fully transparent, 255 - fully opaque) R (red color channel) - 0-255 G (green color channel) - 0-255 B (blue color channel) - 0-255 Each

“snapping” polygons together

半世苍凉 提交于 2019-12-07 03:35:42
问题 I have a set of polygons representing administrative districts. The districts were digitized by hand, and there are small spaces between polygons where the polygons should be touching. There are probably also overlapping polygons. How can I have the polygons snap together, filling the gaps and removing overlap? QGIS / ArcGIS or Python library solution preferred (but algorithm suggestions welcome) 回答1: Old school ArcInfo had a "clean" function - I think they did the same thing in geoprocessing

Split polygon parts of a single SpatialPolygons Object

随声附和 提交于 2019-12-06 20:17:27
问题 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 to do this? EDITED: Using the following example provided in the sp package: # simple example, from vignette("sp"): Sr1 = Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2))) Sr2 = Polygon(cbind(c(5,4,2,5),c(2,3,2,2))) Sr3 = Polygon(cbind(c(4,4,5,10,4),c(5,3,2

Converting a polygon with holes into multiple simple polygons without holes

白昼怎懂夜的黑 提交于 2019-12-06 19:39:25
问题 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 triangulation and rejoin the triangles into bigger polygons. Like so: But the delaunay triangulation and even more the constraining part tends to fail for difficult input because of floating point precision and algorithmic instabilities. My input

Finding the intersection of two 3D polygons

一笑奈何 提交于 2019-12-06 18:34:58
问题 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 the sutherland-hodgman clipping algorithm Having been unable to find any 3D implementations or pseudo code on the internet I am now asking here (and attempting to answer my own question) The algorithm would take two shapes such as those shown below:

Leaflet: How to display markers behind polygons?

我们两清 提交于 2019-12-06 08:38:28
I need icons (PNG) and polygons on my map. So I create icons as markers and polygons as polygons. Unfortunately regardless of creation order polygons are displayed "below" markers. I need is vice-versa. Is there a way, how to do it? ghybs EDIT: Correct default panes order in Leaflet 0.x: (from top-most to bottom-most) objectsPane popupPane markerPane <= all markers icon (other than L.CircleMarker ) shadowPane <= all markers icon shadow overlayPane <= all vectors (including L.CircleMarker ) tilePane So just using the marker's icon shadow is not enough. You have to manually change the z-index of

Draw a polygon colored like this in R or Matlab

梦想的初衷 提交于 2019-12-06 07:08:05
问题 http://www.texample.net/tikz/examples/lindenmayer-systems/ My sample code shown below, I don't know how to colored with hue color. plot.koch <- function(k,col="blue"){ plot(0,0,xlim=c(0,1), ylim=c(-sqrt(3)/6,sqrt(3)/2), asp = 1,type="n",xlab="", ylab="") plotkoch <- function(x1,y1,x2,y2,n){ if (n > 1){ plotkoch(x1,y1,(2*x1+x2)/3,(2*y1+y2)/3,n-1); plotkoch((2*x1+x2)/3,(2*y1+y2)/3,(x1+x2)/2-(y1-y2)*sqrt(3)/6,(y1+y2)/2-(x2-x1) *sqrt(3)/6,n-1); plotkoch((x1+x2)/2-(y1-y2)*sqrt(3)/6,(y1+y2)/2-(x2

POSTGIS: find all the points within a polygon

醉酒当歌 提交于 2019-12-06 04:08:18
I have a table containing point CREATE TABLE Points { pointID BIGSERIAL PRIMARY KEY NOT NULL, thePoint GEOGRAPHY(POINT) } CREATE TABLE Polygons { polygonID BIGSERIAL PRIMARY KEY NOT NULL, aPolygon GEOGRAPHY(POLYGON) NOT NULL, } I wish to find all the points that are contained in each polygon. i.e the result should look like polygonID| pointID ------------------- 1 | 1 1 | 2 1 | 5 1 | 7 2 | 2 2 | 3 ... I managed to go point by point and to figure out if it's in the polygon using ST_CoveredBy(thePoint, aPolygon) . Based on that the naive solution is going in a nested loop over all points and

Is there a more efficient way to detect polygon overlap/intersection than PathGeometry.FillContainsWithDetail()?

给你一囗甜甜゛ 提交于 2019-12-06 02:23:30
问题 I have a method that is gobbling up 25% of my cpu time. I call this method about 27,000 times per second. (Yup, lots of calls since it's updating frequently). I am wondering if anybody knows a faster way to detect if 2 polygons overlap. Basically, I have to check the moving objects on the screen against stationary objects on the screen. I am using PathGeometry and the two calls below are using up 25% of the cpu time used by my program. The PointCollection objects I am passing just contain 4

google maps polygons - overlay

℡╲_俬逩灬. 提交于 2019-12-05 23:17:49
I am attempting to implement a "negative" overlay on my google maps, similar to the effect that you get at estately.com. Basically, I have successfully drawn up mapping polygons from the KML data I've gathered. When there are multiple paths, they draw up just fine. So, modeling the example I have, first I create a set of polyLines around my area from polygonCoords (which is an array of arrays of LatLng objects): for (var d = 0 ; d < polygonCoords.length ; d++) { var b = new google.maps.Polyline( { path: polygonCoords[d], strokeWeight: 4, strokeColor: "#4F6D8F", strokeOpacity: 1, map: map }); }