polygon

MySQL Find Polygon Nearest to Point

有些话、适合烂在心里 提交于 2019-12-01 08:05:55
I have a MySQL database that contains geo-tagged objects. The objects are tagged by using a bounding polygon that the user draws and my program exports into the database. The bounding polygon is stored in the database as a Polygon (the MySQL spatial extensions kind). I can think of a couple ways to do this, but I'm not very pleased with any of them, as this needs to be an efficient process that will execute fairly often, although on probably only < 50,000 records in the pertinent table. I need a way to, given any point on the earth, find the record that corresponds to the closest geo-tagged

How do I add a transition delay between multiple individual transitioning polygons in D3?

萝らか妹 提交于 2019-12-01 07:47:19
问题 The original Code can be found at: http://bl.ocks.org/Guerino1/3a51eeb95d3a8345bc27370e8c9d5b77 I have numerous polygons that are transitioning onto an svg canvas (from left to right, at the bottom of the HTML page). The code I use to create an transition the chevrons leverages D3 Polygon: // Create Polygons for SDLC svgCanvas.selectAll("a") .data(dataSet) .enter().append("a") .attr("xlink:href", function(d) { return d.link; }) .append("svg:polygon") //svgCanvas.selectAll("polygon") //.data

Java Graphics.fillPolygon: How to also render right and bottom edges?

好久不见. 提交于 2019-12-01 07:09:34
问题 When drawing polygons, Java2D leaves off the right and bottom edges. I understand why this is done. However, I would like to draw something that includes those edges. One thing that occurred to me was to follow fillPolygon with drawPolygon with the same coordinates, but this appears to leave a gap. (See the little triangular image at the bottom.) There are two possibilities, but I can't tell which. To enable antialiasing, I'm doing this: renderHints = new RenderingHints(RenderingHints.KEY

How to get polygon antialiasing to work?

試著忘記壹切 提交于 2019-12-01 07:01:49
问题 I'm using these function calls: glEnable(GL_BLEND) glEnable(GL_POLYGON_SMOOTH) glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE) It doesn't work and won't render. glEnable(GL_BLEND) glEnable(GL_POLYGON_SMOOTH) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) It doesn't anti-alias. 回答1: Try glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST) 回答2: This is a mundane answer.. but if you want rounded corners, you'll probably want to use more more vertices at the corners and place them for a more rounded shape.

JavaFX modify polygons

淺唱寂寞╮ 提交于 2019-12-01 06:00:29
问题 Is there a way to modify a polygon in JavaFX? For example if I have a triangle and I press and then drag a point from that triangle, the triangle will modify with the new coordinates of the point. 回答1: Layer some control nodes over the corners of the polygon. Attach appropriate event handlers to the control nodes so that they can be dragged around. Modify the polygon's points as the control node is moved (using change listeners attached to each of the control node's location properties). Here

Matplotlib RegularPolygon collection location on the canvas

此生再无相见时 提交于 2019-12-01 05:47:40
问题 I am trying to plot a feature map (SOM) using python. To keep it simple, imagine a 2D plot where each unit is represented as an hexagon. As it is shown on this topic: Hexagonal Self-Organizing map in Python the hexagons are located side-by-side formated as a grid. I manage to write the following piece of code and it works perfectly for a set number of polygons and for only few shapes (6 x 6 or 10 x 4 hexagons for example). However one important feature of a method like this is to support any

iOS overlay (MKPolygon) data for all U.S. states?

蹲街弑〆低调 提交于 2019-12-01 05:15:34
In the Displaying Overlays on a Map section of the iOS Developer Library Location Awareness Programming Guide, there is an example that "shows a filled and stroked overlay covering the state of Colorado." // Define an overlay that covers Colorado. CLLocationCoordinate2D points[4]; points[0] = CLLocationCoordinate2DMake(41.000512, -109.050116); points[1] = CLLocationCoordinate2DMake(41.002371, -102.052066); points[2] = CLLocationCoordinate2DMake(36.993076, -102.041981); points[3] = CLLocationCoordinate2DMake(36.99892, -109.045267); MKPolygon* poly = [MKPolygon polygonWithCoordinates:points

How to get the nearest point outside a polygon from a point inside a polygon?

我是研究僧i 提交于 2019-12-01 04:02:14
I have a map with a lot of polygons and a point inside in one of them, like this: The x and y coordinates of the edges of the polygons are save in a database like this(for example): Polygon(Point(11824, 10756), Point(11822, 10618), Point(11912, 10517), Point(12060, 10529), Point(12158, 10604), Point(12133, 10713), Point(12027, 10812), Point(11902, 10902)), Polygon(Point(11077, 13610), Point(10949, 13642), Point(10828, 13584), Point(10772, 13480), Point(10756, 13353), Point(10849, 13256), Point(10976, 13224), Point(11103, 13294), Point(11171, 13414), Point(11135, 13558)), Polygon(Point(11051

How can I create a polygon using fields in PostgreSQL?

こ雲淡風輕ζ 提交于 2019-12-01 03:54:39
I have 8 real values in a table that I'd like to combine into a polygon. I haven't been able to figure out how to create a polygon using these values though. I keep trying variations of SELECT polygon(lat1,lon1,lat2,lon2,lat3,lon3,lat4,lon4) FROM table; but keep getting errors about the polygon function not existing or an invalid input syntax for type polygon. Has anyone done this before? The syntax for a regular postgres polygon is more like: insert into geo_table values (1, '((2,2),(3,4),(3,6),(1,1))'); Where 1 is some id and the quoted entry is the polygon. I would expect the query to be

Check if dbgeometry dbgeometry/dbgeography point is within a polygon

ぃ、小莉子 提交于 2019-12-01 03:10:43
问题 I have a problem I hope you guys can help me solve. I have got a DbGeometry point (or DbGeography, I can use both) and I would like to check if this is within a DbGeometry Polygon (alternatively a DbGeography). I am doing this at the moment: var dbZones = new List<WasteManager.Database.Zone>(); foreach(var zone in zones) { var res = from z in DatabaseContext.Zones let boundary = !z.BoundaryGeometry.IsValid ? SqlSpatialFunctions.MakeValid(z.BoundaryGeometry) : z.BoundaryGeometry where z.ID ==