polygon

R sp: unit of area of Polygon

柔情痞子 提交于 2019-12-12 18:34:45
问题 I use R to read in a shape file to analyse with the sp package polygons of oilfields (longitude-latitude with WGS84) and their respective areas. Unfortunately I do not know the unit of the area output. E.g. the area output is on average 0.85 units (max 4.34) which probably is not in square kilometers since this would be much too small for oilfields. Does anyone know the unit of the area output of Polygons in the sp package? Many thanks! 回答1: To get a correct area computation for a polygon in

Diagonal of polygon is inside or outside?

你。 提交于 2019-12-12 18:15:46
问题 I have three consecutive points of polygon, say p1,p2,p3. Now I wanted to know whether the orthogonal between p1 and p3 is inside the polygon or outside the polygon. I am doing it by taking three vectors v1,v2 and v3. And the point before the point p1 in polygon say p0. v1 = (p0 - p1) v2 = (p2 - p1) v3 = (p3 - p1) With reference to this question, I am using the method shown in the accepted answer of that question. It is only for counterclockwise. What if my points are clockwise. I am also

Computing the union 2 MKPolygons

巧了我就是萌 提交于 2019-12-12 17:14:25
问题 I am working on map applications with polygon MKOverlays. I have a requirement to merge (union) overlapping polygons. Is there a well known algorithm to do this? Are there any free existing libraries/implementations that help with such geometry operations? I have found the GEOS library, but apparently its licensing terms disallow use without distributing your source code. Is anyone else using this library. If yes, where can I find the way to include this in my Xcode project. 回答1: The only

How to add a “hole” to a Circle Polygon (Google Maps API V3)

流过昼夜 提交于 2019-12-12 14:24:19
问题 This Pentagon example shows holes can be added inside a Polygon: http://code.google.com/p/gmaps-samples-v3/source/browse/trunk/poly/pentagon.html?r=40 I would like to add a hole inside a circle. Currently I am mimicking this by making a circle shape polygon and putting inner and outer bounds and it is working fine, however the code is extremely long seeing as the map has ~15 circles in it. Any help would be much appreciated Thanks! 回答1: I didn't find anything for the Circle class, but someone

Java3d read each polygon of an 3d-object

假装没事ソ 提交于 2019-12-12 10:19:15
问题 I'm using Java3d ( VERSION 1.6 ) and am trying to read all polygons from any object. I loaded one object using following code: private BranchGroup loadObj(String p) { BranchGroup objRoot = new BranchGroup(); TransformGroup tg = new TransformGroup(); Transform3D t3d = new Transform3D(); t3d.setScale(0.3); Matrix4d matrix = new Matrix4d(); t3d.get(matrix); try { Scene s = null; ObjectFile f = new ObjectFile (); String basepath = new File(p).getAbsolutePath(); System.out.println(basepath); f

Java library for creating straight skeleton?

浪尽此生 提交于 2019-12-12 08:48:00
问题 I have as an input a 2D polygon with holes, and I need to find it's straight skeleton, like in the picture: (source: cgal.org) Maybe there is a good Java library for it? And if not, can you point me to the good explanation of the algorithm, so I could implement it myself? (I haven't found good resources on Google) 回答1: I wrote this a little while back. Not sure if it's robust enough. https://github.com/twak/campskeleton (edited for 2018...) 回答2: See http://www.sable.mcgill.ca/~dbelan2/roofs

How to track event changes to a polygon with Google Maps API

自闭症网瘾萝莉.ら 提交于 2019-12-12 08:30:07
问题 I'm currently building a 'search an area' feature for a site we're working on. A bit like the one on Rightmove. I've got everything up and running except the ability to track event changes to a polygon (the setting of new points and altering existing ones). I need to be able to post the coordinates to the form for submission. I've tried the Google Code docs for editing events. And every time I try it out, I either get a message about 'set_at' not being possible or my object not being defined.

How to draw a polygon from a set of unordered points

馋奶兔 提交于 2019-12-12 08:09:01
问题 Currently, I am using a convex hull algorithm to get the outer most points from a set of points randomly placed. What I aim to do is draw a polygon from the set of points returned by the convex hull however, when I try to draw the polygon it looks quite strange. My question, how do I order the points so the polygon draws correctly? Thanks. EDIT: Also, I have tried sorting using orderby(...).ThenBy(...) and I cant seem to get it working. 回答1: Have you tried the gift wrapping algorithm ( http:/

Using Sql Spatial Data (C#) to find the “visual” center of irregular polygons

雨燕双飞 提交于 2019-12-12 07:32:49
问题 I'm drawing regions (using SqlGeometry / SqlGeography and translating them to the WPF LocationCollection equivalent) on the Bing Maps WPF Control and needed to label them. I got the labels drawn on the regions and attached them to the point found by STCentroid() . Of course as you imagine this is a problem with the 'U' or 'C' shaped regions where the centroid ends up outside the region, which makes the label incorrect. Is there a way using SqlGeometry / SqlGeography to find the "visual"

Draw polygon using ngmap

白昼怎懂夜的黑 提交于 2019-12-12 06:37:35
问题 I'm trying to draw polygon on my map using ngmap . The map is displayed correctly as this example is showing, but when I finish the draw, this is what I'm getting: ng-map.min.js:25 Uncaught TypeError: Cannot read property 'onMapOverlayCompleted' of undefined I used the same code of the example. My questions: 1- How can I solve this error? 2- If I want to let the user draw only polygon form, I have tried to set the value of drawingMode to "polygon" but I'm always having the other draw options