polygon

Programmatically drawing polygons on a map by joining the outermost markers

只谈情不闲聊 提交于 2019-12-11 11:09:34
问题 I have a sample map layer in this fiddle where the map layer is drawn using fusion table as, var Layer = new google.maps.FusionTablesLayer({ query: { select: 'lat', from: '1BLPDF4n0sW0i0BfD9Yo0DqbshyTH1s5Iuu_1IeU' }, map: map, suppressInfoWindows: true }); How can I draw a polygon programmatically by joining the outermost markers in the map so that if someone add new marker and if it is falling outside the drawn polygon then automatically the polygon should redraw to include the newly added

Create complex polygon with javascript

寵の児 提交于 2019-12-11 10:37:01
问题 I want to create a polygon by route direction like here: http://i.imgur.com/olGmuN6.png so I write this: directionService.route(request, function(result, status) { if (status == google.maps.DirectionsStatus.OK) { directionsRenderer.setDirections(result); var r = []; var z = 0.5; var bla = result.routes[0].overview_path; for(var i=0 in result.routes[0].overview_path) { r.push(new google.maps.LatLng(bla[i].lat()+z, bla[i].lng()-z)); } bla.reverse(); for(var x=0 in bla) { r.push(new google.maps

How to split a polygon and fill areas along skew values?

ε祈祈猫儿з 提交于 2019-12-11 10:28:09
问题 I know how to split and fill areas of a polygon along a horizontal line, if the values are quite simple. x <- 9:15 y1 <- c(5, 6, 5, 4, 5, 6, 5) plot(x, y1, type="l") abline(h=5, col="red", lty=2) polygon(x[c(1:3, 5:7)], y1[c(1:3, 5:7)], col="green") polygon(x[3:5], y1[3:5], col="red") y2 <- c(5, 6, 4, 7, 5, 6, 5) plot(x, y2, type="l") abline(h=5, col="red", lty=2) But how to get the result if the values are a bit more skew? Expected output (photoshopped): 回答1: As pointed out by @Henrik in

Solr Spatial search with self-intersecting polygons

喜夏-厌秋 提交于 2019-12-11 10:27:46
问题 I’m using Solr 4.3.0 with an up to date version of JTS and spatial4j. As field type in my schema.xml i’m using “location_rpt” like the description in the documentation. Documentation <field name="standort" type="location_rpt" indexed="true" stored="true" /> Now when my Application create a FilterQuery like this standort:"IsWithin (POLYGON((16.243972778320312 48.27016879304729, 16.411170959472656 48.268340583150504, 16.44275665283203 48.19058119922813, 16.32396697998047 48.15921534239267,16

How to paint / deform a QImage in 2D?

雨燕双飞 提交于 2019-12-11 10:04:41
问题 I have a code that manipulates and renders a QImage onto a QWidget . Manipulation includes typical homogeneous transformations as well as clipping, applying a color-transfer function, etc. Now I have to deform the image onto a four-vertices polygon (a quad), not necessarily a rectangle. To be clear, I'm not talking about clipping the image, but deforming it. I know how to do it using OpenGL (a textured quad), but I wonder if it is possible to do it without switching to OpenGL. Does Qt have

Hover on areas not on point in Highchart-polygon

我与影子孤独终老i 提交于 2019-12-11 09:58:23
问题 I have one chart and i want to include hover on area but i found it works only on point only. series: [{ name: 'Target', type: 'polygon', data: [[153, 42], [149, 46], [149, 55], [152, 60]], color: Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0.5).get(), enableMouseTracking: true }], tooltip: { headerFormat: '<b>{series.name}</b><br>', pointFormat: '{point.x} cm, {point.y} kg' } http://jsfiddle.net/onhfLqdm/3/ As area is bounded by points so how can i hover area instead of

error in mask a raster by a spatialpolygon

混江龙づ霸主 提交于 2019-12-11 09:57:01
问题 I have raster of the following features: library(raster) library(rgeos) test <- raster(nrow=225, ncols=478, xmn=-15.8, xmx=32, ymn=-9.4, ymx=13.1) I want to mask in this raster the cells that are within a given distance of a point. I create the spatial points as followed: p2=readWKT("POINT(31.55 -1.05)") Then I create a spatial polygon object by adding a 0.5 buffer: p2_Buffered <- gBuffer(p2, width = 0.5) mask(test, mask=p2_Buffered,inverse=T) When I mask my raster given this spatial object,

Determine ordering of polygon 3D

前提是你 提交于 2019-12-11 09:03:42
问题 I have a list of vertices 3D, creating a polygon. I need to triangulate it and i use the cutting ears algorithm. My polygons are non-convex, so i need to find the concave angles in the polygon. I also dont know wich orientation are my polygons ( clockwise or counter clocwise) Could anyone help me how to determine if is clockwise or counter clockwise Thank you 回答1: It's probably simplest to project the polygon into a convenient plane (say z=0) and then use a method like reinier's. 1) Set all z

Draw a convex hull using the given points in java/android

与世无争的帅哥 提交于 2019-12-11 08:41:22
问题 I have some 2D points given and i want to draw a polygon using those points. This polygon must pass through all the given points means there is no such point which is inside or outside the polygon. For example: if i have points like: (0,0), (1,1), (-1,-1),(-1,1) and (1,-1) and if i want to draw a polygon using those then my points array should be sorted in following manner: (1,1) -> (1,-1) -> (-1,-1) -> (-1,1) -> (0,0) -> (1,1) OR (1,1) -> (0,0) -> (-1,1) -> (-1,-1) -> (1,-1) -> (1,1) but it

Why isn't the d3 voronoi polygon drag event triggering on polygons in force simulation?

谁说我不能喝 提交于 2019-12-11 08:03:33
问题 Following this example, why isn't drag event triggering on the polygons in the following code? var data = [ { "index" : 0, "vx" : 0, "vy" : 0, "x" : 842, "y" : 106 }, { "index" : 1, "vx" : 0, "vy" : 0, "x" : 839, "y" : 56 }, { "index" : 2, "vx" : 0, "vy" : 0, "x" : 771, "y" : 72 } ] var svg = d3.select("svg"), width = +svg.attr("width"), height = +svg.attr("height"); var simulation = d3.forceSimulation(data) .force("charge", d3.forceManyBody()) .force("center", d3.forceCenter(width / 2,