File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
src/main/java/com/graphhopper Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 21
21
import com .graphhopper .routing .util .FastestCarCalc ;
22
22
import com .graphhopper .routing .ch .PrepareContractionHierarchies ;
23
23
import com .graphhopper .routing .util .PrepareRoutingSubnetworks ;
24
- import com .graphhopper .routing .util .PrepareTowerNodesShortcuts ;
25
24
import com .graphhopper .routing .util .RoutingAlgorithmSpecialAreaTests ;
26
25
import com .graphhopper .storage .Directory ;
27
26
import com .graphhopper .storage .Graph ;
Original file line number Diff line number Diff line change @@ -211,8 +211,8 @@ public String toString() {
211
211
*/
212
212
@ Override
213
213
public void preProcess (InputStream osmXml ) {
214
- pillarLats .createNew (expectedNodes / 10 );
215
- pillarLons .createNew (expectedNodes / 10 );
214
+ pillarLats .createNew (Math . max ( expectedNodes / 50 , 100 ) );
215
+ pillarLons .createNew (Math . max ( expectedNodes / 50 , 100 ) );
216
216
if (osmXml == null )
217
217
throw new IllegalStateException ("Stream cannot be empty" );
218
218
Original file line number Diff line number Diff line change @@ -116,11 +116,10 @@ public GraphStorage setSegmentSize(int bytes) {
116
116
}
117
117
118
118
public GraphStorage createNew (int nodeCount ) {
119
- nodes .createNew ((long ) nodeCount * 4 * nodeEntrySize );
120
-
121
- // approximative
122
- edges .createNew ((long ) nodeCount * 4 * edgeEntrySize );
123
- geometry .createNew ((long ) nodeCount / 10 );
119
+ int initBytes = Math .max (nodeCount * 4 / 50 , 100 );
120
+ nodes .createNew ((long ) initBytes * nodeEntrySize );
121
+ edges .createNew ((long ) initBytes * edgeEntrySize );
122
+ geometry .createNew ((long ) initBytes );
124
123
return this ;
125
124
}
126
125
You can’t perform that action at this time.
0 commit comments