points

OpenLayers : How to calculate distance between two points?

孤者浪人 提交于 2019-12-04 17:49:45
问题 How can one calculate the distance in OpenLayers between 2 points using Mercator projection? Thanks 回答1: use point1.distanceTo(point2) var Geographic = new OpenLayers.Projection("EPSG:4326"); var Mercator = new OpenLayers.Projection("EPSG:900913"); function distanceBetweenPoints(latlng1, latlng2){ var point1 = new OpenLayers.Geometry.Point(latlng1.lon, latlng1.lat).transform(Geographic, Mercator); var point2 = new OpenLayers.Geometry.Point(latlng2.lon, latlng2.lat).transform(Geographic,

Generating pixel values of line connecting 2 points

旧时模样 提交于 2019-12-04 16:41:26
I am having some troubles trying to connect separate points in my picture (see below). Right now, the code I have is as follows: first_time = resulting_coords[0:40] for i in range(len(first_time)): if(i < (len(first_time))-1): cv2.line(copy_test_image[0], (resulting_coords[i,0],resulting_coords[i,1]), (resulting_coords[i+1,0],resulting_coords[i+1,1]), (0,0,225), 2) elif(i>=(len(first_time))-1): # print(i) cv2.line(copy_test_image[0], (resulting_coords[i,0],resulting_coords[i,1]), (resulting_coords[0,0],resulting_coords[0,1]), (0,0,225), 2) Which actually gives the result I want: Results in But

3D contour of a list of points (concave hull)

久未见 提交于 2019-12-04 13:28:19
I have a list of Vector3 points in c#, and I need to calculate the concave contour of these. There's really a lot of references around, especially for -convex- resolution (which I have successfully implemented already, thanks to graham's algorithm), however, since my need is now to effectively compute a concave contour, I'm lost: wikipedia does list a lot of resources for convex calculation, but none for -concave-. Anybody with math knowledge that can give me a lead on the available concave hull algorithms? I have a concern for performance, too, so being able to benchmark the algorithm speed a

How to Access Points location on OpenCV Matcher?

。_饼干妹妹 提交于 2019-12-04 11:22:33
I am using this FLANN matcher algorithm to match interest points in 2 pictures the code is displayed below). There is a moment when the code finds a list of matched points: std::vector<DMatch> good_matches; I would like to get the points localization (x,y) in both pictures. To create a displacement map. How could I access these points localization? Cheers, #include <stdio.h> #include <iostream> #include "opencv2/core/core.hpp" #include "opencv2/nonfree/features2d.hpp" #include "opencv2/highgui/highgui.hpp" using namespace cv; void readme(); /** @function main */ int main(int argc, char** argv)

Add XY points to raster map generated by levelplot

主宰稳场 提交于 2019-12-04 10:59:22
问题 I have raster maps which are generated using the raster package in R. These raster layers can be visualized using the rasterVis package's levelplot function: levelplot(rasterstack, layout=c(1, 2), col.regions=colorRampPalette(c('darkred', 'red3', 'orange2', 'orange', 'yellow', 'lightskyblue', 'steelblue3', 'royalblue3', 'darkblue'))) Now, I would like to add some z values defined by xy cordinates to the levelplot map. The dataframe containing z values has 4 columns. Columns 1 & 2 contain x &

How to remove points that are far from a segment?

半世苍凉 提交于 2019-12-04 06:29:43
问题 I read how to keep points that are between two points (ie. : that are part of a segment, with some imprecision) here : How can I tell if a point is nearby a certain line? Thus, I implemented this little algorithm in Java, and my code is (note that the variables' name should be clear for you ! :) ) : List<Cupple> returned = new ArrayList<>(points_to_test); for(Cupple c : points_to_test) { /*if(c == segment_first_point || c == segment_last_point) { continue; }*/ if(Math.abs(Math.abs( (segment

Spread overlapping points in a circle - R

帅比萌擦擦* 提交于 2019-12-04 05:08:27
问题 I have a number of points in R which are overlapping -> my idea is to create a new coordinates column where I spread them out in a circle. I don't want to jitter; it looks ugly and is misleading -> it makes the viewer think that the data is actually like that, rather than it has just been presented like that for visibility. I think a circle or sunflower or star spread looks nice so that's what I want to do. What I have is not working great I think because of the geographic projections: Before

How can I cluster points which are connected in MATLAB?

我们两清 提交于 2019-12-04 02:22:06
问题 Imagine we have many points which some of them are connected together and we want to cluster them. Please take a look at the following figure. If we have the " connectivity matrix " of points, how we can cluster them in two group (groups of connected points)? ConnectivityMatrix= [1 2 1 3 2 4 2 3 2 1 3 1 3 2 3 4 4 3 4 2 5 8 5 7 5 6 6 5 6 7 7 6 7 5 7 8 8 7 8 5] The final result should be nodes of 1,2,3,4 in a first group(cluster) and nodes of 5,6,7,8 in a second group (cluster). 回答1: Here is

Adding bullet points to a text area?

余生长醉 提交于 2019-12-03 17:16:09
Is there a way to add bullet points to an HTML textarea? I want to add a simple feature where a bullet point is added for every line in a text area (similar to a list bullet points). You can't do that but there is another way. delete the textarea. '<section id="textarea" contenteditable="true"> <ul> <li>List item here</li> <li>List item here</li> <li>List item here</li> <li>List item here</li> </ul> </section>' As far as I know, you can't. But, you can get WYSIWYG editor where you can use bullets lists, and more (like images, bold, italic, etc .). Those WYSIWYG editor are fully customizable,

Add XY points to raster map generated by levelplot

徘徊边缘 提交于 2019-12-03 13:32:36
I have raster maps which are generated using the raster package in R. These raster layers can be visualized using the rasterVis package's levelplot function: levelplot(rasterstack, layout=c(1, 2), col.regions=colorRampPalette(c('darkred', 'red3', 'orange2', 'orange', 'yellow', 'lightskyblue', 'steelblue3', 'royalblue3', 'darkblue'))) Now, I would like to add some z values defined by xy cordinates to the levelplot map. The dataframe containing z values has 4 columns. Columns 1 & 2 contain x & y coordinates, column 3 contains z values for map 1 in layout(1, 1) and column 4 for layout(1, 2). The