area

How Do I Calculate the Area of a Polygon in a MySQL Database When the Polygon's Points are Lat Longs?

我的未来我决定 提交于 2019-12-07 05:53:35
问题 How do I calculate the area of a polygon stored in a MySql database? The polygons' points are lat longs. So, degrees and minutes seem to be causing a problem. I've tried: SELECT AREA( my_polygon ) FROM `my_table` WHERE name = 'Newport' Because, the points are lat longs, I get weird results. (I'm not able to switch to Postgre). Is there a way to do this in MySQL? I'd like to get the results in sq. meters or sq. km or sq. miles-- any of these would be fine. 回答1: You've got to transform those

How to measure the area of a polygon in ggplot2?

喜欢而已 提交于 2019-12-07 03:09:27
Hi everyone, I have a number of samples that I would like to draw a polygon for each of them to illustrate the shape of the data. My data look likes this: 01 0.31707317 02 0.12195122 03 0.09756098 04 0.07317073 05 0.07317073 06 0.07317073 07 0.07317073 08 0.07317073 09 0.04878049 10 0.04878049 I can easily draw a radar chart using radarchart, which looks like this: But I am trying to measure the area of the results shape and use that as a measure of data shape. This is where I struggle. I tried to save the resulting figure as a vector and use the points there but it looks like I can not pass

Gtk buttons over a Gtk drawing area

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 16:24:50
i' working with Gtk developing some app. I must put some buttons over a map. I'm drawing the map on a GtkDrawingarea, but i'm not able to put buttons over it. Any suggestion? Thanks Suggestions: Put both the drawing area and the buttons inside a GtkFixed container. Probably not the best solution, because GtkFixed has no way of controlling the z-ordering (other than the order in which you add the widgets to it?) Instead of using GtkDrawingArea , use a canvas widget that can include other widgets, such as GooCanvas . Why no other library? Any specific reason? There is a library for exactly what

opencv extract path (centerline) from arbitrary area

依然范特西╮ 提交于 2019-12-06 15:14:57
I have an arbitray area and want to extract a path (series of pixels). The path should start and end so that you walk the longest way but always stay in the center, between your borders. Is there any sensible way to implement this in opencv? Basically a morphologic filter like erosion (to find the middle between the borders) sounds good. However I do not want to shorten the the length of the path. It does not need to be a fully automatic solution. User input, e.g. marking the start and end point of an path, is also an option. Here is a (rather poor) example drawn with paint. I guess you get

Calculate contour area with opencv for contours created by matplotlib

大城市里の小女人 提交于 2019-12-06 14:56:18
问题 I need to calculate the area limited by a contour line. I use matplotlib to get the vertices of the contour line, but I am not able to convert them into a valid input for contourArea method in openCV: Z = z_func(X, Y, Ql, k[i,j], B) cs = plt.contour(X, Y, Z,[IncT]) v = cs.collections[0].get_paths()[0].vertices xy = [] for vv in v: xy.append(vv[0]) cnt = np.array(xy) area = cv2.contourArea(cnt) I get this error: ......\opencv-2.4.9.1\modules\imgproc\src\contours.cpp:1904: error: (-215) contour

How to test if a point inside area with lat/lon and radius using Java?

送分小仙女□ 提交于 2019-12-06 07:56:40
问题 I've to write a method that has the following signature public class Position { double longitude; double latitude; } boolean isInsideTheArea(Position center, double radius, Position point); So if point is inside the area that has the center as its center and radius as its radius in miles , this should return true , false otherwise. 回答1: Use the Haversine formula to compute the distance between center and point . If that distance is greater than radius , return false ; otherwise return true .

Drawing area at Google Map

[亡魂溺海] 提交于 2019-12-06 07:36:34
问题 Please see the image : alt text http://img.skitch.com/20091211-bybjj3qtasrgr1dfaf4c42p39b.jpg Any idea how to do that? drawing an area. 回答1: The toolkit that allows users to draw polygons on MyMaps has been made available as the GeometryControls utility library 回答2: If you're looking to use Google Maps API, check the documentation about Polylines (should be what that is) : http://code.google.com/intl/pt-PT/apis/maps/documentation/overlays.html#Polylines_Overview 回答3: You need to instantiate a

Calculate area of cross section for varying height

十年热恋 提交于 2019-12-06 05:47:54
I'm trying to figure out how to calculate the area of a river cross section. For the cross section I have the depth at every 25 cm over the 5 m wide river. x_profile <- seq(0, 500, 25) y_profile = c(50, 73, 64, 59, 60, 64, 82, 78, 79, 76, 72, 68, 63, 65, 62, 61, 56, 50, 44, 39, 25) If anyone have some suggestions of how this could be done in r it's highly appreciated. We can use the sf package to create a polygon showing the cross-section and then calculate the area. Notice that to create a polygon, it is necessary to provide three more points as c(0, 0) , c(500, 0) , and c(0, 0) when creating

How can I draw a polygon using path2d and see if a point is within it's area?

[亡魂溺海] 提交于 2019-12-05 18:46:05
I,m trying to draw a polygon shape of any kind using multiple vertices with path2d and I want to later on see if a determinate point is within its area using java.awt.geom.Area public static boolean is insideRegion(Region region, Coordinate coord){ Geopoint lastGeopoint = null; GeoPoint firstGeopoint = null; final Path2D boundary = new Path2D.Double(); for(GeoPoint geoponto : region.getGeoPoints()){ if(firstGeopoint == null) firstGeopoint = geoponto; if(lastGeopoint != null){ boundary.moveTo(lastGeopoint.getLatitude(),lastGeopoint.getLongitude()); boundary.lineTo(geoponto.getLatitude()

Restrict Area to a given role

旧城冷巷雨未停 提交于 2019-12-05 16:43:12
I have an area setup in MVC2, called Admin/ , which I want I only want Users who belong to the role "admins" to have access. I know I can decorate each of the methods with [Authorize(Roles="admins")] , but this seems tedious when your talking about multiple controllers with multiple actions. Is there an better and cleaner way? You could define a base controller decorated with this attribute that all controllers in the area derive from. 来源: https://stackoverflow.com/questions/3291385/restrict-area-to-a-given-role