Tag Info

New answers tagged

1

UPDATE: The FNN package has a function get.knnx which can compute the N-nearest neighbours in point patterns. For what you want, this should work: nn = get.knnx(A,B,k=1) Which should just return the nearest neighbors between the two datasets. You can also specify what nearest neighbor algorithm it will use, be it kd_tree, cover_tree, CR, or brute force. ...


0

RANN looked like the package I was looking for, but was not... RANN gives the nearest neighbor for CELLS, not an XY point layer. FNN was the package I was looking for. Alternates methods exist, but share commonalities: All methods make use of a) A distance function b) loop or apply c) A 'min' of the distance function Examples: ...


2

This is fairly simple to achieve using QGIS (I think any version will do) and a very simple SQL statement in DB manager. But for that your that must be in some kind of spatial database (Postgis or spatialite). Since it's more accessible to most people, I will assume using spatialite, but the SQL statements are the same for Postgis. Create a new Spatialite ...


1

Create numeric field (double) in the table of ballots and try this with field calculator. Code block: def TotalDist(shp ): p=shp.firstPoint mxd = arcpy.mapping.MapDocument("CURRENT") layers=arcpy.mapping.ListLayers(mxd, "facilities") lr=layers[0] g=arcpy.Geometry() geometryList=arcpy.CopyFeatures_management(lr,g) s=0 for f in geometryList: ...


1

This is a correct procedure. You can then use summarize table to get the sum of distance based on the ID's of your Ballot Boxes, and join this table. The point distance indeed provides distances based on the coordinate system, so in your case it will be meters, and if you don't specify a distance it will work on the full extent. As a remark, if you have a ...


0

Thanks everyone for your answers. After having tried some various things I came up with this: a) I overlaid the whole study area with a polygon but made sure that the end points of the rivernetwork was just outside of the polygon. I then cut the polygon with the rivernetwork (features to polygon) and have now a new shapefile, lets call it "Area_Poly". I ...


0

Efficiency might not be my strong suit, but here is the process I came up with: In the code below, I first create a point feature class from the vertices of my input shapefile. From here I iterate through each feature in the input shapefile. I select each vertex in the point feature class associated with that feature, and then perform a distance selection. ...


2

The Generate Near Table tool in ArcGIS will do what you want, but it requires an Advanced license and will do it for all points/polygons - not just those associated with each other. This means for each of your 95 objects you will get the ranked distance for all 211 properties, so 20,045 rows in the table. You'd either have to filter the resulting table or as ...


0

I'm not a mathematician so may be my idea is flawed? There are more clever people haunting this forum than I. A possible way of doing this is set your centerx and centery to zero and compute the range of values then add those to your real world XY position. An example of this is shown in the screen shot below. So i is your count (I did 1 to 100), angle is ...


0

Yes, there is a better way. You're looking at service areas. This is essentially a 'buffer' which is constrained to follow the paths of the network. While usually run against drive time (show areas within a five minute drive of x, where drive time [speed/distance] is the network impedance), they can be run using distance as the impedance, so a result will ...


0

Sounds like you should over-bound the route you want and set the route output to give you the true shape with measures. Measures start at 0 from Point A and cumulatively increase until they reach this initial Point B. Create a table that contains two fields: the Route ID and a distance measure field with the desired distance on that route where you really ...


0

I have the same problem during working with pgRouting. That's why I read that threat. For everybody who has the same problem: I found a solution to get all edges nevertheless. The result of driving_distance delivers a lot of edges which are used. If you look into the road network in detail, it is recognizable that some parts in between two given edges are ...


1

According to this tutorial the map function returns a list: >>> items = [1, 2, 3, 4, 5] >>> >>> def sqr(x): return x ** 2 >>> list(map(sqr, items)) [1, 4, 9, 16, 25] >>> So your code should be something like this: def Distance(Latitude, Latitude2, Longitude, Longitude2) pList = map(math.radians, ...


0

Here's one ESRI plugin for "weighted voronoi diagrams". @martinf pointed me in the right direction. An ArcGIS Extension for Generating and Updating Ordinary and Multiplicatively Weighted Voronoi Diagrams for Points, Lines, and Polygons Unfortunately I don't have access to ArcGIS, so this particular solution isn't much good to me. It's still useful to see ...


1

As commented under the OP, my suggestion is to use the Point Distance geoprocessing tool, if you have Advanced licensing. Run Point Distance tool to calculate the distance between all possible combinations of points Start editing Select by Attributes where ID1 <> ID2 Delete the selected records


1

The solution for the cross-track distance to a rhumb line is giving in this link which computes an accurate intercept for the WGS84 ellipsoid given a sufficiently accurate initial guess. This computes the shortest geodesic intercept. The geodesic intercept has the nice property that the angle of interception is 90°. (This isn't the case if the ...



Top 50 recent answers are included