Tag Info

Hot answers tagged

8

Do a spatial join! First, set up your data frame in a projected coordinate system of your choice (whatever units you want your distances to show up in). So, say you're working in State Plane Feet, make sure all your layers are in State Plane Feet, so if they're not project them into it. From there, Right click on the points layer and click Joins & ...


6

I am answering my own question with a proposed query. select *, ABS(x_permit-x_station)+ABS(y_permit-y_station) as manhattan FROM (SELECT longname AS NAME, lines AS metadata, T .slug, ST_Distance ( T .geom, ST_Transform (P .geometry, 3435) ) AS distance, ST_X(ST_Transform(p.geometry, 3435)) as x_permit, ST_Y(ST_Transform(p.geometry, 3435)) as ...


6

The following is a rough outline of what you might do. I won't include a great deal of detail, you can research further using these terms and/or ask new more specific questions. Note: you will need to careful of coordinate systems. Firstly that they are the same for your datasets, and second that they use metric (metres) horizontal units (not actually ...


5

The following code is not polished but should work to create the same output table as the Point Distance tool but requires ArcGIS 10.1 (or later) for Desktop and only a Basic level license: import arcpy,math # Set variables for input point feature classes and output table ptFC1 = "C:/temp/test.gdb/PointFC1" ptFC2 = "C:/temp/test.gdb/PointFC2" outGDB = ...


5

You are nearly there. There is a little trick which is to use Postgres's distinct operator, which will return the first match of each combination -- as you are ordering by ST_Distance, effectively it will return the closest point from each senal to each port. SELECT DISTINCT ON (senal.id) senal.id, port.id, ST_Distance(port."GEOMETRY", senal."GEOMETRY") ...


5

The aproach with cross-join doesn't use indexes and requires a lot of memory. So you basically have two choices. Pre 9.3 you'd use a correlated subquery. 9.3+ you can use a LATERAL JOIN. KNN GIST with a Lateral twist Coming soon to a database near you (exact queries to follow soon)


4

Distances, one to another, can't be calculated on polygons (or lines for that matter). What you need to do is convert the polygons to points using feature to point to get the centroids (1 point per polygon, roughly centre) then do a near or spatial join to find the closest swamp polygon to the land parcel. If you want better location of the nearest feature ...


4

There actually is no difference between the two functions, which both yield 1.195 km. The problem is that in your question the axis order is flipped for trajectory, so you are seeing different answers than you expect. SELECT ST_AsLatLonText(point_a) AS point_a_latlon, ST_AsLatLonText(point_b) AS point_b_latlon, ST_Distance_Spheroid(point_a, point_b, ...


4

Taking into account Andre's comment, and for the sake of learning I modified another user's answer to create a 3D Line from your sample data. I hope you or someone else might find it useful: X,Y,Z,pt_dt 2970969.635,359725.0088,83.4242,1-x 2970968.278,359722.2182,83.2591,1-x 2970941.771,359670.127,83.0655,1-x 2970961.369,359708.6424,83.4785,1-x ...


4

If I understand your question correctly, you can achieve this by using the Distance to nearest hub function via Processing Toolbox. Select the required options (first image), and choose what measurement you want the distance to be calculated in which will be added into a new column. You can repeat this step to then calculate the centre of each cell to the ...


4

The best way I can think is to get two UTM points, convert them to Lat/Long, and compare their geodesic distances to their UTM pythagorean distance. E.g. Take a point from this example: The CN Tower is ... in UTM zone 17, and the grid position is 630084m east, 4833438m north. So if we take A (17n 630084 4833438) and move it 30 km east, we get B (17n ...


4

The radius, r, of the small circle joining all points at latitude, φ is r = R cos φ where R is the radius of the sphere. That simplifies to r = cos φ if we assume a "unit sphere" (R = 1) for convenience. --------------------- A/D | r φ / | / | / | / |a / |x / |i ...


4

It doesn't matter at what longitude you are. What matters is what latitude you are. Length of 1 degree of Longitude = cosine (latitude in decimal degrees) * length of degree (miles) at equator. Convert your latitude into decimal degrees ~ 37.26383 1 degree of Longitude = ~0.79863 * 69.172 = ~ 55.2428 miles More useful information from the about.com ...


3

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 ...


3

your coordinates are probably in lat/long with degrees as a unit. therefore, along meridians or near the equator, one degree is approximately 111km (circumference/360). note that this will change depending on the distance to the equator. A good practice is to use a local projected coordinate system that is appropriate for your location in order to have a ...


3

Use the Points to Line tool. http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000003s000000 You could use a datestamp for the sort field, if the default doesn't work the first time. The shape length of the line should be included in the output feature class, if it is in a geodatabase. You might want to check the length by adding a field to ...


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 ...


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

I am the developer of FlowMapper plugin. Hope you find it useful. Regarding your question: FlowMapper offers two types of flow length caculations: (i) for cartesian coordinates (e.g. UTM x y) (ii) for geographic coordinates (e.g. WGS84 easting northing) User must properly choose either CARTESIAN or GEOGRAPHIC calculation depending on the type of ...


3

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 ...


3

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 ...


3

There's probably several methods to achieve this but I will just mention a couple. The first requires several steps. I've created a couple of simple layers with a point layer (1 feature) and a polygon layer (3 features): Use the Polygons to lines tool, I just seach the Processing Toolbox and use all tools from there: Then use Convert lines to points ...


3

Both variables are zonal means. The average distance to the nearest facility is the zonal mean of the Euclidean distance grid (based on the facilities). The average number of facilities is the zonal mean of a one-kilometer radius focal sum of the facilities grid. (This is merely a grid whose cell values count the number of facilities within each cell. ...


2

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.


2

Converting your polygon to points first is a bad idea. You will not be calculating the distance to your polygon, you will be calculating the distance to the closest node of your polygons (not the edges which may be closer). You can use the NNJoin Plugin to get accurate measurements to your polygon. Make sure your layers are in the same projection before ...


2

Found the solution: use r.grow.distance. Use a raster with [1] as value and the area of [2] as "no data". The resulting raster shows the distance of cells in the [2] are to the nearest cell [1], as manhattan, euclidean, maximum, etc.


2

What you could do is within a loop - create feature layers out of your points - then do the point near analysis. As a brief example: import arcpy countries = ['CANADA','USA'] arcpy.MakeFeatureLayer_management('PATH_TO_CITIES_FC','cityfc') arcpy.MakeFeatureLayer_management('PATH_TO_CAPITALS_FC','capitalfc') for country in countries: ...


2

I think you want to do something like Generate Near Table or just Near which will allow you to join attributes between the points for each census tract and the near table to find the distance to the city centres. If you use closest only on the near table you will only get the closest feature, Near will always return just the nearest feature and distance ...


2

'atan' is short for arctangent, or inverse tangent. Here is the Excel explanation of the ATAN2 function (since you used the Excel tag), and a detailed look at ways to implement the calculation.


2

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.



Only top voted, non community-wiki answers of a minimum length are eligible