polygons

How to except area from polygon in google maps api

余生长醉 提交于 2019-12-11 07:18:44
问题 I have coordinates of two polygons (P1 and P2) to create it on google maps. How cut P2 from P1 when P2 is located in P1? For example http://quality.iro38.ru/CI/question_about_map.php This is my js: var triangleCoords = [ new google.maps.LatLng(25.774252, -80.190262), new google.maps.LatLng(18.466465, -66.118292), new google.maps.LatLng(32.321384, -64.75737), new google.maps.LatLng(25.774252, -80.190262) ]; var triangleCoords1 = [ new google.maps.LatLng(29,-69), new google.maps.LatLng(23,-72),

Clipper does not create hole when making a union

三世轮回 提交于 2019-12-11 05:47:44
问题 I have the following code: class Program { static void Main(string[] args) { Polygon a = new Polygon(); a.Add(new IntPoint(0,0)); a.Add(new IntPoint(2,0)); a.Add(new IntPoint(2,1)); a.Add(new IntPoint(1,1)); a.Add(new IntPoint(1,2)); a.Add(new IntPoint(2,2)); a.Add(new IntPoint(2,3)); a.Add(new IntPoint(0,3)); Polygon b = new Polygon(); b.Add(new IntPoint(2,0)); b.Add(new IntPoint(3,0)); b.Add(new IntPoint(3,3)); b.Add(new IntPoint(2,3)); PolyTree solution = new PolyTree(); Clipper c = new

Creating spatialpolygons dataframe from list of polygons

痴心易碎 提交于 2019-12-11 05:07:10
问题 I am currently trying to create a polygon shapefile from a list of polygons (study areas for biodiversity research). Currently these polygons are stored in a list in this format: $SEW22 [,1] [,2] [1,] 427260.4 5879458 [2,] 427161.4 5879472 [3,] 427175.0 5879571 [4,] 427273.9 5879557 [5,] 427260.4 5879458 $SEW23 [,1] [,2] [1,] 418011.0 5867216 [2,] 417912.0 5867230 [3,] 417925.5 5867329 [4,] 418024.5 5867315 [5,] 418011.0 5867216 I tried to simply write them as shpfile with writeOGR but the

How to intersect multiple polygons?

孤街浪徒 提交于 2019-12-10 22:47:58
问题 I am looking for an algorithm with the following input and output: Input: A set of polygons in a plane. E.g. P1...Pn and S. (P1...Pn might be concave, S is convex.) Output: The area of theset of polygons in this plane that equals the difference of S and the union of P1...Pn. I found algorithms to intersect or merge TWO polygons. But since each of those operations might produce several polygons I createt tons of polygons if I did it naively. So: How to handle the intersection of multiple

Union of many (more than two) polygons without holes

送分小仙女□ 提交于 2019-12-10 14:56:21
问题 Im creating union of polygons without holes. Input polygons are without holes and also output one should be. I already have working algorithm for finding it for two polygons. But in case of more than two there is a problem. As an union shouldn't be disjoint polygon, when I try to compute sum of them one by one I have a problem in such case: Then polygon 1 meets polygon 2 the union is disjoint (so my algorithm does not compute sum). In second loop ofc it makes union with 3rd and 4th polygon,

Can I convert an image to CSS3?

偶尔善良 提交于 2019-12-10 13:09:03
问题 Supposing that I have a polygon image PNG file like this (No border, the shape is filled with one color, no gradient, and background of the image is transparent) http://www.enchantedlearning.com/crafts/books/shapes/gifs/4.GIF I'm thinking of using that polygon image as a background image and it will be changed (to another image with different color) when the user hovers on it. But I also want the color of the background image to be customizable. So, I'm thinking if there is any possibility to

Cut polygons using contour line beneath the polygon layers

偶尔善良 提交于 2019-12-10 02:49:58
问题 I would like to cut a polygon layer, according to the elevation, into two parts (upper and lower part). The polygon might convex or concave, and the position to cut might vary from each other. The contour line has an interval of 5m, which means I might need to generate a contour with much condensed contour lines, e.g, 1m interval. Any idea on how to do it, better in ArcGIS, or in R? Below is the running example for the Q: library(sp) library(raster) r<-raster(ncol=100,nrow=100) values(r)<-rep

POSTGIS: find all the points within a polygon

巧了我就是萌 提交于 2019-12-08 01:39:02
问题 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

Leaflet: How to display markers behind polygons?

扶醉桌前 提交于 2019-12-07 21:45:18
问题 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? 回答1: 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 )

problems when unioning and dissolving polygons in R

青春壹個敷衍的年華 提交于 2019-12-07 21:07:00
问题 Sometimes, when working with SpatialPolygons in R with the sp and rgeos packages, I run into problems when subsetting and dissolving these polygons. This example shows the types of problems I have had, though I've had it happen with other datasets too. require(maptools) require(rgeos) data(wrld_simpl) countries <- c("Argentina","Bolivia","Brazil","Chile","Colombia","Ecuador","Guyana","Paraguay","Peru","Suriname","Uruguay","Venezuela") SAmerica <- subset(wrld_simpl,wrld_simpl@data$NAME ==