Tag Info

Hot answers tagged

6

You have a few options for getting the road as a vector. You could download the Open Street Map road layer. This has been prepared by Geofabrik. You'd have to select out the road you're after. You could digitise the road manually. This involves creating a new polyline layer and tracing the road. It looks like you'll need to create a point layer too, ...


6

According to Wikipedia, Vincenty's formula is slower but more accurate: Vincenty's formulae are two related iterative methods used in geodesy to calculate the distance between two points on the surface of a spheroid, developed by Thaddeus Vincenty (1975a) They are based on the assumption that the figure of the Earth is an oblate spheroid, and ...


6

Given a list of geographic coordinate pairs, you can implement the Haversine formula directly in Excel. The simplest way to use this (or a more accurate, but I think it's not your case) formula consists into press Alt+F11 to open the VBA Editor, click Insert --> Module and then (copy and) paste e.g. the code kindly suggested by blah238. There will be a ...


5

You can do this analysis in the "spdep" package. In the relevant neighbor functions, if you use "longlat=TRUE", the function calculates great circle distance and returns kilometers as the distance unit. In the below example you could coerce the resulting distance list object ("dist.list") to a matrix or data.frame however, it is quite efficient calculating ...


4

When you find distance using latitude and longitude, the tool would be calculating Geodetic distance between the two points, so it does not need a projection. However it will need the datum or ellipsoid, say WGS84 etc. Since it is not asking for a datum, it signifies a default system datum which generally is WGS84, the world datum. Once you apply a ...


4

An advanced method that will work on all levels of ArcMap (must be 10.1 or above though) would be to read the geometry of each point and project it on the fly to compute the distance between the features. This is a good read about how the Near tool works. The following code does this (all you'll need to do is find a good PCS for your dataset): import ...


4

If you want to test whether some points (or shapes, etc) fall within a given distance of a given location, use the geographic version of ST_DWithin(). From http://www.postgis.org/docs/ST_DWithin.html boolean ST_DWithin(geography gg1, geography gg2, double precision distance_meters, boolean use_spheroid); Thus, SELECT ST_DWithin( ST_GeomFromText( ...


4

ST_Distance is a calculation which must be executed and evaluated on every row. ST_DWithin can use an index, so it's likely to be much faster.


4

PointMaker will allow you to create points using a variety of point patterns including random, random in circle or ellipse, grid and linear with several variants. It sounds like you want to create them in a grid or linear pattern with or without rotation.


4

There is a python plugin for QGIS to calculate Tobler's Hiking function. It's called Walking times and you can install it using the qgis oficial repository. The plugin page explains how it works: http://sigsemgrilhetas.wordpress.com/plugins-qgis/walking-time/ And, since we are talking about open source, you can see and download all the code here: ...


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


3

The answer is ~10001.966km (see Wolfram and sigurdhu) The fixed JavaScript Implementation gives me 10001.959km. Close enough. JavaScript was introducing errors at a precision bigger than 16 digits at Math.pow(0.5, digits)


3

We were solving similar problem. The best and fastest way for us is: Rasterize line layer (Raster/Conversion/Rasterize...) Convert to Proximity (Raster/Analysis/Proximity...) Use plugin Point sampling tool to get values for all your point from raster


3

You should be able to run a SQL statement using the PostGIS function ST_LineLocatePoint to select the relative distance along the route. You will need a single route, a filter for the max distance from the route, and an order by clause. This is untested, but should get you started: Select points.pointID from points, rountes where ...


3

The correct implementation is: public static void getLocation(double x0, double y0, int radius) { Random random = new Random(); // Convert radius from meters to degrees double radiusInDegrees = radius / 111000f; double u = random.nextDouble(); double v = random.nextDouble(); double w = radiusInDegrees * Math.sqrt(u); double t = ...


3

Use the Cost Distance and Cost Path Tools from the Spatial Analyst Extension. You can create a Raster from your Hydrography Polygons. Then assure that the raster cells that represent water get a low value (e.g. 1) and the other raster cells get a high value (e.g. 1000). You can then use this raster as cost distance raster in the Cost Path Tool.


3

The following python code should help you calculate the distances from points to their corresponding median point. The script creates a new field in your point file and stores the distance to the median point. This script assumes that the point file and median point file have a common field that relates the points to the median points. If you generate the ...


3

As you have got ArcInfo and you only have 226 points I would suggest you run your data through the Generate Near Table tool that is in the Analysis toolbox. This will give you all combinations but you could easy delete the unwanted combinations leaving you with your 1> 2, 2>3, 3>4..etc.


3

Your first problem has a straightforward solution... Given lat1, lon1, lat2, lon2, you can solve the inverse geodesic problem to determine azi1, azi2, the azimuths at the end points. The problem now is: given lat1, lon1, azi1, and lat3 determine lon3. This is the so-called hybrid problem and its solution is described in Section 4 of Algorithms for ...


3

Am I misunderstanding? Isn't this just: SELECT ST_Asimuth(p.geom, ST_ClosestPoint(l.geom,p.geom)) AS azimuth FROM line l, point p If you have more than one item in the line and point tables, the question of what condition you join them on becomes important, but as you described it, it's just one item in each.


3

How about a method which is both more accurate and faster? This is provided by GeographicLib. Comparative timings (C++ implementations on a 2.66GHz Intel processor, using g++) are: Vincenty direct: 1.11 us GeographicLib::Geodesic::Direct: 0.88 us GeographicLib::GeodesicLine::Position: 0.37 us ...


3

Delaware Stateplane, EPSG:2235 should work well for the whole state.


3

Have a look at the service areas solver in network Analyst If you do a few of them at different intervals then you would be able to show rings of route distance/time from each school along the route layer. I hope that helps :)


3

Use gCentroid from rgeos to calculate centroids. Use spDists from sp (as mentioned by @Jot eN above) to calculate distance matrices. I made up a simple example using admin boundaries. Note that the parameters of spDists change, depending on your map units. The example is for degrees. If you have meters use something like: spDists(centroids)/1000 ...


3

What I think happened here was that although the dataframe and all layers were saying they were in the correct Project Coordinate System, they actually weren't registered to one at all. I over came this by first defining the coordinate systems for all the layers to OSGB36 and then projecting them to BNG (which is based on Tranverse Mecator). The map looks ...


3

If you're using geopy, then the great_circle and vincenty distances are equally convenient to obtain. In this case, you should almost always use the one that gives you the more accurate result, i.e., vincenty. The two considerations (as you point out) are speed and accuracy. Vincenty is two times slower. But probably in a real application the increased ...


3

You are absolutely correct. From wikipedia's Mercator projection: scale factor = secant (latitude) = 1 / cosine (latitude) Generally, divide map distance by the scale factor to get globe distance. But what about "long" lines, at different latitudes, what scale factor to use? According to EF Burkholder, for short lines, just calculate one scale factor ...


3

If you have access to Network Analysis - and your bus routes are connected and directionally accurate - you can use this to determine distances. This would give you the distance along the route as opposed to as the crow flys. http://resources.arcgis.com/en/help/main/10.2/index.html#//004700000001000000


2

For ArcGIS since you said you installed the trial: The Near tool does exactly what you are looking for. Your points should go in 'Input Features' and your coastline will go in 'Near Features' the tool will add NEAR_DIST field to your points. Very important note: "The distances calculated by this tool are in the unit of the coordinate system of the input ...



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