Tag Info

New answers tagged

0

Here's a fairly bare-bones python script that connects all combinations of two input point files, and outputs lines with distance attribute. It follows directly from PolyGeo's comment under OP. Note: I've heard horror stories of nesting cursors, but it seems to work in this case. # import arcpy import arcpy, os # set input/output parameters points1 = ...


3

Assuming that your points are in order, and that this works at 10.0 (I'm using 10.2): Field Calculator Expression: dist( !Shape! ) Field Calculator Code Block: count = 0 def dist(shape): global prev global count point = arcpy.PointGeometry(shape.getPart(0)) if count > 0: distance = point.distanceTo(prev) else: ...


3

Achieving this goal is somewhat a basic task in GIS, however the method in QGIS might not be trivial. Your best chance is to use GRASS's r.walk function, which creates an anisotropic cost surface (dem+slope+other factors). First, you have to create a friction surface as an input to r.walk. In your case it can be a single-valued raster (1.0) matching the ...


1

One way to merge your lines is to use the "integrate" tools. Be carefull when you use this tool because it modifies the input data. If you want to detect those lines, you could use integrate on a copy of your original data, the you run "intersect" between the original and the integrated data : the result will only include the lines that were not moved by ...


0

There is a distmap() function in spatstat package that creates a pixel image of the distance to the points. At the provided link you will find a great tutorial for this package (including distmap() example).


0

In my world, using a custom SRID (for Google Maps) something like this worked: SELECT * FROM addresses WHERE ST_DWithin(location, ST_SetSRID(ST_MakePoint(longitude, latitude), 3785), radius); where the type of location is a geometry(Point,3785), and longitude, latitude, and radius are floats (e.g. -100, 44, 30 for 100W/44N/30 "units" -- see below) See ...


1

Both answers from @HåvardTveite and @mapBaker should help you get your results. What I normally do is first use the Distance to nearest hub tool and then Join the resulting layer with the polygon layer. This is a late answer but anyway, I created 2 simple layers (polygon and point) with the following attributes: I then ran the Distance to nearest hub via ...


0

There does not seem to be any limitations measuring across the antimeridian with this library: library(geosphere) # small distance across the antimeridian distVincentyEllipsoid(c(-179.999, 0), c(179.999, 0)) # 222.639 # this should be zero, but tiny errors have entered in the maths distVincentyEllipsoid(c(-180, 0), c(180, 0)) # 1.556904e-09 And if you ...


1

Other way to measure this, it is using Qchainage (QGis plugin) to produce nodes equallly spaced from line. Then, you may use Distance to nearest hub (QGis plugin) to calculate distance among points.


1

I found the answers provided here very helpful and came up with a refined version. So, here's another way to accomplish this task, but without having to alter the original table. SELECT t1.gid AS gid_1, t2.gid AS gid_2, ST_Distance(t1.geom, t2.geom) AS mindist FROM table t1, table t2 WHERE t1.gid != t2.gid AND ST_Distance(t1.geom, t2.geom) != 0 ORDER BY ...


0

A better approach is probably to geocode the addresses and work with point-to-point distances. If you can't do that, work with five digit zip codes (discard the last four digits of a zip-9). From the USPS you can get the Post Office address for each 5 digit zip code which can be geocoded. Third parties offer zip centroid or zip polygon tables. Zip ...


1

Using a projected coordinate reference system (e.g. UTM) simplifies things. In GRASS you can use the v.distance function. In QGIS you can use v.distance through the GRASS plugin. If your datasets are small you can use the NNJoin plugin.


0

The GRASS v.distance function in the GRASS plugin should do the job. The NNJoin plugin should work for small datasets, and less cumbersome to use.


0

If you know postgis, you can create the shortest line between two geometries : http://postgis.net/docs/manual-2.1/ST_ShortestLine.html. Then you can calculate the length with :http://postgis.net/docs/manual-2.1/ST_Length.html If you dont need to create the line : st_distance should be enough : http://postgis.net/docs/manual-2.1/ST_Distance.html


0

The GRASS v.distance function does currently not work from QGIS Processing. See GRASS in QGIS not working (windows XP). You will have to run it through the GRASS plugin. Update: You could also try the NNJoin plugin. It provides an option to use the centroids of the geometries of polygon (or line) input layers. It may be slow for large datasets.


1

If you can't get v.distance to work (it should be available through the GRASS plugin), you could try the NNJoin plugin that I uploaded to the QGIS plugin repository recently. The NNJoin plugin does not use spatial indexes for line layers, so it is not practical if you have large datasets.



Top 50 recent answers are included