Hot answers tagged

8

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


8

Removed the previous links, which I should have checked more scrutinously, and found some information and shapefiles which hopefully would be of some use: The EEZ Boundaries (Exclusive Economic Zone) which for this purpose is mainly used to show the coastal lines and outlines of continents. http://www.marineregions.org/downloads.php#eez The main Global ...


7

This is an instance of a shortest path problem: given a set S of polygonal "obstacles" (considered as open point sets), a start point p, and an end point q, to find a shortest path from p to q that does not intersect the interior of S. Such problems are solved by first constructing the "visibility graph" of S. One first proves that any shortest path from p ...


7

I'm not sure what tool you are using, but look into linear referencing methods. For example, if you are using PostGIS, here are 10 random points along a linestring: SELECT ST_Line_Interpolate_Point('LINESTRING (10 20, 50 60, 80 30, 140 60)', random()) FROM generate_series(1,10) Or if using Shapely: from random import random from shapely.geometry import ...


5

If you are looking for a OpenSource Solution, you need to look at pgRouting. You can upload your shapefiles in to postgis, and then run pgrouting on it. To get started with pgRouting, I would suggest this workshop.


5

I think some of the answer depends on the layout of the road network, and this question might be worth posting on the Math Stack Exchange (https://math.stackexchange.com/) as it seems like a graph theory problem. I don't think this will be the optimal solution, but it might help get you closer. You could divide up the road network into natural regions, ...


5

I solved this problem by indeed adding a temporary node on the clicked edge and adding 2 temporary edges to this temporary node. By manually joining these temporary node and edges before calling shortest_path_astar they are being used for calculating the correct path but they dont clutter your database with extra records that are only interesting for 1 ...


5

Here's the documentation from Google: https://developers.google.com/transit/gtfs/reference In this model, a "trip" occurs along a "route". I think the simplest difference can been seen in the fact that a "route" has no directionality, it's just a line along which a transit vehicle travels. So if you look only at the route, you don't know which direction ...


5

GraphHopper (using OpenStreetMap Data) GraphHopper offers memory efficient algorithms in Java for routing on graphs. E.g. Dijkstra and A* but also optimized road routing algorithms like Contraction Hierarchies. It stands under the Apache License and is build on a large test suite. OpenStreetMap is directly supported from GraphHopper. Without ...


4

Transit routes. A route is a group of trips that are displayed to riders as a single service. (The entire route) GTFS Routes are equivalent to "Lines" in public transportation systems. Routes are defined in the file routes.txt, and are made up of one or more Trips - remember that a Trip occurs at a specific time and so a Route is time ...


4

You need two postgis functions ST_Buffer and ST_Line_Locate_Point.


4

As far as I know, it's still the case that you cannot use the M-part of geometries. I know that PostGIS supports M and it depends on your use case if that can be an alternative.


4

OSM Tools: My recommendation would be to use OSM tools for QGIS which you can download as a plugin. OSM tools was created by Nils Rode and is an adaptation of the OSMroute plugin which uses the OpenRouteService API. Simply download the plugin and request an API key, once you have this you simply use the routing tab (the other tab is for accessibility e.g. ...


4

You can use the Join by lines (hub lines) tool for this. This algorithm creates hub and spoke diagrams by connecting lines from points on the Spoke layer to matching points in the Hub layer.


3

You can find the second point given a line, starting point, and distance using the GeometryService. The method you use depends on whether you want absolute distance from the starting point (as the crow flies), or traveling distance. Absolute Distance (as the crow flies) Create a Buffer around the starting point that's the distance you want. Convert the ...


3

Write a function that returns total length of a route, and another that interpolates a point at an arbitrary distance along a route. Use a random number generator that generates a random distance d along the route such that 0.0 < d < length and passes it to the second function.


3

You cannot use lines as stop inputs for a network analysis. The only way you could possibly use the lines is to set them as barriers but give them a negative value (ie, rather than adding time, they take time away) such that they attract the route rather than avoid it. You still have to set stops though. If centroids are not sufficient, it would be ...


3

I think that this will not work from your desktop, but needs to be uploaded to a server. These lines in L.Routing.OSRM.js 23 L.Routing.OSRM = L.Class.extend({ 24 options: { 25 serviceUrl: '//router.project-osrm.org/viaroute', 26 geometryPrecision: 6 27 }, are getting file:// appended to the front (file://router.project-...


3

You'll need to use Network Analyst for this. The first thing you will need to do is turn your lines into a network. The Network Analyst Tutorial exercise 1 covers this, but be aware it may not go into sufficient depth, as there are geometry and topology considerations to take into account. Why isn't the service layer shape properly spread out? touches on ...


3

Consider adding "Point" cost barriers. See Barriers.


3

You can either use pgRouting or if not using your data but the OSM street network would be fine, use the OSM Route plugin: Enter a start point and fill out the Accessibility Analysis options.


3

It is all preference, so think about it from the perspective of users, and balance that with how difficult it is to produce, and how much the details stray from the road. I have used GTFS extensively, and know that these details help with things like estimating how fast a vehicle is scheduled to travel (comparing it to a real-time tracking feed), or when it ...


3

If you have vector roads data then the new (>2.14) trace tool in advanced feature editing should work for you.


3

EDIT: I deleted my previous answer as it was wrong. First big mistake I made was performing dot and cross products using spherical coordinates. One needs to convert them to Cartesian first. (I didn't figure out how to type in math, so I'm pasting images showing all the math). Below is the python implementation: def spherical2Cart(lat,lon): clat=(90-...


3

This is a really interesting question. I think that the zig-zag is the optimal geometry because this is the path that light would take if both boundaries were mirrors. The slight overlap in area is made up for by the increased efficiency in spanning the square, when walking at an angle to the edge. While writing R code, we might, therefore want to choose ...


3

If your road network is a local file or database, QGIS 3.0 has a Processing algorithm which will generate a routable version of it and can generate routes between all the point features in a source/dest layer.


2

oneway = 'yes' is how I understand flow direction limitations in OSM. OSM shares nodes on intersecting ways. You can detect the ways by checking the reference ids of the nodes. I have noticed that there are more than a few shared nodes at grade separated crossings which can cause some pretty serious routing issues. Since much of OSM in the US was based ...


2

Have you considered using a custom-built iOS or Android app? Possibly a bit more expensive than a regular GPS unit, but would do what you want, and show the map interactively! It sounds like you could do this pretty easily if you could publish the waypoints somewhere (e.g. on a webserver) and then connect via an app - if you used e.g. an iPad then you'd ...


2

This task can be completed in many ways, so here is one which I would use in your situation. Assuming that the XML data is not too complex I would parse the data into an x list and a y list (and lists for any other attributes you may have) using python, and then write the data to a shapefile using the standalone module pyshp. I have written a bit about using ...


2

The problem was that we need to set the spatial reference of the naFeatures that we were sending. Hence naFeatures.setSpatialReference(mMapView.getSpatialReference()); solved the problem!


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