From 8d67e552a32b5283c9f011861590dacdfbf80ed5 Mon Sep 17 00:00:00 2001 From: Mario Basa Date: Thu, 2 Sep 2021 22:25:19 +0900 Subject: [PATCH 1/3] streamline graph creation. --- src/main/java/org/pgrserver/graph/MainGraph.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/pgrserver/graph/MainGraph.java b/src/main/java/org/pgrserver/graph/MainGraph.java index 1b5fdfb..85325fe 100644 --- a/src/main/java/org/pgrserver/graph/MainGraph.java +++ b/src/main/java/org/pgrserver/graph/MainGraph.java @@ -79,23 +79,20 @@ public void createDirectedGraph() { defaultGraph = new DefaultDirectedWeightedGraph(LabeledWeightedEdge.class); - + for(PgrServer p : pgrData) { defaultGraph.addVertex((int)p.getSource()); defaultGraph.addVertex((int)p.getTarget()); - } - for(PgrServer p : pgrData) { LabeledWeightedEdge lwe = new LabeledWeightedEdge(); - lwe.setEdgeId(p.getId()); - + lwe.setEdgeId(p.getId()); + defaultGraph.addEdge( - (int)p.getSource(),(int)p.getTarget(),lwe); + (int)p.getSource(),(int)p.getTarget(),lwe); - defaultGraph.setEdgeWeight( - defaultGraph.getEdge((int)p.getSource(), - (int)p.getTarget()), p.getCost()); + defaultGraph.setEdgeWeight(lwe, p.getCost()); } + logger.info("Data received: "+pgrData.size()); } From 0c1b4299e014211cdecd7d9c596bdc23b55ba02d Mon Sep 17 00:00:00 2001 From: Mario Basa Date: Mon, 6 Sep 2021 11:33:06 +0900 Subject: [PATCH 2/3] adding minor information --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2f2026..15084d7 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,14 @@ id, source, target, cost, geom. CREATE VIEW pgrserver AS SELECT id,node_from AS source,node_to AS target,cost,wkb_geometry AS geom FROM kanto ; ``` +Getting the Application +----------------------- + +The *WAR* file of the application can be downloaded from from each stable release +of this repository. + + + Building the Application ------------------------ @@ -152,7 +160,11 @@ curl -X POST -F "authcode=abc12345" "http://localhost:8080/pgrServer/api/graphre Viewing the Data ---------------- -pgrServer returns a GeoJSON object for the created route or driving distance polygon, hence any application that supports GeoJSON can be used to view the results. +A demo application, [pgrServerDemo](http://github.com/pgrServerDemo) , has been created +to easily display selected features of pgrServer. + + +Also, pgrServer returns a GeoJSON object for the created route or driving distance polygon, hence any application that supports GeoJSON can be used to view the results. To quickly view the results, GeoJSONLint web service can be used: From 6de146cfec76b1ff8fb620daefb52157ff8a63b6 Mon Sep 17 00:00:00 2001 From: Mario Basa Date: Mon, 6 Sep 2021 11:37:57 +0900 Subject: [PATCH 3/3] fixed pgrServerDemo url. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 15084d7..3812c86 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ curl -X POST -F "authcode=abc12345" "http://localhost:8080/pgrServer/api/graphre Viewing the Data ---------------- -A demo application, [pgrServerDemo](http://github.com/pgrServerDemo) , has been created +A demo application, *[pgrServerDemo](http://github.com/mbasa/pgrServerDemo)* , has been created to easily display selected features of pgrServer.