Closed SteveFirsake closed 8 years ago
Hi there!
It looks like your almost on track.
You need to switch out the line that requires network.json
to something that loads the GeoJSON you want to use for routing. It should be a GeoJSON containing a FeaureCollection
of LineString
features, but you can load it any way you want: the require statement is just one possibility.
Hope this is a clear enough explanation and good luck!
Hello, I have the following comments and observations:
var finish = {
"type": "Point","crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [
"geometry":{
"type": "Point",
"coordinates": [36.97194311, -1.455614833]
}
]
};
var start = {
"type": "Point", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
"geometry":{
"type": "Point",
"coordinates": [36.9775,-1.4508]
}]
};
but these did not work.
Regards,
Steve
On Mon, Aug 8, 2016 at 3:37 PM, Per Liedman notifications@github.com wrote:
Closed #3 https://github.com/perliedman/geojson-path-finder/issues/3.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/perliedman/geojson-path-finder/issues/3#event-748318143, or mute the thread https://github.com/notifications/unsubscribe-auth/ASaFn8bcUq_NlcHAG2fFo3MiAWxOtlw_ks5qdyMagaJpZM4Jc1ql .
http://www.liedman.net/geojson-path-finder/ does indeed use GeoJSON Path Finder. Note that GeoJSON path finder is just the path finding bit - I also use Leaflet Routing Machine for the user interface. LRM is a user interface for routing, and does no path finding in itself, GeoJSON Path Finder has no user interface, just path finding. Hence, they complement each other perfectly.
You can check the actual code it uses to verify this: https://github.com/perliedman/geojson-path-finder/blob/gh-pages/index.js
The "router", or the adapter between LRM and GeoJSON Path Finder, can be found here: https://github.com/perliedman/geojson-path-finder/blob/gh-pages/router.js
As far as I know, this is the only public example of GeoJSON Path Finder. I use it in some customer projects, but they are not public yet.
Hello, let me start of by applauding this lovely package. I'm a noob when it comes to npm and node.js. What I am trying to achieve is to use your package in bootleaf (http://bmcbride.github.io/bootleaf/) or more precisely - https://github.com/bmcbride/bootleaf. : The folder structure is:
Project1 ----Data (has my geojson files) ----Assetts -----js (where my app.js resides) * all other folders as can be seen in Brian's repository
I have done the following:
npm install --save geojson-path-finder
var PathFinder = require('geojson-path-finder'), geojson = require('./network.json'); var pathFinder = new PathFinder(geojson);
var path = pathfinder.findPath(c1, c2);
alert(path);
I'm trying to do this for a school project, please guide me on the steps I should take.
Thanks in advance.