Imported Upstream version 0.0.0+svn3741
Bas Couwenberg
7 years ago
29 | 29 | <w>garmin's</w> |
30 | 30 | <w>gawron</w> |
31 | 31 | <w>geofabrik</w> |
32 | <w>gmapi</w> | |
32 | 33 | <w>gmapsupp</w> |
33 | 34 | <w>gpsmapedit</w> |
34 | 35 | <w>gtype</w> |
0 | 0 | <component name="InspectionProjectProfileManager"> |
1 | 1 | <profile version="1.0" is_locked="true"> |
2 | 2 | <option name="myName" value="Mapping" /> |
3 | <option name="myLocal" value="false" /> | |
4 | 3 | <inspection_tool class="AbsoluteAlignmentInUserInterface" enabled="false" level="WARNING" enabled_by_default="false" /> |
5 | 4 | <inspection_tool class="AbstractBeanReferencesInspection" enabled="true" level="ERROR" enabled_by_default="true" /> |
6 | 5 | <inspection_tool class="AbstractClassExtendsConcreteClass" enabled="false" level="WARNING" enabled_by_default="false" /> |
28 | 27 | <inspection_tool class="AndroidDomInspection" enabled="true" level="ERROR" enabled_by_default="true" /> |
29 | 28 | <inspection_tool class="AndroidElementNotAllowed" enabled="false" level="WARNING" enabled_by_default="false" /> |
30 | 29 | <inspection_tool class="AndroidKLintAddJavascriptInterface" enabled="false" level="WARNING" enabled_by_default="true" /> |
30 | <inspection_tool class="AndroidKLintAllowAllHostnameVerifier" enabled="false" level="WARNING" enabled_by_default="false" /> | |
31 | 31 | <inspection_tool class="AndroidKLintAlwaysShowAction" enabled="false" level="WARNING" enabled_by_default="true" /> |
32 | 32 | <inspection_tool class="AndroidKLintAppCompatMethod" enabled="false" level="WARNING" enabled_by_default="true" /> |
33 | <inspection_tool class="AndroidKLintAuthLeak" enabled="false" level="WARNING" enabled_by_default="false" /> | |
34 | <inspection_tool class="AndroidKLintBadHostnameVerifier" enabled="false" level="WARNING" enabled_by_default="false" /> | |
35 | <inspection_tool class="AndroidKLintBatteryLife" enabled="false" level="WARNING" enabled_by_default="false" /> | |
33 | 36 | <inspection_tool class="AndroidKLintCommitPrefEdits" enabled="false" level="WARNING" enabled_by_default="true" /> |
34 | 37 | <inspection_tool class="AndroidKLintCommitTransaction" enabled="false" level="WARNING" enabled_by_default="true" /> |
35 | 38 | <inspection_tool class="AndroidKLintCustomViewStyleable" enabled="false" level="WARNING" enabled_by_default="true" /> |
36 | 39 | <inspection_tool class="AndroidKLintCutPasteId" enabled="false" level="WARNING" enabled_by_default="true" /> |
40 | <inspection_tool class="AndroidKLintDefaultLocale" enabled="false" level="WARNING" enabled_by_default="false" /> | |
37 | 41 | <inspection_tool class="AndroidKLintDrawAllocation" enabled="false" level="WARNING" enabled_by_default="true" /> |
38 | 42 | <inspection_tool class="AndroidKLintEasterEgg" enabled="false" level="WARNING" enabled_by_default="false" /> |
39 | 43 | <inspection_tool class="AndroidKLintExportedContentProvider" enabled="false" level="WARNING" enabled_by_default="true" /> |
40 | 44 | <inspection_tool class="AndroidKLintExportedPreferenceActivity" enabled="false" level="WARNING" enabled_by_default="true" /> |
41 | 45 | <inspection_tool class="AndroidKLintExportedReceiver" enabled="false" level="WARNING" enabled_by_default="true" /> |
42 | 46 | <inspection_tool class="AndroidKLintExportedService" enabled="false" level="WARNING" enabled_by_default="true" /> |
47 | <inspection_tool class="AndroidKLintFloatMath" enabled="false" level="WARNING" enabled_by_default="false" /> | |
43 | 48 | <inspection_tool class="AndroidKLintGetInstance" enabled="false" level="WARNING" enabled_by_default="true" /> |
44 | 49 | <inspection_tool class="AndroidKLintGifUsage" enabled="false" level="WARNING" enabled_by_default="true" /> |
50 | <inspection_tool class="AndroidKLintGoogleAppIndexingApiWarning" enabled="false" level="WARNING" enabled_by_default="false" /> | |
51 | <inspection_tool class="AndroidKLintGoogleAppIndexingUrlError" enabled="false" level="ERROR" enabled_by_default="false" /> | |
52 | <inspection_tool class="AndroidKLintGoogleAppIndexingWarning" enabled="false" level="WARNING" enabled_by_default="false" /> | |
45 | 53 | <inspection_tool class="AndroidKLintGrantAllUris" enabled="false" level="WARNING" enabled_by_default="true" /> |
46 | 54 | <inspection_tool class="AndroidKLintHandlerLeak" enabled="false" level="WARNING" enabled_by_default="true" /> |
47 | 55 | <inspection_tool class="AndroidKLintIconColors" enabled="false" level="WARNING" enabled_by_default="true" /> |
60 | 68 | <inspection_tool class="AndroidKLintInconsistentLayout" enabled="false" level="WARNING" enabled_by_default="true" /> |
61 | 69 | <inspection_tool class="AndroidKLintInflateParams" enabled="false" level="WARNING" enabled_by_default="true" /> |
62 | 70 | <inspection_tool class="AndroidKLintInlinedApi" enabled="false" level="WARNING" enabled_by_default="true" /> |
71 | <inspection_tool class="AndroidKLintInvalidUsesTagAttribute" enabled="false" level="ERROR" enabled_by_default="false" /> | |
63 | 72 | <inspection_tool class="AndroidKLintJavascriptInterface" enabled="false" level="ERROR" enabled_by_default="true" /> |
64 | 73 | <inspection_tool class="AndroidKLintLocalSuppress" enabled="false" level="ERROR" enabled_by_default="true" /> |
65 | 74 | <inspection_tool class="AndroidKLintLogConditional" enabled="false" level="WARNING" enabled_by_default="false" /> |
66 | 75 | <inspection_tool class="AndroidKLintLogTagMismatch" enabled="false" level="ERROR" enabled_by_default="true" /> |
67 | 76 | <inspection_tool class="AndroidKLintLongLogTag" enabled="false" level="ERROR" enabled_by_default="true" /> |
68 | 77 | <inspection_tool class="AndroidKLintMergeRootFrame" enabled="false" level="WARNING" enabled_by_default="true" /> |
78 | <inspection_tool class="AndroidKLintMissingIntentFilterForMediaSearch" enabled="false" level="ERROR" enabled_by_default="false" /> | |
79 | <inspection_tool class="AndroidKLintMissingMediaBrowserServiceIntentFilter" enabled="false" level="ERROR" enabled_by_default="false" /> | |
80 | <inspection_tool class="AndroidKLintMissingOnPlayFromSearch" enabled="false" level="ERROR" enabled_by_default="false" /> | |
69 | 81 | <inspection_tool class="AndroidKLintMissingSuperCall" enabled="false" level="ERROR" enabled_by_default="true" /> |
70 | 82 | <inspection_tool class="AndroidKLintNewApi" enabled="false" level="ERROR" enabled_by_default="true" /> |
71 | 83 | <inspection_tool class="AndroidKLintOverdraw" enabled="false" level="WARNING" enabled_by_default="true" /> |
72 | 84 | <inspection_tool class="AndroidKLintOverride" enabled="false" level="ERROR" enabled_by_default="true" /> |
73 | 85 | <inspection_tool class="AndroidKLintOverrideAbstract" enabled="false" level="ERROR" enabled_by_default="true" /> |
74 | 86 | <inspection_tool class="AndroidKLintPackageManagerGetSignatures" enabled="false" level="WARNING" enabled_by_default="true" /> |
87 | <inspection_tool class="AndroidKLintParcelClassLoader" enabled="false" level="WARNING" enabled_by_default="false" /> | |
75 | 88 | <inspection_tool class="AndroidKLintParcelCreator" enabled="false" level="ERROR" enabled_by_default="true" /> |
89 | <inspection_tool class="AndroidKLintPendingBindings" enabled="false" level="ERROR" enabled_by_default="false" /> | |
76 | 90 | <inspection_tool class="AndroidKLintPluralsCandidate" enabled="false" level="WARNING" enabled_by_default="true" /> |
77 | 91 | <inspection_tool class="AndroidKLintPrivateResource" enabled="false" level="WARNING" enabled_by_default="true" /> |
78 | 92 | <inspection_tool class="AndroidKLintRecycle" enabled="false" level="WARNING" enabled_by_default="true" /> |
93 | <inspection_tool class="AndroidKLintRecyclerView" enabled="false" level="WARNING" enabled_by_default="false" /> | |
94 | <inspection_tool class="AndroidKLintRegistered" enabled="false" level="WARNING" enabled_by_default="false" /> | |
79 | 95 | <inspection_tool class="AndroidKLintRequiredSize" enabled="false" level="ERROR" enabled_by_default="true" /> |
80 | 96 | <inspection_tool class="AndroidKLintRtlCompat" enabled="false" level="ERROR" enabled_by_default="true" /> |
81 | 97 | <inspection_tool class="AndroidKLintRtlEnabled" enabled="false" level="WARNING" enabled_by_default="true" /> |
82 | 98 | <inspection_tool class="AndroidKLintRtlHardcoded" enabled="false" level="WARNING" enabled_by_default="true" /> |
83 | 99 | <inspection_tool class="AndroidKLintRtlSymmetry" enabled="false" level="WARNING" enabled_by_default="true" /> |
84 | 100 | <inspection_tool class="AndroidKLintSQLiteString" enabled="false" level="WARNING" enabled_by_default="true" /> |
101 | <inspection_tool class="AndroidKLintSSLCertificateSocketFactoryCreateSocket" enabled="false" level="WARNING" enabled_by_default="false" /> | |
102 | <inspection_tool class="AndroidKLintSSLCertificateSocketFactoryGetInsecure" enabled="false" level="WARNING" enabled_by_default="false" /> | |
85 | 103 | <inspection_tool class="AndroidKLintSdCardPath" enabled="false" level="WARNING" enabled_by_default="true" /> |
104 | <inspection_tool class="AndroidKLintSecureRandom" enabled="false" level="WARNING" enabled_by_default="false" /> | |
86 | 105 | <inspection_tool class="AndroidKLintServiceCast" enabled="false" level="ERROR" enabled_by_default="true" /> |
87 | 106 | <inspection_tool class="AndroidKLintSetJavaScriptEnabled" enabled="false" level="WARNING" enabled_by_default="true" /> |
107 | <inspection_tool class="AndroidKLintSetTextI18n" enabled="false" level="WARNING" enabled_by_default="false" /> | |
108 | <inspection_tool class="AndroidKLintSetWorldReadable" enabled="false" level="WARNING" enabled_by_default="false" /> | |
109 | <inspection_tool class="AndroidKLintSetWorldWritable" enabled="false" level="WARNING" enabled_by_default="false" /> | |
110 | <inspection_tool class="AndroidKLintShiftFlags" enabled="false" level="WARNING" enabled_by_default="false" /> | |
88 | 111 | <inspection_tool class="AndroidKLintShortAlarm" enabled="false" level="WARNING" enabled_by_default="true" /> |
89 | 112 | <inspection_tool class="AndroidKLintShowToast" enabled="false" level="WARNING" enabled_by_default="true" /> |
90 | 113 | <inspection_tool class="AndroidKLintSimpleDateFormat" enabled="false" level="WARNING" enabled_by_default="true" /> |
92 | 115 | <inspection_tool class="AndroidKLintStringFormatCount" enabled="false" level="WARNING" enabled_by_default="true" /> |
93 | 116 | <inspection_tool class="AndroidKLintStringFormatInvalid" enabled="false" level="ERROR" enabled_by_default="true" /> |
94 | 117 | <inspection_tool class="AndroidKLintStringFormatMatches" enabled="false" level="ERROR" enabled_by_default="true" /> |
118 | <inspection_tool class="AndroidKLintSupportAnnotationUsage" enabled="false" level="ERROR" enabled_by_default="false" /> | |
95 | 119 | <inspection_tool class="AndroidKLintSuspiciousImport" enabled="false" level="WARNING" enabled_by_default="true" /> |
120 | <inspection_tool class="AndroidKLintSwitchIntDef" enabled="false" level="WARNING" enabled_by_default="false" /> | |
121 | <inspection_tool class="AndroidKLintTrustAllX509TrustManager" enabled="false" level="WARNING" enabled_by_default="false" /> | |
122 | <inspection_tool class="AndroidKLintUniqueConstants" enabled="false" level="ERROR" enabled_by_default="false" /> | |
96 | 123 | <inspection_tool class="AndroidKLintUnlocalizedSms" enabled="false" level="WARNING" enabled_by_default="true" /> |
124 | <inspection_tool class="AndroidKLintUnprotectedSMSBroadcastReceiver" enabled="false" level="WARNING" enabled_by_default="false" /> | |
125 | <inspection_tool class="AndroidKLintUnsafeDynamicallyLoadedCode" enabled="false" level="WARNING" enabled_by_default="false" /> | |
126 | <inspection_tool class="AndroidKLintUnsafeNativeCodeLocation" enabled="false" level="WARNING" enabled_by_default="false" /> | |
127 | <inspection_tool class="AndroidKLintUnsafeProtectedBroadcastReceiver" enabled="false" level="WARNING" enabled_by_default="false" /> | |
128 | <inspection_tool class="AndroidKLintUnusedAttribute" enabled="false" level="WARNING" enabled_by_default="false" /> | |
97 | 129 | <inspection_tool class="AndroidKLintUnusedIds" enabled="false" level="WARNING" enabled_by_default="false" /> |
98 | 130 | <inspection_tool class="AndroidKLintUnusedResources" enabled="false" level="WARNING" enabled_by_default="true" /> |
99 | 131 | <inspection_tool class="AndroidKLintUseSparseArrays" enabled="false" level="WARNING" enabled_by_default="true" /> |
101 | 133 | <inspection_tool class="AndroidKLintValidFragment" enabled="false" level="ERROR" enabled_by_default="true" /> |
102 | 134 | <inspection_tool class="AndroidKLintViewConstructor" enabled="false" level="WARNING" enabled_by_default="true" /> |
103 | 135 | <inspection_tool class="AndroidKLintViewHolder" enabled="false" level="WARNING" enabled_by_default="true" /> |
136 | <inspection_tool class="AndroidKLintViewTag" enabled="false" level="WARNING" enabled_by_default="false" /> | |
104 | 137 | <inspection_tool class="AndroidKLintWorldReadableFiles" enabled="false" level="WARNING" enabled_by_default="true" /> |
105 | 138 | <inspection_tool class="AndroidKLintWorldWriteableFiles" enabled="false" level="WARNING" enabled_by_default="true" /> |
106 | 139 | <inspection_tool class="AndroidKLintWrongCall" enabled="false" level="ERROR" enabled_by_default="true" /> |
119 | 152 | <inspection_tool class="AndroidLintAppLinksAutoVerifyError" enabled="false" level="ERROR" enabled_by_default="false" /> |
120 | 153 | <inspection_tool class="AndroidLintAppLinksAutoVerifyWarning" enabled="false" level="WARNING" enabled_by_default="false" /> |
121 | 154 | <inspection_tool class="AndroidLintAssert" enabled="false" level="WARNING" enabled_by_default="true" /> |
155 | <inspection_tool class="AndroidLintAuthLeak" enabled="false" level="WARNING" enabled_by_default="false" /> | |
122 | 156 | <inspection_tool class="AndroidLintBackButton" enabled="false" level="WARNING" enabled_by_default="false" /> |
123 | 157 | <inspection_tool class="AndroidLintBadHostnameVerifier" enabled="false" level="WARNING" enabled_by_default="true" /> |
158 | <inspection_tool class="AndroidLintBatteryLife" enabled="false" level="WARNING" enabled_by_default="false" /> | |
124 | 159 | <inspection_tool class="AndroidLintButtonCase" enabled="false" level="WARNING" enabled_by_default="false" /> |
125 | 160 | <inspection_tool class="AndroidLintButtonOrder" enabled="false" level="WARNING" enabled_by_default="false" /> |
126 | 161 | <inspection_tool class="AndroidLintButtonStyle" enabled="false" level="WARNING" enabled_by_default="true" /> |
173 | 208 | <inspection_tool class="AndroidLintHandlerLeak" enabled="false" level="WARNING" enabled_by_default="true" /> |
174 | 209 | <inspection_tool class="AndroidLintHardcodedDebugMode" enabled="false" level="WARNING" enabled_by_default="false" /> |
175 | 210 | <inspection_tool class="AndroidLintHardcodedText" enabled="false" level="WARNING" enabled_by_default="false" /> |
211 | <inspection_tool class="AndroidLintHardwareIds" enabled="false" level="WARNING" enabled_by_default="false" /> | |
176 | 212 | <inspection_tool class="AndroidLintIconColors" enabled="false" level="WARNING" enabled_by_default="true" /> |
177 | 213 | <inspection_tool class="AndroidLintIconDensities" enabled="false" level="WARNING" enabled_by_default="false" /> |
178 | 214 | <inspection_tool class="AndroidLintIconDipSize" enabled="false" level="WARNING" enabled_by_default="false" /> |
214 | 250 | <inspection_tool class="AndroidLintMergeRootFrame" enabled="false" level="WARNING" enabled_by_default="false" /> |
215 | 251 | <inspection_tool class="AndroidLintMipmapIcons" enabled="false" level="WARNING" enabled_by_default="true" /> |
216 | 252 | <inspection_tool class="AndroidLintMissingApplicationIcon" enabled="false" level="WARNING" enabled_by_default="true" /> |
253 | <inspection_tool class="AndroidLintMissingConstraints" enabled="false" level="ERROR" enabled_by_default="false" /> | |
217 | 254 | <inspection_tool class="AndroidLintMissingId" enabled="false" level="WARNING" enabled_by_default="true" /> |
218 | 255 | <inspection_tool class="AndroidLintMissingIntentFilterForMediaSearch" enabled="false" level="ERROR" enabled_by_default="true" /> |
219 | 256 | <inspection_tool class="AndroidLintMissingLeanbackLauncher" enabled="false" level="ERROR" enabled_by_default="true" /> |
246 | 283 | <inspection_tool class="AndroidLintPackagedPrivateKey" enabled="false" level="WARNING" enabled_by_default="true" /> |
247 | 284 | <inspection_tool class="AndroidLintParcelClassLoader" enabled="false" level="WARNING" enabled_by_default="true" /> |
248 | 285 | <inspection_tool class="AndroidLintParcelCreator" enabled="false" level="WARNING" enabled_by_default="true" /> |
286 | <inspection_tool class="AndroidLintPendingBindings" enabled="false" level="ERROR" enabled_by_default="false" /> | |
249 | 287 | <inspection_tool class="AndroidLintPermissionImpliesUnsupportedHardware" enabled="false" level="WARNING" enabled_by_default="true" /> |
250 | 288 | <inspection_tool class="AndroidLintPluralsCandidate" enabled="false" level="WARNING" enabled_by_default="true" /> |
251 | 289 | <inspection_tool class="AndroidLintPrivateResource" enabled="false" level="ERROR" enabled_by_default="false" /> |
291 | 329 | <inspection_tool class="AndroidLintSpUsage" enabled="false" level="WARNING" enabled_by_default="true" /> |
292 | 330 | <inspection_tool class="AndroidLintSparseArray" enabled="false" level="WARNING" enabled_by_default="false" /> |
293 | 331 | <inspection_tool class="AndroidLintStateListReachable" enabled="false" level="WARNING" enabled_by_default="false" /> |
332 | <inspection_tool class="AndroidLintStaticFieldLeak" enabled="false" level="WARNING" enabled_by_default="false" /> | |
294 | 333 | <inspection_tool class="AndroidLintStopShip" enabled="false" level="WARNING" enabled_by_default="false" /> |
295 | 334 | <inspection_tool class="AndroidLintStringFormatCount" enabled="true" level="WARNING" enabled_by_default="true" /> |
296 | 335 | <inspection_tool class="AndroidLintStringFormatInvalid" enabled="true" level="ERROR" enabled_by_default="true" /> |
297 | 336 | <inspection_tool class="AndroidLintStringFormatMatches" enabled="true" level="ERROR" enabled_by_default="true" /> |
298 | 337 | <inspection_tool class="AndroidLintStringShouldBeInt" enabled="false" level="ERROR" enabled_by_default="true" /> |
299 | 338 | <inspection_tool class="AndroidLintStyleCycle" enabled="false" level="ERROR" enabled_by_default="false" /> |
339 | <inspection_tool class="AndroidLintSupportAnnotationUsage" enabled="false" level="ERROR" enabled_by_default="false" /> | |
300 | 340 | <inspection_tool class="AndroidLintSuspicious0dp" enabled="false" level="ERROR" enabled_by_default="true" /> |
301 | 341 | <inspection_tool class="AndroidLintSuspiciousImport" enabled="false" level="WARNING" enabled_by_default="false" /> |
302 | 342 | <inspection_tool class="AndroidLintSwitchIntDef" enabled="false" level="WARNING" enabled_by_default="true" /> |
336 | 376 | <inspection_tool class="AndroidLintUsingHttp" enabled="false" level="WARNING" enabled_by_default="true" /> |
337 | 377 | <inspection_tool class="AndroidLintValidFragment" enabled="false" level="ERROR" enabled_by_default="true" /> |
338 | 378 | <inspection_tool class="AndroidLintValidRestrictions" enabled="false" level="ERROR" enabled_by_default="true" /> |
379 | <inspection_tool class="AndroidLintVectorDrawableCompat" enabled="false" level="ERROR" enabled_by_default="false" /> | |
339 | 380 | <inspection_tool class="AndroidLintVectorRaster" enabled="false" level="WARNING" enabled_by_default="true" /> |
340 | 381 | <inspection_tool class="AndroidLintViewConstructor" enabled="false" level="WARNING" enabled_by_default="true" /> |
341 | 382 | <inspection_tool class="AndroidLintViewHolder" enabled="false" level="WARNING" enabled_by_default="true" /> |
342 | 383 | <inspection_tool class="AndroidLintViewTag" enabled="false" level="WARNING" enabled_by_default="true" /> |
384 | <inspection_tool class="AndroidLintWearableBindListener" enabled="false" level="ERROR" enabled_by_default="false" /> | |
343 | 385 | <inspection_tool class="AndroidLintWebViewLayout" enabled="false" level="ERROR" enabled_by_default="true" /> |
344 | 386 | <inspection_tool class="AndroidLintWorldReadableFiles" enabled="false" level="WARNING" enabled_by_default="true" /> |
345 | 387 | <inspection_tool class="AndroidLintWorldWriteableFiles" enabled="false" level="WARNING" enabled_by_default="false" /> |
368 | 410 | </inspection_tool> |
369 | 411 | <inspection_tool class="AnonymousClassVariableHidesContainingMethodVariable" enabled="false" level="WARNING" enabled_by_default="false" /> |
370 | 412 | <inspection_tool class="AnonymousFunctionJS" enabled="false" level="WARNING" enabled_by_default="false" /> |
413 | <inspection_tool class="AnonymousHasLambdaAlternative" enabled="true" level="WARNING" enabled_by_default="true" /> | |
371 | 414 | <inspection_tool class="AnonymousInnerClass" enabled="false" level="WARNING" enabled_by_default="false" /> |
372 | 415 | <inspection_tool class="AnonymousInnerClassMayBeStatic" enabled="false" level="WARNING" enabled_by_default="false" /> |
373 | 416 | <inspection_tool class="AntDuplicateTargetsInspection" enabled="true" level="ERROR" enabled_by_default="true" /> |
381 | 424 | <inspection_tool class="ArgNamesErrorsInspection" enabled="true" level="ERROR" enabled_by_default="true" /> |
382 | 425 | <inspection_tool class="ArgNamesWarningsInspection" enabled="true" level="WARNING" enabled_by_default="true" /> |
383 | 426 | <inspection_tool class="AroundAdviceStyleInspection" enabled="true" level="WARNING" enabled_by_default="true" /> |
427 | <inspection_tool class="ArrayCreationWithoutNewKeyword" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
384 | 428 | <inspection_tool class="ArrayEquality" enabled="true" level="WARNING" enabled_by_default="true" /> |
385 | 429 | <inspection_tool class="ArrayEquals" enabled="true" level="WARNING" enabled_by_default="true" /> |
386 | 430 | <inspection_tool class="ArrayHashCode" enabled="true" level="WARNING" enabled_by_default="true" /> |
387 | 431 | <inspection_tool class="ArrayInDataClass" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
388 | 432 | <inspection_tool class="ArrayLengthInLoopCondition" enabled="false" level="WARNING" enabled_by_default="false" /> |
389 | <inspection_tool class="ArrayObjectsEquals" enabled="false" level="WARNING" enabled_by_default="true" /> | |
433 | <inspection_tool class="ArrayObjectsEquals" enabled="true" level="WARNING" enabled_by_default="true" /> | |
390 | 434 | <inspection_tool class="ArraysAsListWithZeroOrOneArgument" enabled="false" level="WARNING" enabled_by_default="false" /> |
391 | 435 | <inspection_tool class="AssertAsName" enabled="false" level="WARNING" enabled_by_default="false" /> |
392 | 436 | <inspection_tool class="AssertEqualsBetweenInconvertibleTypes" enabled="true" level="WARNING" enabled_by_default="true" /> |
396 | 440 | <inspection_tool class="AssertMessageNotString" enabled="false" level="WARNING" enabled_by_default="false" /> |
397 | 441 | <inspection_tool class="AssertStatement" enabled="false" level="WARNING" enabled_by_default="false" /> |
398 | 442 | <inspection_tool class="AssertWithSideEffects" enabled="true" level="WARNING" enabled_by_default="true" /> |
443 | <inspection_tool class="AssertionCanBeIf" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
399 | 444 | <inspection_tool class="AssertsWithoutMessages" enabled="false" level="WARNING" enabled_by_default="false" /> |
400 | 445 | <inspection_tool class="AssertsWithoutMessagesTestNG" enabled="false" level="WARNING" enabled_by_default="false" /> |
401 | 446 | <inspection_tool class="AssignmentResultUsedJS" enabled="false" level="WARNING" enabled_by_default="false" /> |
419 | 464 | <inspection_tool class="AssignmentToStaticFieldFromInstanceMethod" enabled="false" level="WARNING" enabled_by_default="false" /> |
420 | 465 | <inspection_tool class="AssignmentToSuperclassField" enabled="false" level="WARNING" enabled_by_default="false" /> |
421 | 466 | <inspection_tool class="AssignmentUsedAsCondition" enabled="true" level="WARNING" enabled_by_default="true" /> |
422 | <inspection_tool class="AtomicFieldUpdaterIssues" enabled="false" level="WARNING" enabled_by_default="true" /> | |
423 | <inspection_tool class="AtomicFieldUpdaterNotStaticFinal" enabled="false" level="WARNING" enabled_by_default="true" /> | |
467 | <inspection_tool class="AtomicFieldUpdaterIssues" enabled="true" level="WARNING" enabled_by_default="true" /> | |
468 | <inspection_tool class="AtomicFieldUpdaterNotStaticFinal" enabled="true" level="WARNING" enabled_by_default="true" /> | |
424 | 469 | <inspection_tool class="AutoBoxing" enabled="false" level="INFO" enabled_by_default="false"> |
425 | 470 | <option name="ignoreAddedToCollection" value="false" /> |
426 | 471 | </inspection_tool> |
462 | 507 | <inspection_tool class="BlockMarkerComments" enabled="false" level="WARNING" enabled_by_default="false" /> |
463 | 508 | <inspection_tool class="BlockStatementJS" enabled="false" level="WARNING" enabled_by_default="false" /> |
464 | 509 | <inspection_tool class="BooleanConstructor" enabled="true" level="WARNING" enabled_by_default="true" /> |
465 | <inspection_tool class="BooleanExpressionMayBeConditional" enabled="false" level="WARNING" enabled_by_default="false" /> | |
510 | <inspection_tool class="BooleanExpressionMayBeConditional" enabled="true" level="WARNING" enabled_by_default="true" /> | |
466 | 511 | <inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" /> |
467 | 512 | <inspection_tool class="BooleanMethodNameMustStartWithQuestion" enabled="false" level="WARNING" enabled_by_default="false"> |
468 | 513 | <option name="ignoreBooleanMethods" value="false" /> |
631 | 676 | <inspection_tool class="CloneableImplementsClone" enabled="true" level="WARNING" enabled_by_default="true"> |
632 | 677 | <option name="m_ignoreCloneableDueToInheritance" value="true" /> |
633 | 678 | </inspection_tool> |
634 | <inspection_tool class="CodeBlock2Expr" enabled="false" level="WARNING" enabled_by_default="false" /> | |
679 | <inspection_tool class="CodeBlock2Expr" enabled="true" level="WARNING" enabled_by_default="true" /> | |
635 | 680 | <inspection_tool class="CollectionAddAllCanBeReplacedWithConstructor" enabled="false" level="WARNING" enabled_by_default="false" /> |
636 | 681 | <inspection_tool class="CollectionAddedToSelf" enabled="false" level="WARNING" enabled_by_default="false" /> |
637 | 682 | <inspection_tool class="CollectionContainsUrl" enabled="false" level="WARNING" enabled_by_default="false" /> |
640 | 685 | <inspection_tool class="CommaExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" /> |
641 | 686 | <inspection_tool class="CommandLineInspection" enabled="false" level="WARNING" enabled_by_default="true" /> |
642 | 687 | <inspection_tool class="ComparableImplementedButEqualsNotOverridden" enabled="false" level="WARNING" enabled_by_default="false" /> |
688 | <inspection_tool class="ComparatorCombinators" enabled="true" level="WARNING" enabled_by_default="true" /> | |
643 | 689 | <inspection_tool class="ComparatorMethodParameterNotUsed" enabled="true" level="WARNING" enabled_by_default="true" /> |
644 | 690 | <inspection_tool class="ComparatorNotSerializable" enabled="false" level="WARNING" enabled_by_default="false" /> |
645 | 691 | <inspection_tool class="CompareToUsesNonFinalVariable" enabled="false" level="WARNING" enabled_by_default="false" /> |
710 | 756 | <inspection_tool class="ControlFlowStatementWithoutBraces" enabled="false" level="WARNING" enabled_by_default="false" /> |
711 | 757 | <inspection_tool class="Convert2Diamond" enabled="true" level="WARNING" enabled_by_default="true" /> |
712 | 758 | <inspection_tool class="Convert2Lambda" enabled="false" level="WARNING" enabled_by_default="false" /> |
713 | <inspection_tool class="Convert2MethodRef" enabled="false" level="WARNING" enabled_by_default="false" /> | |
714 | <inspection_tool class="Convert2streamapi" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> | |
759 | <inspection_tool class="Convert2MethodRef" enabled="true" level="WARNING" enabled_by_default="true" /> | |
760 | <inspection_tool class="Convert2streamapi" enabled="true" level="WEAK WARNING" enabled_by_default="true" /> | |
715 | 761 | <inspection_tool class="ConvertAnnotations" enabled="false" level="WARNING" enabled_by_default="false" /> |
716 | 762 | <inspection_tool class="ConvertJavadoc" enabled="false" level="WARNING" enabled_by_default="false" /> |
717 | 763 | <inspection_tool class="ConvertLambdaToReference" enabled="false" level="INFO" enabled_by_default="true" /> |
718 | 764 | <inspection_tool class="ConvertOldAnnotations" enabled="false" level="WARNING" enabled_by_default="false" /> |
765 | <inspection_tool class="ConvertSecondaryConstructorToPrimary" enabled="false" level="WARNING" enabled_by_default="false" /> | |
719 | 766 | <inspection_tool class="ConvertToStringTemplate" enabled="false" level="INFO" enabled_by_default="true" /> |
720 | 767 | <inspection_tool class="CovariantCompareTo" enabled="false" level="WARNING" enabled_by_default="false" /> |
721 | 768 | <inspection_tool class="CovariantEquals" enabled="false" level="WARNING" enabled_by_default="false" /> |
761 | 808 | </inspection_tool> |
762 | 809 | <inspection_tool class="CssUnknownTarget" enabled="false" level="ERROR" enabled_by_default="true" /> |
763 | 810 | <inspection_tool class="CssUnknownTargetInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
811 | <inspection_tool class="CssUnresolvedClass" enabled="false" level="ERROR" enabled_by_default="false" /> | |
764 | 812 | <inspection_tool class="CssUnresolvedCustomProperty" enabled="false" level="ERROR" enabled_by_default="true" /> |
813 | <inspection_tool class="CssUnresolvedCustomPropertySet" enabled="false" level="ERROR" enabled_by_default="false" /> | |
765 | 814 | <inspection_tool class="CssUnusedSymbol" enabled="false" level="WARNING" enabled_by_default="true" /> |
766 | 815 | <inspection_tool class="CssUnusedSymbolInspection" enabled="true" level="WARNING" enabled_by_default="true" /> |
767 | 816 | <inspection_tool class="CucumberExamplesColon" enabled="false" level="ERROR" enabled_by_default="false" /> |
800 | 849 | <inspection_tool class="DeprecatedCallableAddReplaceWith" enabled="false" level="INFO" enabled_by_default="true" /> |
801 | 850 | <inspection_tool class="DeprecatedClassUsageInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
802 | 851 | <inspection_tool class="DeprecatedDefenderSyntax" enabled="false" level="WARNING" enabled_by_default="false" /> |
852 | <inspection_tool class="DeprecatedIsStillUsed" enabled="false" level="WARNING" enabled_by_default="false" /> | |
803 | 853 | <inspection_tool class="DeprecatedObjectInstanceFieldReference" enabled="false" level="WARNING" enabled_by_default="true" /> |
804 | 854 | <inspection_tool class="DeprecatedUsageOfStaticField" enabled="false" level="WARNING" enabled_by_default="true" /> |
805 | 855 | <inspection_tool class="Deprecation" enabled="true" level="WARNING" enabled_by_default="true" /> |
806 | 856 | <inspection_tool class="DeserializableClassInSecureContext" enabled="false" level="WARNING" enabled_by_default="false" /> |
807 | 857 | <inspection_tool class="DesignForExtension" enabled="false" level="WARNING" enabled_by_default="false" /> |
858 | <inspection_tool class="Destructure" enabled="false" level="INFO" enabled_by_default="false" /> | |
808 | 859 | <inspection_tool class="DialogTitleCapitalization" enabled="false" level="WARNING" enabled_by_default="false" /> |
860 | <inspection_tool class="DiamondCanBeReplacedWithExplicitTypeArguments" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
809 | 861 | <inspection_tool class="DifferentKotlinGradleVersion" enabled="false" level="WARNING" enabled_by_default="true" /> |
810 | 862 | <inspection_tool class="DifferentStdlibGradleVersion" enabled="false" level="WARNING" enabled_by_default="true" /> |
811 | 863 | <inspection_tool class="DisjointPackage" enabled="false" level="WARNING" enabled_by_default="false" /> |
864 | 916 | <inspection_tool class="ELSpecValidationInJSP" enabled="true" level="WARNING" enabled_by_default="true" /> |
865 | 917 | <inspection_tool class="ELValidationInJSP" enabled="true" level="WARNING" enabled_by_default="true" /> |
866 | 918 | <inspection_tool class="ES6BindWithArrowFunction" enabled="false" level="WARNING" enabled_by_default="true" /> |
919 | <inspection_tool class="ES6ConvertRequireIntoImport" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
867 | 920 | <inspection_tool class="ES6ConvertVarToLetConst" enabled="false" level="WARNING" enabled_by_default="false" /> |
868 | 921 | <inspection_tool class="ES6ModulesDependencies" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
869 | 922 | <inspection_tool class="ES6UnusedImports" enabled="false" level="WARNING" enabled_by_default="true" /> |
933 | 986 | </inspection_tool> |
934 | 987 | <inspection_tool class="EnumerationCanBeIteration" enabled="false" level="WARNING" enabled_by_default="false" /> |
935 | 988 | <inspection_tool class="EqualityComparisonWithCoercionJS" enabled="false" level="WARNING" enabled_by_default="false" /> |
989 | <inspection_tool class="EqualityOperatorComparesObjects" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
936 | 990 | <inspection_tool class="EqualsAndHashcode" enabled="false" level="WARNING" enabled_by_default="false" /> |
937 | 991 | <inspection_tool class="EqualsBetweenInconvertibleTypes" enabled="true" level="WARNING" enabled_by_default="true" /> |
938 | 992 | <inspection_tool class="EqualsCalledOnEnumConstant" enabled="false" level="WARNING" enabled_by_default="false" /> |
939 | 993 | <inspection_tool class="EqualsHashCodeCalledOnUrl" enabled="false" level="WARNING" enabled_by_default="false" /> |
940 | 994 | <inspection_tool class="EqualsOrHashCode" enabled="false" level="WARNING" enabled_by_default="true" /> |
941 | <inspection_tool class="EqualsReplaceableByObjectsCall" enabled="false" level="WARNING" enabled_by_default="false" /> | |
995 | <inspection_tool class="EqualsReplaceableByObjectsCall" enabled="true" level="WARNING" enabled_by_default="true" /> | |
942 | 996 | <inspection_tool class="EqualsUsesNonFinalVariable" enabled="false" level="WARNING" enabled_by_default="false" /> |
943 | 997 | <inspection_tool class="EqualsWhichDoesntCheckParameterClass" enabled="true" level="WARNING" enabled_by_default="true" /> |
944 | 998 | <inspection_tool class="EqualsWithItself" enabled="false" level="WARNING" enabled_by_default="true" /> |
1021 | 1075 | <inspection_tool class="FlexUnitMixedAPIInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1022 | 1076 | <inspection_tool class="FlexUnitSuiteWithNoRunnerInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1023 | 1077 | <inspection_tool class="FloatingPointEquality" enabled="false" level="WARNING" enabled_by_default="false" /> |
1078 | <inspection_tool class="FlowJSConfig" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1079 | <inspection_tool class="FlowJSCoverage" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> | |
1080 | <inspection_tool class="FlowJSError" enabled="false" level="ERROR" enabled_by_default="false" /> | |
1081 | <inspection_tool class="FlowJSFlagCommentPlacement" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1082 | <inspection_tool class="FoldInitializerAndIfToElvis" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> | |
1024 | 1083 | <inspection_tool class="ForCanBeForeach" enabled="true" level="WARNING" enabled_by_default="true"> |
1025 | 1084 | <option name="REPORT_INDEXED_LOOP" value="true" /> |
1026 | 1085 | <option name="ignoreUntypedCollections" value="false" /> |
1067 | 1126 | <inspection_tool class="GrMethodMayBeStatic" enabled="false" level="WARNING" enabled_by_default="true" /> |
1068 | 1127 | <inspection_tool class="GrPackage" enabled="false" level="WARNING" enabled_by_default="true" /> |
1069 | 1128 | <inspection_tool class="GrReassignedInClosureLocalVar" enabled="false" level="WARNING" enabled_by_default="true" /> |
1129 | <inspection_tool class="GrUnnecessaryDefModifier" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1130 | <inspection_tool class="GrUnnecessaryPublicModifier" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1131 | <inspection_tool class="GrUnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1070 | 1132 | <inspection_tool class="GrUnresolvedAccess" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
1071 | 1133 | <inspection_tool class="GroovyAccessToStaticFieldLockedOnInstance" enabled="false" level="WARNING" enabled_by_default="false" /> |
1072 | 1134 | <inspection_tool class="GroovyAccessibility" enabled="false" level="WARNING" enabled_by_default="false" /> |
1247 | 1309 | <inspection_tool class="GspInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1248 | 1310 | <inspection_tool class="GspPropertiesInspection" enabled="false" level="ERROR" enabled_by_default="false" /> |
1249 | 1311 | <inspection_tool class="GtkPreferredJComboBoxRenderer" enabled="false" level="WARNING" enabled_by_default="false" /> |
1250 | <inspection_tool class="Guava" enabled="false" level="WARNING" enabled_by_default="true" /> | |
1312 | <inspection_tool class="Guava" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1251 | 1313 | <inspection_tool class="GuavaFluentIterable" enabled="false" level="WARNING" enabled_by_default="false" /> |
1252 | 1314 | <inspection_tool class="GwtClientClassFromNonInheritedModule" enabled="true" level="ERROR" enabled_by_default="true" /> |
1253 | 1315 | <inspection_tool class="GwtCssResourceErrors" enabled="true" level="ERROR" enabled_by_default="true" /> |
1326 | 1388 | <option name="ignoredTypesString" value="java.io.ByteArrayOutputStream,java.io.ByteArrayInputStream,java.io.StringBufferInputStream,java.io.CharArrayWriter,java.io.CharArrayReader,java.io.StringWriter,java.io.StringReader" /> |
1327 | 1389 | <option name="insideTryAllowed" value="false" /> |
1328 | 1390 | </inspection_tool> |
1391 | <inspection_tool class="IfCanBeAssertion" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
1329 | 1392 | <inspection_tool class="IfCanBeSwitch" enabled="true" level="WARNING" enabled_by_default="true"> |
1330 | 1393 | <option name="minimumBranches" value="3" /> |
1331 | 1394 | <option name="suggestIntSwitches" value="false" /> |
1435 | 1498 | <inspection_tool class="IntentionDescriptionNotFoundInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1436 | 1499 | <inspection_tool class="InterceptionAnnotationWithoutRuntimeRetention" enabled="false" level="WARNING" enabled_by_default="false" /> |
1437 | 1500 | <inspection_tool class="InterfaceMayBeAnnotatedFunctional" enabled="false" level="WARNING" enabled_by_default="false" /> |
1438 | <inspection_tool class="InterfaceMethodClashesWithObject" enabled="false" level="WARNING" enabled_by_default="true" /> | |
1501 | <inspection_tool class="InterfaceMethodClashesWithObject" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1439 | 1502 | <inspection_tool class="InterfaceNamingConvention" enabled="false" level="WARNING" enabled_by_default="false"> |
1440 | 1503 | <option name="m_regex" value="[A-Z][A-Za-z\d]*" /> |
1441 | 1504 | <option name="m_minLength" value="8" /> |
1446 | 1509 | </inspection_tool> |
1447 | 1510 | <inspection_tool class="InterfaceWithOnlyOneDirectInheritor" enabled="false" level="WARNING" enabled_by_default="false" /> |
1448 | 1511 | <inspection_tool class="IntroduceWhenSubject" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
1512 | <inspection_tool class="InvalidComparatorMethodReference" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1449 | 1513 | <inspection_tool class="InvalidImplementedBy" enabled="false" level="WARNING" enabled_by_default="false" /> |
1450 | 1514 | <inspection_tool class="InvalidProvidedBy" enabled="false" level="WARNING" enabled_by_default="false" /> |
1451 | 1515 | <inspection_tool class="InvalidRequestParameters" enabled="false" level="WARNING" enabled_by_default="false" /> |
1476 | 1540 | <inspection_tool class="JSFieldCanBeLocal" enabled="false" level="WARNING" enabled_by_default="false" /> |
1477 | 1541 | <inspection_tool class="JSFieldCanBeLocalInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1478 | 1542 | <inspection_tool class="JSFileReferences" enabled="false" level="WARNING" enabled_by_default="true" /> |
1543 | <inspection_tool class="JSFunctionExpressionToArrowFunction" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
1479 | 1544 | <inspection_tool class="JSHint" enabled="false" level="ERROR" enabled_by_default="false" /> |
1480 | 1545 | <inspection_tool class="JSImplicitlyInternalDeclaration" enabled="true" level="WARNING" enabled_by_default="true" /> |
1481 | 1546 | <inspection_tool class="JSJQueryEfficiency" enabled="false" level="WARNING" enabled_by_default="false" /> |
1506 | 1571 | <inspection_tool class="JSPrimitiveTypeWrapperUsage" enabled="false" level="WARNING" enabled_by_default="false" /> |
1507 | 1572 | <inspection_tool class="JSReferencingArgumentsOutsideOfFunction" enabled="false" level="ERROR" enabled_by_default="true" /> |
1508 | 1573 | <inspection_tool class="JSReferencingMutableVariableFromClosure" enabled="false" level="WARNING" enabled_by_default="false" /> |
1574 | <inspection_tool class="JSStringConcatenationToES6Template" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
1509 | 1575 | <inspection_tool class="JSSuspiciousNameCombination" enabled="false" level="WARNING" enabled_by_default="false"> |
1510 | 1576 | <group names="x,width,left,right" /> |
1511 | 1577 | <group names="y,height,top,bottom" /> |
1549 | 1615 | <option name="m_maxLength" value="64" /> |
1550 | 1616 | </inspection_tool> |
1551 | 1617 | <inspection_tool class="JUnitTestNG" enabled="false" level="WARNING" enabled_by_default="false" /> |
1552 | <inspection_tool class="Java8CollectionsApi" enabled="false" level="WARNING" enabled_by_default="true" /> | |
1618 | <inspection_tool class="Java8CollectionRemoveIf" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1619 | <inspection_tool class="Java8CollectionsApi" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1620 | <inspection_tool class="Java8ListSort" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1621 | <inspection_tool class="Java8ReplaceMapGet" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1553 | 1622 | <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true"> |
1554 | 1623 | <option name="TOP_LEVEL_CLASS_OPTIONS"> |
1555 | 1624 | <value> |
1625 | 1694 | <inspection_tool class="KotlinUnusedImport" enabled="false" level="WARNING" enabled_by_default="true" /> |
1626 | 1695 | <inspection_tool class="LabeledStatement" enabled="false" level="WARNING" enabled_by_default="false" /> |
1627 | 1696 | <inspection_tool class="LabeledStatementJS" enabled="false" level="WARNING" enabled_by_default="false" /> |
1697 | <inspection_tool class="LambdaBodyCanBeCodeBlock" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
1698 | <inspection_tool class="LambdaCanBeReplacedWithAnonymous" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
1628 | 1699 | <inspection_tool class="LambdaParameterHidingMemberVariable" enabled="false" level="WARNING" enabled_by_default="false" /> |
1629 | 1700 | <inspection_tool class="LambdaParameterNamingConvention" enabled="false" level="WARNING" enabled_by_default="false" /> |
1630 | <inspection_tool class="LambdaUnfriendlyMethodOverload" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1701 | <inspection_tool class="LambdaParameterTypeCanBeSpecified" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
1702 | <inspection_tool class="LambdaUnfriendlyMethodOverload" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1631 | 1703 | <inspection_tool class="LanguageMismatch" enabled="true" level="WARNING" enabled_by_default="true"> |
1632 | 1704 | <option name="CHECK_NON_ANNOTATED_REFERENCES" value="true" /> |
1633 | 1705 | </inspection_tool> |
1683 | 1755 | </inspection_tool> |
1684 | 1756 | <inspection_tool class="LoopStatementThatDoesntLoopJS" enabled="true" level="WARNING" enabled_by_default="true" /> |
1685 | 1757 | <inspection_tool class="LoopStatementsThatDontLoop" enabled="true" level="WARNING" enabled_by_default="true" /> |
1758 | <inspection_tool class="LoopToCallChain" enabled="false" level="INFO" enabled_by_default="false" /> | |
1686 | 1759 | <inspection_tool class="LoopWithImplicitTerminationCondition" enabled="false" level="WARNING" enabled_by_default="false" /> |
1687 | 1760 | <inspection_tool class="LossyEncoding" enabled="false" level="WARNING" enabled_by_default="false" /> |
1688 | 1761 | <inspection_tool class="MVCPathVariableInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1693 | 1766 | <inspection_tool class="MakoArgumentListInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1694 | 1767 | <inspection_tool class="MalformedFormatString" enabled="true" level="WARNING" enabled_by_default="true" /> |
1695 | 1768 | <inspection_tool class="MalformedRegex" enabled="true" level="WARNING" enabled_by_default="true" /> |
1769 | <inspection_tool class="MalformedSetUpTearDown" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1696 | 1770 | <inspection_tool class="MalformedXPath" enabled="true" level="WARNING" enabled_by_default="true" /> |
1697 | 1771 | <inspection_tool class="ManagedBeanClassInspection" enabled="true" level="ERROR" enabled_by_default="true" /> |
1698 | 1772 | <inspection_tool class="ManualArrayCopy" enabled="true" level="WARNING" enabled_by_default="true" /> |
1703 | 1777 | <inspection_tool class="MavenDuplicateDependenciesInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1704 | 1778 | <inspection_tool class="MavenModelInspection" enabled="false" level="ERROR" enabled_by_default="false" /> |
1705 | 1779 | <inspection_tool class="MethodCallInLoopCondition" enabled="false" level="WARNING" enabled_by_default="false" /> |
1706 | <inspection_tool class="MethodCanBeVariableArityMethod" enabled="false" level="WARNING" enabled_by_default="false"> | |
1780 | <inspection_tool class="MethodCanBeVariableArityMethod" enabled="true" level="WARNING" enabled_by_default="true"> | |
1707 | 1781 | <option name="ignoreByteAndShortArrayParameters" value="true" /> |
1782 | <option name="ignoreOverridingMethods" value="true" /> | |
1708 | 1783 | </inspection_tool> |
1709 | 1784 | <inspection_tool class="MethodCount" enabled="false" level="WARNING" enabled_by_default="false"> |
1710 | 1785 | <option name="m_limit" value="20" /> |
1734 | 1809 | <inspection_tool class="MethodOverridesPackageLocalMethod" enabled="false" level="WARNING" enabled_by_default="false" /> |
1735 | 1810 | <inspection_tool class="MethodOverridesPrivateMethod" enabled="false" level="WARNING" enabled_by_default="false" /> |
1736 | 1811 | <inspection_tool class="MethodOverridesStaticMethod" enabled="false" level="WARNING" enabled_by_default="false" /> |
1812 | <inspection_tool class="MethodRefCanBeReplacedWithLambda" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
1737 | 1813 | <inspection_tool class="MethodReturnAlwaysConstant" enabled="false" level="WARNING" enabled_by_default="false" /> |
1738 | 1814 | <inspection_tool class="MethodReturnOfConcreteClass" enabled="false" level="WARNING" enabled_by_default="false" /> |
1739 | 1815 | <inspection_tool class="MethodWithMultipleLoops" enabled="false" level="WARNING" enabled_by_default="false" /> |
1769 | 1845 | <inspection_tool class="MisspelledEquals" enabled="false" level="WARNING" enabled_by_default="false" /> |
1770 | 1846 | <inspection_tool class="MisspelledHashcode" enabled="false" level="WARNING" enabled_by_default="false" /> |
1771 | 1847 | <inspection_tool class="MisspelledHeader" enabled="false" level="WARNING" enabled_by_default="true" /> |
1848 | <inspection_tool class="MisspelledMethodName" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1772 | 1849 | <inspection_tool class="MisspelledSetUp" enabled="false" level="WARNING" enabled_by_default="false" /> |
1773 | 1850 | <inspection_tool class="MisspelledTearDown" enabled="false" level="WARNING" enabled_by_default="false" /> |
1774 | 1851 | <inspection_tool class="MisspelledToString" enabled="false" level="WARNING" enabled_by_default="false" /> |
1778 | 1855 | <inspection_tool class="ModuleWithTooManyClasses" enabled="false" level="WARNING" enabled_by_default="false"> |
1779 | 1856 | <option name="limit" value="100" /> |
1780 | 1857 | </inspection_tool> |
1858 | <inspection_tool class="MultiCatchCanBeSplit" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
1781 | 1859 | <inspection_tool class="MultipleBindingAnnotations" enabled="false" level="WARNING" enabled_by_default="false" /> |
1782 | 1860 | <inspection_tool class="MultipleDeclaration" enabled="false" level="WARNING" enabled_by_default="false"> |
1783 | 1861 | <option name="ignoreForLoopDeclarations" value="true" /> |
1927 | 2005 | <inspection_tool class="OneButtonGroup" enabled="true" level="WARNING" enabled_by_default="true" /> |
1928 | 2006 | <inspection_tool class="OneWayWebMethod" enabled="false" level="ERROR" enabled_by_default="false" /> |
1929 | 2007 | <inspection_tool class="OptionalContainsCollection" enabled="false" level="WARNING" enabled_by_default="false" /> |
1930 | <inspection_tool class="OptionalGetWithoutIsPresent" enabled="false" level="WARNING" enabled_by_default="true" /> | |
1931 | <inspection_tool class="OptionalUsedAsFieldOrParameterType" enabled="false" level="WARNING" enabled_by_default="true" /> | |
2008 | <inspection_tool class="OptionalGetWithoutIsPresent" enabled="true" level="WARNING" enabled_by_default="true" /> | |
2009 | <inspection_tool class="OptionalIsPresent" enabled="true" level="WARNING" enabled_by_default="true" /> | |
2010 | <inspection_tool class="OptionalUsedAsFieldOrParameterType" enabled="true" level="WARNING" enabled_by_default="true" /> | |
1932 | 2011 | <inspection_tool class="OrredNotEqualExpression" enabled="true" level="WARNING" enabled_by_default="true" /> |
1933 | 2012 | <inspection_tool class="OverloadedMethodsWithSameNumberOfParameters" enabled="false" level="WARNING" enabled_by_default="false"> |
1934 | 2013 | <option name="ignoreInconvertibleTypes" value="true" /> |
1950 | 2029 | <inspection_tool class="OverlyLargePrimitiveArrayInitializer" enabled="false" level="WARNING" enabled_by_default="false"> |
1951 | 2030 | <option name="m_limit" value="64" /> |
1952 | 2031 | </inspection_tool> |
2032 | <inspection_tool class="OverlyLongLambda" enabled="false" level="WARNING" enabled_by_default="false" /> | |
1953 | 2033 | <inspection_tool class="OverlyStrongTypeCast" enabled="false" level="WARNING" enabled_by_default="false"> |
1954 | 2034 | <option name="ignoreInMatchingInstanceof" value="false" /> |
1955 | 2035 | </inspection_tool> |
2136 | 2216 | <inspection_tool class="PyDictDuplicateKeysInspection" enabled="true" level="WARNING" enabled_by_default="true" /> |
2137 | 2217 | <inspection_tool class="PyDocstringInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
2138 | 2218 | <inspection_tool class="PyDocstringTypesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> |
2219 | <inspection_tool class="PyDunderSlotsInspection" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2139 | 2220 | <inspection_tool class="PyExceptClausesOrderInspection" enabled="true" level="WARNING" enabled_by_default="true" /> |
2140 | 2221 | <inspection_tool class="PyExceptionInheritInspection" enabled="true" level="WARNING" enabled_by_default="true" /> |
2141 | 2222 | <inspection_tool class="PyFromFutureImportInspection" enabled="true" level="WARNING" enabled_by_default="true" /> |
2221 | 2302 | </inspection_tool> |
2222 | 2303 | <inspection_tool class="RSReferenceInspection" enabled="false" level="WARNING" enabled_by_default="true" /> |
2223 | 2304 | <inspection_tool class="RandomDoubleForRandomInteger" enabled="false" level="WARNING" enabled_by_default="false" /> |
2305 | <inspection_tool class="RawTypeCanBeGeneric" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
2224 | 2306 | <inspection_tool class="RawUseOfParameterizedType" enabled="true" level="WARNING" enabled_by_default="true"> |
2225 | 2307 | <option name="ignoreTypeCasts" value="true" /> |
2226 | 2308 | </inspection_tool> |
2233 | 2315 | <inspection_tool class="RedundantFieldInitialization" enabled="true" level="WARNING" enabled_by_default="true"> |
2234 | 2316 | <option name="onlyWarnOnNull" value="true" /> |
2235 | 2317 | </inspection_tool> |
2318 | <inspection_tool class="RedundantIf" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2236 | 2319 | <inspection_tool class="RedundantImplements" enabled="false" level="WARNING" enabled_by_default="false"> |
2237 | 2320 | <option name="ignoreSerializable" value="false" /> |
2238 | 2321 | <option name="ignoreCloneable" value="false" /> |
2239 | 2322 | </inspection_tool> |
2240 | 2323 | <inspection_tool class="RedundantImport" enabled="true" level="WARNING" enabled_by_default="true" /> |
2324 | <inspection_tool class="RedundantLambdaParameterType" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
2241 | 2325 | <inspection_tool class="RedundantMethodOverride" enabled="false" level="WARNING" enabled_by_default="false" /> |
2242 | 2326 | <inspection_tool class="RedundantModalityModifier" enabled="false" level="WARNING" enabled_by_default="true" /> |
2243 | 2327 | <inspection_tool class="RedundantSamConstructor" enabled="false" level="WARNING" enabled_by_default="true" /> |
2261 | 2345 | </inspection_tool> |
2262 | 2346 | <inspection_tool class="RemoveAtFromAnnotationArgument" enabled="false" level="WARNING" enabled_by_default="true" /> |
2263 | 2347 | <inspection_tool class="RemoveCurlyBracesFromTemplate" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2348 | <inspection_tool class="RemoveEmptyClassBody" enabled="false" level="INFO" enabled_by_default="false" /> | |
2349 | <inspection_tool class="RemoveEmptyParenthesesFromLambdaCall" enabled="false" level="INFO" enabled_by_default="false" /> | |
2264 | 2350 | <inspection_tool class="RemoveExplicitSuperQualifier" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2265 | 2351 | <inspection_tool class="RemoveExplicitTypeArguments" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2266 | 2352 | <inspection_tool class="RemoveForLoopIndices" enabled="false" level="WARNING" enabled_by_default="true" /> |
2353 | <inspection_tool class="RemoveRedundantCallsOfConversionMethods" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2267 | 2354 | <inspection_tool class="RemoveSetterParameterType" enabled="false" level="WARNING" enabled_by_default="true" /> |
2268 | 2355 | <inspection_tool class="RemoveSingleExpressionStringTemplate" enabled="false" level="WARNING" enabled_by_default="true" /> |
2269 | 2356 | <inspection_tool class="RemoveToStringInStringTemplate" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2270 | 2357 | <inspection_tool class="RemoveUnnecessaryLateinit" enabled="false" level="WARNING" enabled_by_default="true" /> |
2271 | 2358 | <inspection_tool class="ReplaceAllDot" enabled="false" level="WARNING" enabled_by_default="false" /> |
2359 | <inspection_tool class="ReplaceArrayEqualityOpWithArraysEquals" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2272 | 2360 | <inspection_tool class="ReplaceAssignmentWithOperatorAssignment" enabled="true" level="WARNING" enabled_by_default="true"> |
2273 | 2361 | <option name="ignoreLazyOperators" value="true" /> |
2274 | 2362 | <option name="ignoreObscureOperators" value="false" /> |
2276 | 2364 | <inspection_tool class="ReplaceAssignmentWithOperatorAssignmentJS" enabled="false" level="WARNING" enabled_by_default="false" /> |
2277 | 2365 | <inspection_tool class="ReplaceCallWithComparison" enabled="false" level="WARNING" enabled_by_default="true" /> |
2278 | 2366 | <inspection_tool class="ReplaceGetOrSet" enabled="false" level="INFO" enabled_by_default="true" /> |
2367 | <inspection_tool class="ReplaceInefficientStreamCount" enabled="true" level="WARNING" enabled_by_default="true" /> | |
2368 | <inspection_tool class="ReplaceSingleLineLet" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2369 | <inspection_tool class="ReplaceSizeCheckWithIsNotEmpty" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2370 | <inspection_tool class="ReplaceSizeZeroCheckWithIsEmpty" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2279 | 2371 | <inspection_tool class="ReplaceWithOperatorAssignment" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2280 | 2372 | <inspection_tool class="RequiredArtifactTypeInspection" enabled="false" level="ERROR" enabled_by_default="true" /> |
2281 | 2373 | <inspection_tool class="RequiredAttributes" enabled="true" level="WARNING" enabled_by_default="true"> |
2308 | 2400 | </inspection_tool> |
2309 | 2401 | <inspection_tool class="ReturnOfDateField" enabled="false" level="WARNING" enabled_by_default="false" /> |
2310 | 2402 | <inspection_tool class="ReturnOfInnerClass" enabled="false" level="WARNING" enabled_by_default="false" /> |
2403 | <inspection_tool class="ReturnSeparatedFromComputation" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
2311 | 2404 | <inspection_tool class="ReturnThis" enabled="false" level="WARNING" enabled_by_default="false" /> |
2312 | 2405 | <inspection_tool class="ReuseOfLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" /> |
2313 | 2406 | <inspection_tool class="ReuseOfLocalVariableJS" enabled="false" level="WARNING" enabled_by_default="false" /> |
2315 | 2408 | <inspection_tool class="RuntimeExecWithNonConstantString" enabled="false" level="WARNING" enabled_by_default="false" /> |
2316 | 2409 | <inspection_tool class="SSBasedInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
2317 | 2410 | <inspection_tool class="SafeLock" enabled="false" level="WARNING" enabled_by_default="false" /> |
2318 | <inspection_tool class="SafeVarargsDetector" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2411 | <inspection_tool class="SafeVarargsDetector" enabled="true" level="WARNING" enabled_by_default="true" /> | |
2319 | 2412 | <inspection_tool class="SamePackageImport" enabled="true" level="WARNING" enabled_by_default="true" /> |
2320 | 2413 | <inspection_tool class="SameParameterValue" enabled="false" level="WARNING" enabled_by_default="false" /> |
2321 | 2414 | <inspection_tool class="SameReturnValue" enabled="false" level="WARNING" enabled_by_default="false" /> |
2389 | 2482 | <inspection_tool class="Since15" enabled="false" level="ERROR" enabled_by_default="false" /> |
2390 | 2483 | <inspection_tool class="SingleCharacterStartsWith" enabled="false" level="WARNING" enabled_by_default="false" /> |
2391 | 2484 | <inspection_tool class="SingleClassImport" enabled="false" level="WARNING" enabled_by_default="false" /> |
2485 | <inspection_tool class="SingleElementAnnotation" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
2486 | <inspection_tool class="SingleStatementInBlock" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
2392 | 2487 | <inspection_tool class="Singleton" enabled="false" level="WARNING" enabled_by_default="false" /> |
2393 | 2488 | <inspection_tool class="SingletonInjectsScoped" enabled="false" level="WARNING" enabled_by_default="false" /> |
2394 | 2489 | <inspection_tool class="SizeReplaceableByIsEmpty" enabled="true" level="WARNING" enabled_by_default="true" /> |
2470 | 2565 | <inspection_tool class="SqlShouldBeInGroupByInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
2471 | 2566 | <inspection_tool class="SqlSignatureInspection" enabled="false" level="WARNING" enabled_by_default="true" /> |
2472 | 2567 | <inspection_tool class="SqlTypeInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
2568 | <inspection_tool class="SqlUnusedVariableInspection" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2473 | 2569 | <inspection_tool class="StandardVariableNames" enabled="false" level="WARNING" enabled_by_default="false" /> |
2474 | 2570 | <inspection_tool class="StatefulEp" enabled="false" level="WARNING" enabled_by_default="true" /> |
2475 | 2571 | <inspection_tool class="StatementsPerFunctionJS" enabled="false" level="WARNING" enabled_by_default="false"> |
2551 | 2647 | <inspection_tool class="StrutsValidatorFormInspection" enabled="false" level="ERROR" enabled_by_default="false" /> |
2552 | 2648 | <inspection_tool class="StrutsValidatorInspection" enabled="false" level="ERROR" enabled_by_default="false" /> |
2553 | 2649 | <inspection_tool class="StubBasedPsiElementBaseGetParent" enabled="false" level="WARNING" enabled_by_default="true" /> |
2650 | <inspection_tool class="Stylelint" enabled="false" level="ERROR" enabled_by_default="false" /> | |
2554 | 2651 | <inspection_tool class="SubstringZero" enabled="true" level="WARNING" enabled_by_default="true" /> |
2555 | 2652 | <inspection_tool class="SubtractionInCompareTo" enabled="true" level="WARNING" enabled_by_default="true" /> |
2556 | 2653 | <inspection_tool class="SuperClassHasFrequentlyUsedInheritors" enabled="false" level="WARNING" enabled_by_default="false" /> |
2585 | 2682 | <inspection_tool class="SwitchStatementsWithoutDefault" enabled="false" level="WARNING" enabled_by_default="false"> |
2586 | 2683 | <option name="m_ignoreFullyCoveredEnums" value="true" /> |
2587 | 2684 | </inspection_tool> |
2588 | <inspection_tool class="SynchronizationOnGetClass" enabled="false" level="WARNING" enabled_by_default="true" /> | |
2685 | <inspection_tool class="SynchronizationOnGetClass" enabled="true" level="WARNING" enabled_by_default="true" /> | |
2589 | 2686 | <inspection_tool class="SynchronizationOnLocalVariableOrMethodParameter" enabled="true" level="WARNING" enabled_by_default="true"> |
2590 | 2687 | <option name="reportLocalVariables" value="true" /> |
2591 | 2688 | <option name="reportMethodParameters" value="true" /> |
2651 | 2748 | <inspection_tool class="ThrowFromFinallyBlock" enabled="true" level="WARNING" enabled_by_default="true" /> |
2652 | 2749 | <inspection_tool class="ThrowFromFinallyBlockJS" enabled="true" level="WARNING" enabled_by_default="true" /> |
2653 | 2750 | <inspection_tool class="ThrowableInstanceNeverThrown" enabled="true" level="WARNING" enabled_by_default="true" /> |
2751 | <inspection_tool class="ThrowableNotThrown" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2654 | 2752 | <inspection_tool class="ThrowablePrintStackTrace" enabled="false" level="WARNING" enabled_by_default="false" /> |
2655 | 2753 | <inspection_tool class="ThrowablePrintedToSystemOut" enabled="false" level="WARNING" enabled_by_default="false" /> |
2656 | 2754 | <inspection_tool class="ThrowableResultOfMethodCallIgnored" enabled="true" level="WARNING" enabled_by_default="true" /> |
2679 | 2777 | <inspection_tool class="TrivialMethodReference" enabled="false" level="WARNING" enabled_by_default="true" /> |
2680 | 2778 | <inspection_tool class="TrivialStringConcatenation" enabled="false" level="WARNING" enabled_by_default="false" /> |
2681 | 2779 | <inspection_tool class="TryFinallyCanBeTryWithResources" enabled="true" level="WARNING" enabled_by_default="true" /> |
2780 | <inspection_tool class="TryStatementWithMultipleResources" enabled="false" level="INFORMATION" enabled_by_default="false" /> | |
2682 | 2781 | <inspection_tool class="TryWithIdenticalCatches" enabled="true" level="WARNING" enabled_by_default="true" /> |
2683 | 2782 | <inspection_tool class="TsLint" enabled="false" level="ERROR" enabled_by_default="false" /> |
2684 | 2783 | <inspection_tool class="TypeCustomizer" enabled="false" level="WARNING" enabled_by_default="true" /> |
2698 | 2797 | </inspection_tool> |
2699 | 2798 | <inspection_tool class="TypeScriptAccessibilityCheck" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2700 | 2799 | <inspection_tool class="TypeScriptCheckImport" enabled="false" level="ERROR" enabled_by_default="true" /> |
2800 | <inspection_tool class="TypeScriptPreferShortImport" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2701 | 2801 | <inspection_tool class="TypeScriptUnresolvedFunction" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2702 | 2802 | <inspection_tool class="TypeScriptUnresolvedVariable" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2703 | 2803 | <inspection_tool class="TypeScriptValidateJSTypes" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2753 | 2853 | <inspection_tool class="UnnecessaryContinue" enabled="true" level="WARNING" enabled_by_default="true" /> |
2754 | 2854 | <inspection_tool class="UnnecessaryContinueJS" enabled="true" level="WARNING" enabled_by_default="true" /> |
2755 | 2855 | <inspection_tool class="UnnecessaryDefault" enabled="false" level="WARNING" enabled_by_default="false" /> |
2856 | <inspection_tool class="UnnecessaryEmptyArrayUsage" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2756 | 2857 | <inspection_tool class="UnnecessaryEnumModifier" enabled="false" level="WARNING" enabled_by_default="false" /> |
2757 | 2858 | <inspection_tool class="UnnecessaryExplicitNumericCast" enabled="true" level="WARNING" enabled_by_default="true" /> |
2758 | 2859 | <inspection_tool class="UnnecessaryFinalOnLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" /> |
2764 | 2865 | <option name="m_ignoreJavadoc" value="false" /> |
2765 | 2866 | </inspection_tool> |
2766 | 2867 | <inspection_tool class="UnnecessaryInheritDoc" enabled="false" level="WARNING" enabled_by_default="false" /> |
2767 | <inspection_tool class="UnnecessaryInitCause" enabled="false" level="WARNING" enabled_by_default="true" /> | |
2868 | <inspection_tool class="UnnecessaryInitCause" enabled="true" level="WARNING" enabled_by_default="true" /> | |
2768 | 2869 | <inspection_tool class="UnnecessaryInterfaceModifier" enabled="false" level="WARNING" enabled_by_default="false" /> |
2769 | 2870 | <inspection_tool class="UnnecessaryJavaDocLink" enabled="true" level="WARNING" enabled_by_default="true"> |
2770 | 2871 | <option name="ignoreInlineLinkToSuper" value="false" /> |
2822 | 2923 | <inspection_tool class="UnresolvedMessageChannelWarningInspection" enabled="false" level="WARNING" enabled_by_default="false" /> |
2823 | 2924 | <inspection_tool class="UnresolvedPropertyKey" enabled="true" level="ERROR" enabled_by_default="true" /> |
2824 | 2925 | <inspection_tool class="UnresolvedReference" enabled="true" level="ERROR" enabled_by_default="true" /> |
2926 | <inspection_tool class="UnsafeCastFromDynamic" enabled="false" level="INFO" enabled_by_default="false" /> | |
2825 | 2927 | <inspection_tool class="UnsafeReturnStatementVisitor" enabled="false" level="WARNING" enabled_by_default="true" /> |
2826 | 2928 | <inspection_tool class="UnsafeVfsRecursion" enabled="false" level="WARNING" enabled_by_default="false" /> |
2827 | 2929 | <inspection_tool class="UnsecureRandomNumberGeneration" enabled="false" level="WARNING" enabled_by_default="false" /> |
2875 | 2977 | <inspection_tool class="UsePrimitiveTypes" enabled="false" level="WARNING" enabled_by_default="true" /> |
2876 | 2978 | <inspection_tool class="UsePropertyAccessSyntax" enabled="false" level="WEAK WARNING" enabled_by_default="true" /> |
2877 | 2979 | <inspection_tool class="UseVirtualFileEquals" enabled="false" level="WARNING" enabled_by_default="true" /> |
2980 | <inspection_tool class="UseWithIndex" enabled="false" level="INFO" enabled_by_default="false" /> | |
2878 | 2981 | <inspection_tool class="UtilSchemaInspection" enabled="true" level="ERROR" enabled_by_default="true" /> |
2879 | 2982 | <inspection_tool class="UtilityClass" enabled="false" level="WARNING" enabled_by_default="false"> |
2880 | 2983 | <option name="ignorableAnnotations"> |
2910 | 3013 | <inspection_tool class="WaitCalledOnCondition" enabled="false" level="WARNING" enabled_by_default="false" /> |
2911 | 3014 | <inspection_tool class="WaitNotInLoop" enabled="false" level="WARNING" enabled_by_default="false" /> |
2912 | 3015 | <inspection_tool class="WaitNotInSynchronizedContext" enabled="false" level="WARNING" enabled_by_default="false" /> |
3016 | <inspection_tool class="WaitNotifyNotInSynchronizedContext" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2913 | 3017 | <inspection_tool class="WaitOrAwaitWithoutTimeout" enabled="false" level="WARNING" enabled_by_default="false" /> |
2914 | 3018 | <inspection_tool class="WaitWhileHoldingTwoLocks" enabled="false" level="WARNING" enabled_by_default="false" /> |
2915 | 3019 | <inspection_tool class="WaitWithoutCorrespondingNotify" enabled="false" level="WARNING" enabled_by_default="false" /> |
2939 | 3043 | <inspection_tool class="XmlUnboundNsPrefix" enabled="false" level="WARNING" enabled_by_default="false" /> |
2940 | 3044 | <inspection_tool class="XmlUnusedNamespaceDeclaration" enabled="true" level="WARNING" enabled_by_default="true" /> |
2941 | 3045 | <inspection_tool class="XmlWithMistakes" enabled="false" level="INFO" enabled_by_default="false" /> |
3046 | <inspection_tool class="XmlWrongFileType" enabled="false" level="WARNING" enabled_by_default="false" /> | |
2942 | 3047 | <inspection_tool class="XmlWrongRootElement" enabled="true" level="ERROR" enabled_by_default="true" /> |
2943 | 3048 | <inspection_tool class="XsltDeclarations" enabled="true" level="ERROR" enabled_by_default="true" /> |
2944 | 3049 | <inspection_tool class="XsltTemplateInvocation" enabled="true" level="ERROR" enabled_by_default="true" /> |
0 | 0 | <?xml version="1.0" encoding="UTF-8"?> |
1 | 1 | <project version="4"> |
2 | 2 | <component name="EntryPointsManager"> |
3 | <entry_points version="2.0" /> | |
4 | 3 | <list size="5"> |
5 | 4 | <item index="0" class="java.lang.String" itemvalue="org.junit.After" /> |
6 | 5 | <item index="1" class="java.lang.String" itemvalue="org.junit.AfterClass" /> |
72 | 71 | <component name="ProjectResources"> |
73 | 72 | <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype> |
74 | 73 | </component> |
75 | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK"> | |
74 | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
76 | 75 | <output url="file://$PROJECT_DIR$/build/classes" /> |
77 | 76 | </component> |
78 | 77 | <component name="SvnBranchConfigurationManager"> |
60 | 60 | rm -f gmapsupp.img 632*.img |
61 | 61 | if [ -d 63240001 ]; then rmdir 6324000?; fi |
62 | 62 | rm -f 11112222.img 11112222.tdb |
63 | rm -rf *.gmapi *.gmap | |
63 | 64 | rm -f osmmap* |
64 | 65 | rm -f ovm_*.img |
65 | 66 | rm -f g?.img |
21 | 21 | device in USB mass storage mode). It can be used on ready |
22 | 22 | compiled img files, if the input files are not already compiled |
23 | 23 | then they are compiled first and then the gmapsupp is created. |
24 | ||
25 | --gmapi | |
26 | Create a directory in the "gmapi" format required by Mac | |
27 | applications. | |
24 | 28 | |
25 | 29 | -c filename |
26 | 30 | --read-config=filename |
31 | 35 | long name instead. |
32 | 36 | |
33 | 37 | --output-dir=filename |
34 | The directory in which all output files are written. It defaults | |
35 | to the current working directory, i.e. the directory the command is | |
36 | executed from. | |
38 | The directory in which all output files are written. It defaults | |
39 | to the current working directory, i.e. the directory the command is | |
40 | executed from. | |
37 | 41 | |
38 | 42 | -n name |
39 | 43 | --mapname=name |
73 | 77 | This is equivalent to --code-page=65001. Note that only newer devices support Unicode. |
74 | 78 | |
75 | 79 | --code-page=number |
76 | This option enables the use of international characters. Only 8 bit | |
77 | character sets are supported and so you have to specify which code page | |
78 | you want to use. | |
80 | This option enables the use of international characters. Only 8 bit | |
81 | character sets are supported and so you have to specify which code page | |
82 | you want to use. | |
79 | 83 | |
80 | 84 | It is entirely dependent on the device firmware which code pages are |
81 | 85 | supported. |
120 | 124 | mkgmap:phone |
121 | 125 | (mkgmap:is_in - used by location-autofill=is_in) |
122 | 126 | |
123 | If the index is created from previously compiled .img files, then the | |
124 | same code page and sorting options (e.g. --code-page, --latin1) must | |
125 | be used as were used to compile the individual map tiles. | |
126 | ||
127 | If the index is created from previously compiled .img files, then the | |
128 | same code page and sorting options (e.g. --code-page, --latin1) must | |
129 | be used as were used to compile the individual map tiles. | |
130 | ||
127 | 131 | --x-split-name-index |
128 | A temporary option to enable indexing each part of a street name separately. | |
129 | So for example if the street is "Aleksandra Gryglewskiego" then you will be able to | |
130 | search for it as both "Aleksandra" and "Gryglewskiego". It will also increase the | |
131 | size of the index. Useful in countries where searching for the first word in name | |
132 | is not the right thing to do. | |
133 | ||
134 | Note that this option is still experimental and there may be problems. If you find | |
135 | any let us know! | |
132 | A temporary option to enable indexing each part of a street name separately. | |
133 | So for example if the street is "Aleksandra Gryglewskiego" then you will be able to | |
134 | search for it as both "Aleksandra" and "Gryglewskiego". It will also increase the | |
135 | size of the index. Useful in countries where searching for the first word in name | |
136 | is not the right thing to do. | |
137 | ||
138 | Note that this option is still experimental and there may be problems. If you find | |
139 | any let us know! | |
136 | 140 | |
137 | 141 | --bounds=directory|zipfile |
138 | A directory or a zip file containing the preprocessed bounds files. | |
139 | Bounds files in a zip file must be located in the zip file's root directory. | |
140 | ||
141 | The preprocessed boundaries are used to add special tags to all elements | |
142 | (points, lines and polygons) containing the elements location information. | |
143 | The style file can be used to assign the address tags mkgmap:country, | |
144 | mkgmap:region etc. using these values. | |
145 | ||
146 | The following special tags are added: | |
147 | mkgmap:admin_level2 : Name of the admin_level=2 boundary | |
148 | mkgmap:admin_level3 : Name of the admin_level=3 boundary | |
149 | .. | |
150 | mkgmap:admin_level11 | |
151 | mkgmap:postcode : the postal_code value | |
152 | ||
153 | Preprocessed bounds can be created with the following command: | |
154 | java -cp mkgmap.jar | |
155 | uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreprocessor | |
156 | <inputfile> <boundsdir> | |
157 | ||
158 | The input file must contain the boundaries that should be preprocessed. | |
159 | It can have OSM, PBF or O5M file format. It is recommended that it | |
160 | contains the boundary data only to avoid very high memory usage. | |
161 | The boundsdir gives the directory where the processed files are stored. | |
162 | This directory can be used as --bounds parameter with mkgmap. | |
142 | A directory or a zip file containing the preprocessed bounds files. | |
143 | Bounds files in a zip file must be located in the zip file's root directory. | |
144 | ||
145 | The preprocessed boundaries are used to add special tags to all elements | |
146 | (points, lines and polygons) containing the elements location information. | |
147 | The style file can be used to assign the address tags mkgmap:country, | |
148 | mkgmap:region etc. using these values. | |
149 | ||
150 | The following special tags are added: | |
151 | mkgmap:admin_level2 : Name of the admin_level=2 boundary | |
152 | mkgmap:admin_level3 : Name of the admin_level=3 boundary | |
153 | .. | |
154 | mkgmap:admin_level11 | |
155 | mkgmap:postcode : the postal_code value | |
156 | ||
157 | Preprocessed bounds can be created with the following command: | |
158 | java -cp mkgmap.jar | |
159 | uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreprocessor | |
160 | <inputfile> <boundsdir> | |
161 | ||
162 | The input file must contain the boundaries that should be preprocessed. | |
163 | It can have OSM, PBF or O5M file format. It is recommended that it | |
164 | contains the boundary data only to avoid very high memory usage. | |
165 | The boundsdir gives the directory where the processed files are stored. | |
166 | This directory can be used as --bounds parameter with mkgmap. | |
163 | 167 | |
164 | 168 | --location-autofill=[option1,[option2]] |
165 | 169 | Controls how the address fields for country, region, city and zip info |
167 | 171 | mkgmap address tags (e.g. mkgmap:city - see option index). |
168 | 172 | Warning: automatic assignment of address fields is somehow a best guess. |
169 | 173 | |
170 | is_in The is_in tag is analyzed for country and region information. | |
174 | is_in The is_in tag is analyzed for country and region information. | |
171 | 175 | |
172 | nearest The city/hamlet points that are closest to the element are used | |
176 | nearest The city/hamlet points that are closest to the element are used | |
173 | 177 | to assign the missing address fields. Beware that cities located |
174 | 178 | in the same tile are used only. So the results close to a tile |
175 | 179 | border have less quality. |
176 | 180 | |
177 | 181 | --housenumbers |
178 | Enables house number search for OSM input files. | |
179 | All nodes and polygons having addr:housenumber set are matched | |
180 | to streets. A match between a house number element and a street is created if | |
181 | the street is located within a radius of 150m and the addr:street tag value of | |
182 | the house number element equals the mgkmap:street tag value of the street. | |
183 | The mkgmap:street tag must be added to the street in the style file. | |
184 | For optimal results, the tags mkgmap:city and mkgmap:postal_code should be | |
185 | set for the housenumber element. If a street connects two or more cities | |
186 | this allows to find all addresses along the road, even they have the same | |
187 | number. | |
188 | Example for given street name: | |
189 | Node - addr:street=Main Street addr:housenumber=2 | |
190 | Way 1 - name=Main Street | |
191 | Way 2 - name=Main Street, mkgmap:street=Main Street | |
192 | Way 3 - mkgmap:street=Mainstreet | |
193 | Way 4 - name=Main Street [A504] | |
194 | The node matches to Way 2. It has mkgmap:street set with a value equal to | |
195 | the addr:street tag value of the house number node. | |
196 | If the street is not given with addr:housenumber, mkgmap uses heuristics | |
182 | Enables house number search for OSM input files. | |
183 | All nodes and polygons having addr:housenumber set are matched | |
184 | to streets. A match between a house number element and a street is created if | |
185 | the street is located within a radius of 150m and the addr:street tag value of | |
186 | the house number element equals the mgkmap:street tag value of the street. | |
187 | The mkgmap:street tag must be added to the street in the style file. | |
188 | For optimal results, the tags mkgmap:city and mkgmap:postal_code should be | |
189 | set for the housenumber element. If a street connects two or more cities | |
190 | this allows to find all addresses along the road, even they have the same | |
191 | number. | |
192 | Example for given street name: | |
193 | Node - addr:street=Main Street addr:housenumber=2 | |
194 | Way 1 - name=Main Street | |
195 | Way 2 - name=Main Street, mkgmap:street=Main Street | |
196 | Way 3 - mkgmap:street=Mainstreet | |
197 | Way 4 - name=Main Street [A504] | |
198 | The node matches to Way 2. It has mkgmap:street set with a value equal to | |
199 | the addr:street tag value of the house number node. | |
200 | If the street is not given with addr:housenumber, mkgmap uses heuristics | |
197 | 201 | to find the best match. |
198 | ||
202 | ||
199 | 203 | Overview map options: |
200 | 204 | --overview-mapname=name |
201 | If --tdbfile is enabled, this gives the name of the overview | |
202 | .img and .tdb files. The default map name is osmmap. | |
205 | If --tdbfile is enabled, this gives the name of the overview | |
206 | .img and .tdb files. The default map name is osmmap. | |
203 | 207 | |
204 | 208 | --overview-mapnumber=8 digit number |
205 | 209 | If --tdbfile is enabled, this gives the internal 8 digit |
207 | 211 | number is 63240000. |
208 | 212 | |
209 | 213 | --overview-levels |
210 | like levels, specifies additional levels that are to be written to the | |
211 | overview map. Counting of the levels should continue. Up to 8 additional | |
212 | levels may be specified, but the lowest usable resolution with MapSource | |
213 | seems to be 11. The hard coded default is empty. | |
214 | like levels, specifies additional levels that are to be written to the | |
215 | overview map. Counting of the levels should continue. Up to 8 additional | |
216 | levels may be specified, but the lowest usable resolution with MapSource | |
217 | seems to be 11. The hard coded default is empty. | |
214 | 218 | |
215 | 219 | --remove-ovm-work-files |
216 | If overview-levels is used, mkgmap creates one additional file | |
217 | with the prefix ovm_ for each map (*.img) file. | |
218 | These files are used to create the overview map. | |
219 | With option --remove-ovm-work-files=true the files are removed | |
220 | after the overview map was created. The default is to keep the files. | |
220 | If overview-levels is used, mkgmap creates one additional file | |
221 | with the prefix ovm_ for each map (*.img) file. | |
222 | These files are used to create the overview map. | |
223 | With option --remove-ovm-work-files=true the files are removed | |
224 | after the overview map was created. The default is to keep the files. | |
221 | 225 | |
222 | 226 | Style options: |
223 | 227 | --style-file=file |
240 | 244 | |
241 | 245 | --style=name |
242 | 246 | Specify a style name. Must be used if --style-file points to a |
243 | directory or zip file containing multiple styles. If --style-file | |
244 | is not used, it selects one of the built-in styles. | |
247 | directory or zip file containing multiple styles. If --style-file | |
248 | is not used, it selects one of the built-in styles. | |
245 | 249 | |
246 | 250 | --list-styles |
247 | 251 | List the available styles. If this option is preceded by a style-file |
249 | 253 | |
250 | 254 | --check-styles |
251 | 255 | Perform some checks on the available styles. If this option is |
252 | preceded by a style-file option then it checks the styles | |
253 | available within that file. If it is also preceded by the style | |
254 | option it will only check that style. | |
256 | preceded by a style-file option then it checks the styles | |
257 | available within that file. If it is also preceded by the style | |
258 | option it will only check that style. | |
255 | 259 | |
256 | 260 | --levels=levels code |
257 | 261 | Change the way that the levels on the map correspond to the zoom |
292 | 296 | drop-down. The default is "OSM map". |
293 | 297 | |
294 | 298 | --area-name |
295 | Area name is displayed on Garmin units (or at least on eTrex) as the second | |
296 | part of the mapname in the list of the individual maps. | |
297 | ||
299 | Area name is displayed on Garmin units (or at least on eTrex) as the second | |
300 | part of the mapname in the list of the individual maps. | |
301 | ||
298 | 302 | --copyright-message=note |
299 | 303 | Specify a copyright message for files that do not contain one. |
300 | 304 | |
305 | 309 | |
306 | 310 | --license-file=file |
307 | 311 | Specify a file which content will be added as license. |
308 | All entries of all maps will be merged in the overview map. | |
312 | All entries of all maps will be merged in the overview map. | |
309 | 313 | |
310 | 314 | Optimization options: |
311 | 315 | |
328 | 332 | Default is enabled, use --no-merge-lines to disable. |
329 | 333 | |
330 | 334 | --min-size-polygon=NUM |
331 | Removes all polygons smaller than NUM from the map. | |
332 | This reduces map size and speeds up redrawing of maps. | |
333 | Recommended value is 8 to 15, default is 8. | |
334 | See also polygon-size-limits. | |
335 | ||
335 | Removes all polygons smaller than NUM from the map. | |
336 | This reduces map size and speeds up redrawing of maps. | |
337 | Recommended value is 8 to 15, default is 8. | |
338 | See also polygon-size-limits. | |
339 | ||
336 | 340 | --polygon-size-limits=limits code |
337 | Allows to specify different min-size-polygon values for each resolution. | |
338 | Sample: | |
339 | --polygon-size-limits="24:12, 18:10, 16:8, 14:4, 12:2, 11:0" | |
340 | If a resolution is not given, mkgmap uses the value for the next higher | |
341 | one. For the given sample, resolutions 19 to 24 will use value 12, | |
342 | resolution 17 and 18 will use 10, and so on. | |
343 | Value 0 means to skip the size filter. | |
344 | Note that in resolution 24 the filter is not used. | |
345 | ||
341 | Allows to specify different min-size-polygon values for each resolution. | |
342 | Sample: | |
343 | --polygon-size-limits="24:12, 18:10, 16:8, 14:4, 12:2, 11:0" | |
344 | If a resolution is not given, mkgmap uses the value for the next higher | |
345 | one. For the given sample, resolutions 19 to 24 will use value 12, | |
346 | resolution 17 and 18 will use 10, and so on. | |
347 | Value 0 means to skip the size filter. | |
348 | Note that in resolution 24 the filter is not used. | |
349 | ||
346 | 350 | Miscellaneous options: |
347 | 351 | |
348 | 352 | --max-jobs[=number] |
507 | 511 | * the centre point of the biggest area |
508 | 512 | |
509 | 513 | --pois-to-areas-placement[=taglist] |
510 | A semicolon separated list of tag=value definitions. A POI is placed at the first | |
511 | node of the polygon tagged with the first tag/value pair. If none of the nodes are | |
512 | tagged with the first tag-value pair the first node tagged with the second tag-value | |
513 | pair is used and so on. If none of the tag-value pairs matches or the taglist is empty | |
514 | the centre of the polygon is used. | |
515 | It is possible to define wildcards for tag values like entrance=*. | |
516 | Default: entrance=main;entrance=yes;building=entrance | |
514 | A semicolon separated list of tag=value definitions. A POI is placed at the first | |
515 | node of the polygon tagged with the first tag/value pair. If none of the nodes are | |
516 | tagged with the first tag-value pair the first node tagged with the second tag-value | |
517 | pair is used and so on. If none of the tag-value pairs matches or the taglist is empty | |
518 | the centre of the polygon is used. | |
519 | It is possible to define wildcards for tag values like entrance=*. | |
520 | Default: entrance=main;entrance=yes;building=entrance | |
517 | 521 | |
518 | 522 | --precomp-sea=directory|zipfile |
519 | Defines the directory or a zip file that contains precompiled sea tiles. | |
520 | Sea files in a zip file must be located in the zip file's root directory or in | |
521 | a sub directory sea. When this option is defined all natural=coastline tags | |
522 | from the input OSM tiles are removed and the precompiled data is used instead. | |
523 | This option can be combined with the generate-sea options multipolygon, polygons | |
524 | and land-tag. The coastlinefile option is ignored if precomp-sea is set. | |
523 | Defines the directory or a zip file that contains precompiled sea tiles. | |
524 | Sea files in a zip file must be located in the zip file's root directory or in | |
525 | a sub directory sea. When this option is defined all natural=coastline tags | |
526 | from the input OSM tiles are removed and the precompiled data is used instead. | |
527 | This option can be combined with the generate-sea options multipolygon, polygons | |
528 | and land-tag. The coastlinefile option is ignored if precomp-sea is set. | |
525 | 529 | |
526 | 530 | --coastlinefile=filename[,filename] |
527 | 531 | Defines a comma separated list of files that contain coastline |
592 | 596 | (NSIS) to create a Windows Mapsource Installer. |
593 | 597 | |
594 | 598 | --make-all-cycleways |
595 | Deprecated, use --make-opposite-cycleways instead. Former meaning: | |
599 | Deprecated, use --make-opposite-cycleways instead. Former meaning: | |
596 | 600 | Turn on all of the options that make cycleways. |
597 | 601 | |
598 | 602 | --make-opposite-cycleways |
601 | 605 | the original that allows bicycle traffic (in both directions). |
602 | 606 | |
603 | 607 | --make-cycleways |
604 | Now ignored, former meaning: | |
608 | Now ignored, former meaning: | |
605 | 609 | Some streets have a separate cycleway track/lane just for |
606 | 610 | bicycle traffic and this option makes a way with the same |
607 | 611 | points as the original that allows bicycle traffic. Also, |
609 | 613 | (unless that way's bicycle access has been defined). |
610 | 614 | |
611 | 615 | --link-pois-to-ways |
612 | This option may copy some specific attributes of a POI | |
613 | to a small part of the way the POI is located on. This can be used | |
614 | to let barriers block a way or to lower the calculated speed | |
615 | around traffic signals. | |
616 | POIs with the tags highway=* (e.g. highway=traffic_signals) | |
617 | or barrier=* (e.g. barrier=cycle_barrier) are supported. | |
618 | The style developer must add at least one of the access tags | |
619 | (mkgmap:foot, mkgmap:car etc.), mkgmap:road-speed and/or | |
620 | mkgmap:road-class to the POI. | |
621 | The access tags are ignored if they have no effect for the way, | |
622 | else a route restriction is added at the POI so that only | |
623 | allowed vehicles are routed through it. | |
624 | The tags mkgmap:road-speed and/or mkgmap:road-class are | |
625 | applied to a small part of the way around the POI, typically | |
626 | to the next junction or a length of ~25 m. The tags | |
627 | are ignored for pedestrian-only ways. | |
616 | This option may copy some specific attributes of a POI | |
617 | to a small part of the way the POI is located on. This can be used | |
618 | to let barriers block a way or to lower the calculated speed | |
619 | around traffic signals. | |
620 | POIs with the tags highway=* (e.g. highway=traffic_signals) | |
621 | or barrier=* (e.g. barrier=cycle_barrier) are supported. | |
622 | The style developer must add at least one of the access tags | |
623 | (mkgmap:foot, mkgmap:car etc.), mkgmap:road-speed and/or | |
624 | mkgmap:road-class to the POI. | |
625 | The access tags are ignored if they have no effect for the way, | |
626 | else a route restriction is added at the POI so that only | |
627 | allowed vehicles are routed through it. | |
628 | The tags mkgmap:road-speed and/or mkgmap:road-class are | |
629 | applied to a small part of the way around the POI, typically | |
630 | to the next junction or a length of ~25 m. The tags | |
631 | are ignored for pedestrian-only ways. | |
628 | 632 | |
629 | 633 | --process-destination |
630 | 634 | Splits all motorway_link, trunk_link, primary_link, secondary_link, |
641 | 645 | See also --process-exits. |
642 | 646 | |
643 | 647 | --process-exits |
644 | Usual Garmin devices do not tell the name of the exit on motorways | |
645 | while routing with mkgmap created maps. This option splits each | |
646 | motorway_link, trunk_link, primary_link, secondary_link, and tertiary_link | |
648 | Usual Garmin devices do not tell the name of the exit on motorways | |
649 | while routing with mkgmap created maps. This option splits each | |
650 | motorway_link, trunk_link, primary_link, secondary_link, and tertiary_link | |
647 | 651 | way into three parts. |
648 | 652 | All parts are tagged with the original tags of the link. |
649 | 653 | Additionally the middle part is tagged with the following tags: |
650 | mkgmap:exit_hint=true | |
651 | mkgmap:exit_hint_ref=<ref tag value of the exit> | |
652 | mkgmap:exit_hint_name=<name tag value of the exit> | |
653 | mkgmap:exit_hint_exit_to=<exit_to tag value of the exit> | |
654 | Adding a rule checking the mkgmap:exit_hint=true makes it possible | |
655 | to use any routable Garmin type (except 0x08 and 0x09) for the middle | |
656 | part so that the Garmin device tells the name of this middle part as | |
657 | hint where to leave the major road. | |
654 | mkgmap:exit_hint=true | |
655 | mkgmap:exit_hint_ref=<ref tag value of the exit> | |
656 | mkgmap:exit_hint_name=<name tag value of the exit> | |
657 | mkgmap:exit_hint_exit_to=<exit_to tag value of the exit> | |
658 | Adding a rule checking the mkgmap:exit_hint=true makes it possible | |
659 | to use any routable Garmin type (except 0x08 and 0x09) for the middle | |
660 | part so that the Garmin device tells the name of this middle part as | |
661 | hint where to leave the major road. | |
658 | 662 | The first part must have type 0x08 or 0x09 so that Garmin uses the hint. |
659 | 663 | |
660 | 664 | --delete-tags-file=FILENAME |
685 | 689 | things. |
686 | 690 | |
687 | 691 | --hide-gmapsupp-on-pc |
688 | Set a bit in the gmapsupp.img that tells PC software that the file is | |
692 | Set a bit in the gmapsupp.img that tells PC software that the file is | |
689 | 693 | already installed on the PC and therefore there is no need to read it |
690 | 694 | from the device. |
691 | 695 |
0 | svn.version: 3706 | |
1 | build.timestamp: 2016-11-28T13:14:14+0000 | |
0 | svn.version: 3741 | |
1 | build.timestamp: 2016-12-26T11:25:19+0000 |
7 | 7 | (waterway=stream | waterway=drain) & intermittent=yes [0x10A02 resolution 22] |
8 | 8 | |
9 | 9 | waterway=canal [0x1f resolution 21] |
10 | waterway=drain [0x1f resolution 22] | |
11 | 10 | waterway=river [0x1f resolution 18] |
12 | 11 | waterway=rapids|waterway=waterfall [0x1f resolution 22] |
13 | waterway=stream [0x18 resolution 22] | |
12 | waterway=stream | waterway=drain [0x18 resolution 22] |
162 | 162 | xstart = xend; |
163 | 163 | } |
164 | 164 | |
165 | // assert areas.length == xsplit * ysplit; | |
166 | 165 | if (nAreas == areas.length) // no problem |
167 | 166 | return areas; |
168 | 167 | // beware - MapSplitter.splitMaxSize requests split of 1/1 if the original area wasn't too big |
169 | 168 | else if (nAreas == 1) // failed to split in half |
170 | return null; | |
169 | return null; | |
170 | else if (areas.length == 1 && areas[0] == null) | |
171 | return null; | |
171 | 172 | else |
172 | 173 | throw new MapFailedException("Area split shift align problems"); |
173 | 174 | } |
15 | 15 | */ |
16 | 16 | package uk.me.parabola.imgfmt.app; |
17 | 17 | |
18 | import java.io.ByteArrayOutputStream; | |
18 | 19 | import java.io.IOException; |
19 | 20 | import java.nio.ByteBuffer; |
20 | 21 | |
171 | 172 | } |
172 | 173 | |
173 | 174 | /** |
174 | * Read a zero terminated string from the file. | |
175 | * @return A string | |
175 | * Read a zero terminated string from the file, still as raw bytes. | |
176 | * | |
177 | * @return A byte array containing the encoded representation of the string. | |
176 | 178 | * @throws ReadFailedException For failures. |
177 | 179 | */ |
178 | public String getZString() throws ReadFailedException { | |
179 | StringBuffer sb = new StringBuffer(); | |
180 | public byte[] getZString() throws ReadFailedException { | |
181 | ByteArrayOutputStream out = new ByteArrayOutputStream(); | |
180 | 182 | |
181 | 183 | // Slow but sure implementation. |
182 | 184 | for (byte b = get(); b != 0; b = get()) { |
183 | sb.append((char) b); | |
184 | } | |
185 | return sb.toString(); | |
185 | out.write(b); | |
186 | } | |
187 | return out.toByteArray(); | |
186 | 188 | } |
187 | 189 | |
188 | 190 | /** |
95 | 95 | * @return A string |
96 | 96 | * @throws ReadFailedException For failures. |
97 | 97 | */ |
98 | public String getZString() throws ReadFailedException; | |
98 | public byte[] getZString() throws ReadFailedException; | |
99 | 99 | |
100 | 100 | /** |
101 | 101 | * Read in a string of digits in the compressed base 11 format that is used |
39 | 39 | return encoder; |
40 | 40 | } |
41 | 41 | |
42 | protected void setDecoder(CharacterDecoder decoder) { | |
42 | private void setDecoder(CharacterDecoder decoder) { | |
43 | 43 | this.decoder = decoder; |
44 | 44 | } |
45 | 45 | |
51 | 51 | return encodingType; |
52 | 52 | } |
53 | 53 | |
54 | protected void setEncodingType(int encodingType) { | |
54 | private void setEncodingType(int encodingType) { | |
55 | 55 | this.encodingType = encodingType; |
56 | 56 | } |
57 | 57 | |
76 | 76 | funcs.setEncodingType(ENCODING_FORMAT6); |
77 | 77 | funcs.setEncoder(new Format6Encoder()); |
78 | 78 | funcs.setDecoder(new Format6Decoder()); |
79 | break; | |
80 | case "cp0": // This is used for ascii but with the single byte format | |
81 | funcs.setEncodingType(ENCODING_FORMAT9); | |
82 | funcs.setEncoder(new AnyCharsetEncoder("ascii", new TableTransliterator("ascii"))); | |
83 | funcs.setDecoder(new AnyCharsetDecoder("ascii")); | |
84 | funcs.setCodepage(0); | |
79 | 85 | break; |
80 | 86 | case "cp1252": |
81 | 87 | case "latin1": |
49 | 49 | |
50 | 50 | private CharacterEncoder textEncoder = CodeFunctions.getDefaultEncoder(); |
51 | 51 | |
52 | private final Map<EncodedText, Label> labelCache = new HashMap<EncodedText, Label>(); | |
52 | private final Map<EncodedText, Label> labelCache = new HashMap<>(); | |
53 | 53 | |
54 | 54 | private final LBLHeader lblHeader = new LBLHeader(); |
55 | 55 | |
223 | 223 | public int numZips() { |
224 | 224 | return places.numZips(); |
225 | 225 | } |
226 | ||
227 | public int getCodePage() { | |
228 | return lblHeader.getCodePage(); | |
229 | } | |
226 | 230 | } |
17 | 17 | import java.util.List; |
18 | 18 | import java.util.Map; |
19 | 19 | |
20 | import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; | |
20 | 21 | import uk.me.parabola.imgfmt.app.BufferedImgFileReader; |
21 | 22 | import uk.me.parabola.imgfmt.app.ImgFile; |
22 | 23 | import uk.me.parabola.imgfmt.app.ImgFileReader; |
47 | 48 | |
48 | 49 | private final LBLHeader header = new LBLHeader(); |
49 | 50 | |
50 | private final Map<Integer, Label> labels = new HashMap<>(); | |
51 | private final Map<Integer, POIRecord> pois = new HashMap<>(); | |
51 | private final Int2ObjectOpenHashMap<Label> labels = new Int2ObjectOpenHashMap<>(); | |
52 | private final Int2ObjectOpenHashMap<POIRecord> pois = new Int2ObjectOpenHashMap<>(); | |
52 | 53 | private final List<Country> countries = new ArrayList<>(); |
53 | 54 | private final List<Region> regions = new ArrayList<>(); |
54 | private final Map<Integer, Zip> zips = new HashMap<>(); | |
55 | private final Int2ObjectOpenHashMap<Zip> zips = new Int2ObjectOpenHashMap<>(); | |
55 | 56 | private final List<City> cities = new ArrayList<>(); |
56 | 57 | |
57 | 58 | public LBLFileReader(ImgChannel chan) { |
22 | 22 | import uk.me.parabola.imgfmt.app.Area; |
23 | 23 | import uk.me.parabola.imgfmt.app.ImgFile; |
24 | 24 | import uk.me.parabola.imgfmt.app.Label; |
25 | import uk.me.parabola.imgfmt.app.labelenc.CodeFunctions; | |
25 | 26 | import uk.me.parabola.imgfmt.app.lbl.LBLFile; |
26 | 27 | import uk.me.parabola.imgfmt.app.net.NETFile; |
27 | 28 | import uk.me.parabola.imgfmt.app.net.NODFile; |
114 | 115 | } |
115 | 116 | |
116 | 117 | public void config(EnhancedProperties props) { |
117 | // we don't want routing infos in the overview map (for now) | |
118 | if (OverviewBuilder.isOverviewImg(mapName) == false){ | |
118 | // we don't want routing info in the overview map (for now) | |
119 | if (!OverviewBuilder.isOverviewImg(mapName)){ | |
119 | 120 | try { |
120 | 121 | if (props.containsKey("route")) { |
121 | 122 | addNet(); |
130 | 131 | treFile.config(props); |
131 | 132 | } |
132 | 133 | |
133 | protected void addNet() throws FileExistsException { | |
134 | private void addNet() throws FileExistsException { | |
134 | 135 | netFile = new NETFile(fileSystem.create(mapName + ".NET")); |
135 | 136 | } |
136 | 137 | |
137 | protected void addNod() throws FileExistsException { | |
138 | private void addNod() throws FileExistsException { | |
138 | 139 | nodFile = new NODFile(fileSystem.create(mapName + ".NOD"), true); |
139 | 140 | } |
140 | 141 | |
158 | 159 | |
159 | 160 | /** |
160 | 161 | * There is an area after the TRE header and before its data |
161 | * starts that can be used to save any old junk it seems. | |
162 | * | |
163 | * @param info Any string. | |
164 | */ | |
165 | public void addInfo(String info) { | |
166 | treFile.addInfo(info); | |
162 | * starts that is used to save licence info. | |
163 | * | |
164 | * It seems that this must follow the code page of the LBL file. The format6 encoding is not allowed | |
165 | * however. | |
166 | * | |
167 | * @param msg Any string. | |
168 | */ | |
169 | public void addInfo(String msg) { | |
170 | int codePage = lblFile.getCodePage(); | |
171 | CodeFunctions functions = CodeFunctions.createEncoderForLBL(0, codePage); | |
172 | treFile.addInfo(functions.getEncoder().encodeText(msg)); | |
167 | 173 | } |
168 | 174 | |
169 | 175 | /** |
20 | 20 | import java.util.Iterator; |
21 | 21 | import java.util.List; |
22 | 22 | |
23 | import uk.me.parabola.imgfmt.Utils; | |
24 | 23 | import uk.me.parabola.imgfmt.app.Area; |
25 | 24 | import uk.me.parabola.imgfmt.app.BufferedImgFileWriter; |
26 | 25 | import uk.me.parabola.imgfmt.app.ImgFile; |
27 | 26 | import uk.me.parabola.imgfmt.app.ImgFileWriter; |
28 | 27 | import uk.me.parabola.imgfmt.app.Label; |
28 | import uk.me.parabola.imgfmt.app.labelenc.EncodedText; | |
29 | 29 | import uk.me.parabola.imgfmt.fs.ImgChannel; |
30 | 30 | import uk.me.parabola.log.Logger; |
31 | 31 | import uk.me.parabola.util.Configurable; |
49 | 49 | // private List<Zoom> mapLevels = new ArrayList<Zoom>(); |
50 | 50 | private final Zoom[] mapLevels = new Zoom[16]; |
51 | 51 | |
52 | private final List<Label> copyrights = new ArrayList<Label>(); | |
52 | private final List<Label> copyrights = new ArrayList<>(); | |
53 | 53 | |
54 | 54 | // Information about polylines. eg roads etc. |
55 | 55 | private final List<PolylineOverview> polylineOverviews = new ArrayList<PolylineOverview>(); |
81 | 81 | * Add a string to the 'mapinfo' section. This is a section between the |
82 | 82 | * header and the start of the data. Nothing points to it directly. |
83 | 83 | * |
84 | * @param msg A string, usually used to describe the program that generated | |
85 | * the file. | |
86 | */ | |
87 | public void addInfo(String msg) { | |
88 | byte[] val = Utils.toBytes(msg); | |
84 | * @param enc A string in the EncodedText format. | |
85 | */ | |
86 | public void addInfo(EncodedText enc) { | |
87 | byte[] val = enc.getCtext(); | |
89 | 88 | if (position() != header.getHeaderLength() + header.getMapInfoSize()) |
90 | 89 | throw new IllegalStateException("All info must be added before anything else"); |
91 | 90 | |
92 | header.setMapInfoSize(header.getMapInfoSize() + (val.length+1)); | |
91 | header.setMapInfoSize(header.getMapInfoSize() + enc.getLength() + 1); | |
93 | 92 | getWriter().put(val); |
94 | 93 | getWriter().put((byte) 0); |
95 | 94 | } |
20 | 20 | import uk.me.parabola.imgfmt.app.ImgReader; |
21 | 21 | import uk.me.parabola.imgfmt.app.Label; |
22 | 22 | import uk.me.parabola.imgfmt.app.Section; |
23 | import uk.me.parabola.imgfmt.app.labelenc.CharacterDecoder; | |
24 | import uk.me.parabola.imgfmt.app.labelenc.CodeFunctions; | |
25 | import uk.me.parabola.imgfmt.app.labelenc.DecodedText; | |
23 | 26 | import uk.me.parabola.imgfmt.app.lbl.LBLFileReader; |
24 | 27 | import uk.me.parabola.imgfmt.fs.ImgChannel; |
25 | 28 | import uk.me.parabola.util.EnhancedProperties; |
195 | 198 | header.config(props); |
196 | 199 | } |
197 | 200 | |
198 | public String[] getMapInfo() { | |
199 | ||
200 | List<String> msgs = new ArrayList<String>(); | |
201 | public String[] getMapInfo(int codePage) { | |
202 | CodeFunctions funcs = CodeFunctions.createEncoderForLBL(0, codePage); | |
203 | CharacterDecoder decoder = funcs.getDecoder(); | |
201 | 204 | |
202 | 205 | // First do the ones in the TRE header gap |
203 | 206 | ImgFileReader reader = getReader(); |
204 | 207 | reader.position(header.getHeaderLength()); |
208 | List<String> msgs = new ArrayList<>(); | |
205 | 209 | while (reader.position() < header.getHeaderLength() + header.getMapInfoSize()) { |
206 | String m = reader.getZString(); | |
207 | msgs.add(m); | |
210 | byte[] m = reader.getZString(); | |
211 | ||
212 | decoder.reset(); | |
213 | for (byte b : m) | |
214 | decoder.addByte(b); | |
215 | ||
216 | DecodedText text = decoder.getText(); | |
217 | String text1 = text.getText(); | |
218 | ||
219 | msgs.add(text1); | |
208 | 220 | } |
209 | 221 | |
210 | 222 | |
214 | 226 | public String[] getCopyrights(LBLFileReader lblReader) { |
215 | 227 | Section sect = header.getCopyrightSection(); |
216 | 228 | ImgFileReader reader = getReader(); |
217 | List<String> msgs = new ArrayList<String>(); | |
229 | List<String> msgs = new ArrayList<>(); | |
218 | 230 | |
219 | 231 | long pos = sect.getPosition(); |
220 | 232 | while (pos < sect.getEndPos()) { |
0 | /* | |
1 | * Copyright (C) 2007 Steve Ratcliffe | |
2 | * | |
3 | * This program is free software; you can redistribute it and/or modify | |
4 | * it under the terms of the GNU General Public License version 2 as | |
5 | * published by the Free Software Foundation. | |
6 | * | |
7 | * This program is distributed in the hope that it will be useful, | |
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
10 | * GNU General Public License for more details. | |
11 | * | |
12 | * | |
13 | * Author: Steve Ratcliffe | |
14 | * Create date: Dec 19, 2007 | |
15 | */ | |
16 | package uk.me.parabola.imgfmt.mps; | |
17 | ||
18 | import java.io.ByteArrayOutputStream; | |
19 | import java.io.IOException; | |
20 | import java.nio.ByteBuffer; | |
21 | import java.nio.ByteOrder; | |
22 | ||
23 | import uk.me.parabola.imgfmt.fs.ImgChannel; | |
24 | import uk.me.parabola.io.StructuredOutputStream; | |
25 | ||
26 | /** | |
27 | * All the blocks in the file have a type and a length. | |
28 | * | |
29 | * @author Steve Ratcliffe | |
30 | */ | |
31 | public abstract class Block { | |
32 | private final int type; | |
33 | private final ByteArrayOutputStream output = new ByteArrayOutputStream(); | |
34 | ||
35 | protected Block(int type) { | |
36 | this.type = type; | |
37 | } | |
38 | ||
39 | public void write(ImgChannel chan) throws IOException { | |
40 | // First write the body to the byte buffer so that we know its length. | |
41 | writeBody(new StructuredOutputStream(output)); | |
42 | ||
43 | ByteBuffer buf = ByteBuffer.allocate(16); | |
44 | buf.order(ByteOrder.LITTLE_ENDIAN); | |
45 | buf.put((byte) type); | |
46 | char len = getLength(); | |
47 | buf.putChar(len); | |
48 | ||
49 | // write the header. | |
50 | buf.flip(); | |
51 | chan.write(buf); | |
52 | ||
53 | // write the body. | |
54 | buf = ByteBuffer.allocate(len); | |
55 | buf.put(output.toByteArray()); | |
56 | buf.flip(); | |
57 | chan.write(buf); | |
58 | } | |
59 | ||
60 | /** | |
61 | * Writes the body to the output stream given. | |
62 | * | |
63 | * @param out The stream to write to. | |
64 | */ | |
65 | protected abstract void writeBody(StructuredOutputStream out) throws IOException; | |
66 | ||
67 | /** | |
68 | * This is only valid after everything is written to the block. | |
69 | * | |
70 | * @return The length of the block (or the amount written already). | |
71 | */ | |
72 | private char getLength() { | |
73 | int len = output.toByteArray().length; | |
74 | assert len <= 0xffff; | |
75 | return (char) len; | |
76 | } | |
77 | } |
23 | 23 | * |
24 | 24 | * @author Steve Ratcliffe |
25 | 25 | */ |
26 | public class MapBlock extends Block { | |
26 | public class MapBlock extends MpsBlock { | |
27 | 27 | private static final int BLOCK_TYPE = 0x4c; |
28 | 28 | |
29 | 29 | private int familyId; |
35 | 35 | private String mapDescription; |
36 | 36 | private String areaName; |
37 | 37 | |
38 | public MapBlock() { | |
39 | super(BLOCK_TYPE); | |
38 | public MapBlock(int codePage) { | |
39 | super(BLOCK_TYPE, codePage); | |
40 | 40 | } |
41 | 41 | |
42 | 42 | protected void writeBody(StructuredOutputStream out) throws IOException { |
24 | 24 | * |
25 | 25 | * @author Steve Ratcliffe |
26 | 26 | */ |
27 | public class MapsetBlock extends Block { | |
27 | public class MapsetBlock extends MpsBlock { | |
28 | 28 | private static final int BLOCK_TYPE = 0x56; |
29 | 29 | |
30 | 30 | private String name = "OSM map set"; |
31 | 31 | |
32 | 32 | public MapsetBlock() { |
33 | super(BLOCK_TYPE); | |
33 | super(BLOCK_TYPE, 0); | |
34 | 34 | } |
35 | 35 | |
36 | 36 | protected void writeBody(StructuredOutputStream out) throws IOException { |
0 | /* | |
1 | * Copyright (C) 2016. | |
2 | * | |
3 | * This program is free software; you can redistribute it and/or modify | |
4 | * it under the terms of the GNU General Public License version 3 or | |
5 | * version 2 as published by the Free Software Foundation. | |
6 | * | |
7 | * This program is distributed in the hope that it will be useful, but | |
8 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
10 | * General Public License for more details. | |
11 | */ | |
12 | package uk.me.parabola.imgfmt.mps; | |
13 | ||
14 | import uk.me.parabola.io.FileBlock; | |
15 | ||
16 | public abstract class MpsBlock extends FileBlock { | |
17 | private final int codePage; | |
18 | ||
19 | public MpsBlock(int kind, int codePage) { | |
20 | super(kind); | |
21 | this.codePage = codePage; | |
22 | } | |
23 | ||
24 | public int getCodePage() { | |
25 | return codePage; | |
26 | } | |
27 | } |
16 | 16 | package uk.me.parabola.imgfmt.mps; |
17 | 17 | |
18 | 18 | import java.io.IOException; |
19 | import java.io.OutputStream; | |
20 | import java.nio.channels.Channels; | |
19 | 21 | import java.util.ArrayList; |
20 | 22 | import java.util.HashSet; |
21 | 23 | import java.util.List; |
35 | 37 | public class MpsFile { |
36 | 38 | private String mapsetName = "OSM map set"; |
37 | 39 | |
38 | private final Set<ProductBlock> products = new HashSet<ProductBlock>(); | |
39 | private final List<MapBlock> maps = new ArrayList<MapBlock>(); | |
40 | private final Set<ProductBlock> products = new HashSet<>(); | |
41 | private final List<MapBlock> maps = new ArrayList<>(); | |
40 | 42 | |
41 | 43 | private final ImgChannel chan; |
42 | 44 | |
45 | 47 | } |
46 | 48 | |
47 | 49 | public void sync() throws IOException { |
50 | OutputStream os = Channels.newOutputStream(chan); | |
48 | 51 | for (MapBlock map : maps) |
49 | map.write(chan); | |
52 | map.writeTo(os, map.getCodePage()); | |
50 | 53 | |
51 | 54 | for (ProductBlock block : products) |
52 | block.write(chan); | |
55 | block.writeTo(os, block.getCodePage()); | |
53 | 56 | |
54 | 57 | MapsetBlock mapset = new MapsetBlock(); |
55 | 58 | mapset.setName(mapsetName); |
56 | mapset.write(chan); | |
59 | mapset.writeTo(os, mapset.getCodePage()); | |
57 | 60 | } |
58 | 61 | |
59 | 62 | public void addMap(MapBlock map) { |
22 | 22 | |
23 | 23 | import uk.me.parabola.imgfmt.app.BufferedImgFileReader; |
24 | 24 | import uk.me.parabola.imgfmt.app.ImgFileReader; |
25 | import uk.me.parabola.imgfmt.app.labelenc.CharacterDecoder; | |
26 | import uk.me.parabola.imgfmt.app.labelenc.CodeFunctions; | |
25 | 27 | import uk.me.parabola.imgfmt.fs.ImgChannel; |
26 | 28 | |
27 | 29 | /** |
35 | 37 | */ |
36 | 38 | public class MpsFileReader implements Closeable { |
37 | 39 | |
38 | private final List<MapBlock> maps = new ArrayList<MapBlock>(); | |
39 | private final List<ProductBlock> products = new ArrayList<ProductBlock>(); | |
40 | private final List<MapBlock> maps = new ArrayList<>(); | |
41 | private final List<ProductBlock> products = new ArrayList<>(); | |
40 | 42 | |
41 | 43 | private final ImgChannel chan; |
42 | 44 | private final ImgFileReader reader; |
45 | private final CharacterDecoder decoder; | |
46 | private final int codePage; | |
43 | 47 | |
44 | public MpsFileReader(ImgChannel chan) { | |
48 | public MpsFileReader(ImgChannel chan, int codePage) { | |
45 | 49 | this.chan = chan; |
46 | 50 | this.reader = new BufferedImgFileReader(chan); |
51 | ||
52 | this.codePage = codePage; | |
53 | CodeFunctions funcs = CodeFunctions.createEncoderForLBL(0, codePage); | |
54 | decoder = funcs.getDecoder(); | |
47 | 55 | |
48 | 56 | readBlocks(); |
49 | 57 | } |
69 | 77 | } |
70 | 78 | |
71 | 79 | private void readMapBlock() { |
72 | MapBlock block = new MapBlock(); | |
80 | MapBlock block = new MapBlock(codePage); | |
73 | 81 | int val = reader.getInt(); |
74 | 82 | block.setIds(val >>> 16, val & 0xffff); |
75 | 83 | block.setMapNumber(reader.getInt()); |
76 | block.setSeriesName(reader.getZString()); | |
77 | block.setMapDescription(reader.getZString()); | |
78 | block.setAreaName(reader.getZString()); | |
84 | ||
85 | byte[] zString = reader.getZString(); | |
86 | block.setSeriesName(decodeToString(zString)); | |
87 | block.setMapDescription(decodeToString(reader.getZString())); | |
88 | block.setAreaName(decodeToString(reader.getZString())); | |
79 | 89 | block.setHexNumber(reader.getInt()); |
80 | 90 | reader.getInt(); |
81 | 91 | maps.add(block); |
82 | 92 | } |
83 | 93 | |
84 | 94 | private void readProductBlock() { |
85 | ProductBlock block = new ProductBlock(); | |
95 | ProductBlock block = new ProductBlock(codePage); | |
86 | 96 | block.setProductId(reader.getChar()); |
87 | 97 | block.setFamilyId(reader.getChar()); |
88 | block.setDescription(reader.getZString()); | |
98 | block.setDescription(decodeToString(reader.getZString())); | |
89 | 99 | products.add(block); |
100 | } | |
101 | ||
102 | private String decodeToString(byte[] zString) { | |
103 | decoder.reset(); | |
104 | for (byte b : zString) | |
105 | decoder.addByte(b); | |
106 | ||
107 | return decoder.getText().getText(); | |
90 | 108 | } |
91 | 109 | |
92 | 110 | public List<MapBlock> getMaps() { |
25 | 25 | * |
26 | 26 | * @author Steve Ratcliffe |
27 | 27 | */ |
28 | public class ProductBlock extends Block { | |
28 | public class ProductBlock extends MpsBlock { | |
29 | 29 | private static final int BLOCK_TYPE = 0x46; |
30 | 30 | |
31 | 31 | private int familyId; |
32 | 32 | private int productId; |
33 | 33 | private String description = "OSM maps"; |
34 | 34 | |
35 | public ProductBlock() { | |
36 | super(BLOCK_TYPE); | |
35 | public ProductBlock(int codePage) { | |
36 | super(BLOCK_TYPE, codePage); | |
37 | 37 | } |
38 | 38 | |
39 | 39 | protected void writeBody(StructuredOutputStream out) throws IOException { |
18 | 18 | import java.io.IOException; |
19 | 19 | import java.nio.ByteBuffer; |
20 | 20 | import java.nio.ByteOrder; |
21 | import java.util.Arrays; | |
21 | 22 | import java.util.Calendar; |
22 | 23 | import java.util.Date; |
23 | 24 | |
24 | 25 | import uk.me.parabola.imgfmt.FileSystemParam; |
25 | 26 | import uk.me.parabola.imgfmt.Utils; |
27 | import uk.me.parabola.imgfmt.app.labelenc.CharacterEncoder; | |
28 | import uk.me.parabola.imgfmt.app.labelenc.CodeFunctions; | |
29 | import uk.me.parabola.imgfmt.app.labelenc.EncodedText; | |
26 | 30 | import uk.me.parabola.imgfmt.fs.ImgChannel; |
27 | 31 | import uk.me.parabola.log.Logger; |
28 | 32 | |
304 | 308 | |
305 | 309 | /** |
306 | 310 | * Set the description. It is spread across two areas in the header. |
311 | * | |
312 | * It appears that the description has to be in ascii. | |
313 | * | |
307 | 314 | * @param desc The description. |
308 | 315 | */ |
309 | 316 | protected void setDescription(String desc) { |
310 | int len = desc.length(); | |
317 | // Force the description to be in ascii. | |
318 | CodeFunctions funcs = CodeFunctions.createEncoderForLBL(0, 0); | |
319 | CharacterEncoder encoder = funcs.getEncoder(); | |
320 | EncodedText enc = encoder.encodeText(desc); | |
321 | ||
322 | byte[] ctext = enc.getCtext(); | |
323 | int len = enc.getLength() - 1; | |
311 | 324 | if (len > 50) |
312 | 325 | throw new IllegalArgumentException("Description is too long (max 50)"); |
313 | String part1, part2; | |
314 | if (len > LEN_MAP_DESCRIPTION) { | |
315 | part1 = desc.substring(0, LEN_MAP_DESCRIPTION); | |
316 | part2 = desc.substring(LEN_MAP_DESCRIPTION, len); | |
317 | } else { | |
318 | part1 = desc.substring(0, len); | |
319 | part2 = ""; | |
326 | ||
327 | byte[] part1 = new byte[LEN_MAP_DESCRIPTION]; | |
328 | Arrays.fill(part1, (byte) ' '); | |
329 | ||
330 | byte[] part2 = new byte[LEN_MAP_NAME_CONT]; | |
331 | Arrays.fill(part2, (byte) ' '); | |
332 | ||
333 | if (ctext != null) { | |
334 | if (len > LEN_MAP_DESCRIPTION) { | |
335 | System.arraycopy(ctext, 0, part1, 0, LEN_MAP_DESCRIPTION); | |
336 | System.arraycopy(ctext, LEN_MAP_DESCRIPTION, part2, 0, len - LEN_MAP_DESCRIPTION); | |
337 | } else { | |
338 | System.arraycopy(ctext, 0, part1, 0, len); | |
339 | } | |
320 | 340 | } |
321 | 341 | |
322 | 342 | header.position(OFF_MAP_DESCRIPTION); |
323 | header.put(toByte(part1)); | |
324 | for (int i = len; i < LEN_MAP_DESCRIPTION; i++) | |
325 | header.put((byte) ' '); | |
343 | header.put(part1); | |
326 | 344 | |
327 | 345 | header.position(OFF_MAP_NAME_CONT); |
328 | header.put(toByte(part2)); | |
329 | for (int i = Math.max(len - LEN_MAP_DESCRIPTION, 0); i < LEN_MAP_NAME_CONT; i++) | |
330 | header.put((byte) ' '); | |
346 | header.put(part2); | |
331 | 347 | |
332 | 348 | header.put((byte) 0); // really? |
333 | 349 | } |
0 | /* | |
1 | * Copyright (C) 2016. | |
2 | * | |
3 | * This program is free software; you can redistribute it and/or modify | |
4 | * it under the terms of the GNU General Public License version 3 or | |
5 | * version 2 as published by the Free Software Foundation. | |
6 | * | |
7 | * This program is distributed in the hope that it will be useful, but | |
8 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
10 | * General Public License for more details. | |
11 | */ | |
12 | package uk.me.parabola.io; | |
13 | ||
14 | import java.io.ByteArrayOutputStream; | |
15 | import java.io.IOException; | |
16 | import java.io.OutputStream; | |
17 | ||
18 | import uk.me.parabola.imgfmt.app.labelenc.CharacterEncoder; | |
19 | import uk.me.parabola.imgfmt.app.labelenc.CodeFunctions; | |
20 | ||
21 | /** | |
22 | * A block forming part of a file. | |
23 | * | |
24 | * Used for TDB and MPS files. It will be read and written using the structured reader and | |
25 | * writer defined in this package. | |
26 | */ | |
27 | public abstract class FileBlock { | |
28 | private final byte blockId; | |
29 | ||
30 | private final ByteArrayOutputStream output = new ByteArrayOutputStream(); | |
31 | ||
32 | public FileBlock(int blockId) { | |
33 | this.blockId = (byte) blockId; | |
34 | ||
35 | fillHeader(); | |
36 | } | |
37 | ||
38 | /** | |
39 | * Write the body of the block. | |
40 | */ | |
41 | protected abstract void writeBody(StructuredOutputStream output) throws IOException; | |
42 | ||
43 | private StructuredOutputStream getStructuredOutput(int codePage) { | |
44 | CharacterEncoder enc = CodeFunctions.createEncoderForLBL(0, codePage).getEncoder(); | |
45 | return new StructuredOutputStream(output, enc); | |
46 | } | |
47 | ||
48 | /** | |
49 | * Write to an output stream. | |
50 | * | |
51 | * This will be to the actual TDB file. | |
52 | */ | |
53 | public void writeTo(OutputStream os, int codePage) throws IOException { | |
54 | StructuredOutputStream output = getStructuredOutput(codePage); | |
55 | writeBody(output); | |
56 | ||
57 | byte[] b = this.output.toByteArray(); | |
58 | ||
59 | // Fill in the actual full block length | |
60 | int blockLength = b.length - 3; | |
61 | b[1] = (byte) (blockLength & 0xff); | |
62 | b[2] = (byte) ((blockLength >> 8) & 0xff); | |
63 | os.write(b); | |
64 | } | |
65 | ||
66 | /** | |
67 | * Write the header to the internal buffer. The length may not be known yet and so is re-written later. | |
68 | */ | |
69 | private void fillHeader() { | |
70 | try { | |
71 | byte[] b = new byte[3]; | |
72 | b[0] = this.blockId; | |
73 | ||
74 | output.write(b); | |
75 | } catch (IOException ignore) { | |
76 | // does not throw | |
77 | } | |
78 | } | |
79 | } |
15 | 15 | */ |
16 | 16 | package uk.me.parabola.io; |
17 | 17 | |
18 | import java.io.FilterOutputStream; | |
18 | 19 | import java.io.IOException; |
19 | 20 | import java.io.OutputStream; |
20 | import java.io.FilterOutputStream; | |
21 | ||
22 | import uk.me.parabola.imgfmt.ExitException; | |
23 | import uk.me.parabola.imgfmt.app.labelenc.CharacterEncoder; | |
24 | import uk.me.parabola.imgfmt.app.labelenc.EncodedText; | |
25 | ||
26 | import static uk.me.parabola.imgfmt.app.labelenc.BaseEncoder.NO_TEXT; | |
21 | 27 | |
22 | 28 | /** |
23 | 29 | * An output stream that has methods for writing strings and little endian |
26 | 32 | * @author Steve Ratcliffe |
27 | 33 | */ |
28 | 34 | public class StructuredOutputStream extends FilterOutputStream { |
29 | ||
30 | public StructuredOutputStream(OutputStream out) { | |
35 | ||
36 | private final CharacterEncoder encoder; | |
37 | ||
38 | public StructuredOutputStream(OutputStream out, CharacterEncoder encoder) { | |
31 | 39 | super(out); |
40 | this.encoder = encoder; | |
32 | 41 | } |
33 | 42 | |
34 | 43 | public void write(int b) throws IOException { |
62 | 71 | * @throws IOException If the write fails. |
63 | 72 | */ |
64 | 73 | public void writeString(String s) throws IOException { |
65 | for (char c : s.toCharArray()) { | |
66 | out.write((byte) c); | |
67 | } | |
74 | if (encoder == null) | |
75 | throw new ExitException("tdbfile: character encoding is null"); | |
68 | 76 | |
69 | out.write('\0'); | |
77 | EncodedText encodedText = encoder.encodeText(s); | |
78 | if (encodedText == NO_TEXT) | |
79 | return; | |
80 | ||
81 | out.write(encodedText.getCtext(), 0, encodedText.getLength()); | |
70 | 82 | } |
71 | 83 | } |
33 | 33 | import uk.me.parabola.mkgmap.filters.MapFilterChain; |
34 | 34 | import uk.me.parabola.mkgmap.filters.PolygonSplitterFilter; |
35 | 35 | import uk.me.parabola.mkgmap.filters.PolygonSubdivSizeSplitterFilter; |
36 | import uk.me.parabola.mkgmap.filters.ShapeMergeFilter; | |
36 | 37 | import uk.me.parabola.mkgmap.general.MapDataSource; |
37 | 38 | import uk.me.parabola.mkgmap.general.MapElement; |
38 | 39 | import uk.me.parabola.mkgmap.general.MapLine; |
622 | 623 | * @param dy30 The size of each division (y direction) |
623 | 624 | * @return The index to areas where the map element fits. |
624 | 625 | */ |
625 | private int pickArea(MapArea[] areas, MapElement e, | |
626 | private static int pickArea(MapArea[] areas, MapElement e, | |
626 | 627 | int xbase30, int ybase30, |
627 | 628 | int nx, int ny, |
628 | 629 | int dx30, int dy30) |
732 | 733 | areasHashMap.put(hashVal, co); |
733 | 734 | } |
734 | 735 | } |
736 | if (Math.abs(signedAreaSize) < ShapeMergeFilter.SINGLE_POINT_AREA | |
737 | && areas[areaIndex].areaResolution != 24) { | |
738 | if (log.isInfoEnabled()) { | |
739 | log.info("splitIntoAreas creates single point shape. id", e.getOsmid(), | |
740 | "type", uk.me.parabola.mkgmap.reader.osm.GType.formatType(e.getType()), subSize, | |
741 | "points, at", subShape.get(0).toOSMURL()); | |
742 | } | |
743 | continue; | |
744 | } | |
745 | ||
735 | 746 | if (signedAreaSize == 0) { |
736 | log.warn("splitIntoAreas flat shape. id", e.getOsmid(), | |
747 | log.warn("splitIntoAreas creates single point shape. id", e.getOsmid(), | |
737 | 748 | "type", uk.me.parabola.mkgmap.reader.osm.GType.formatType(e.getType()), subSize, |
738 | 749 | "points, at", subShape.get(0).toOSMURL()); |
739 | 750 | continue; |
15 | 15 | import java.io.BufferedReader; |
16 | 16 | import java.io.File; |
17 | 17 | import java.io.FileNotFoundException; |
18 | import java.io.FileReader; | |
19 | 18 | import java.io.IOException; |
19 | import java.nio.charset.Charset; | |
20 | import java.nio.file.Files; | |
20 | 21 | import java.util.ArrayList; |
21 | 22 | import java.util.Arrays; |
22 | 23 | import java.util.Collections; |
25 | 26 | import java.util.IdentityHashMap; |
26 | 27 | import java.util.List; |
27 | 28 | import java.util.Set; |
28 | ||
29 | import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; | |
30 | 29 | |
31 | 30 | import uk.me.parabola.imgfmt.ExitException; |
32 | 31 | import uk.me.parabola.imgfmt.Utils; |
94 | 93 | import uk.me.parabola.util.Configurable; |
95 | 94 | import uk.me.parabola.util.EnhancedProperties; |
96 | 95 | |
96 | import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; | |
97 | ||
97 | 98 | /** |
98 | 99 | * This is the core of the code to translate from the general representation |
99 | 100 | * into the garmin representation. |
134 | 135 | |
135 | 136 | private int minSizePolygon; |
136 | 137 | private String polygonSizeLimitsOpt; |
137 | private HashMap<Integer,Integer> polygonSizeLimits = null; | |
138 | private HashMap<Integer,Integer> polygonSizeLimits; | |
138 | 139 | private double reducePointError; |
139 | 140 | private double reducePointErrorPolygon; |
140 | 141 | private boolean mergeLines; |
820 | 821 | |
821 | 822 | /** |
822 | 823 | * Set all the information that appears in the header. |
823 | * | |
824 | * @param map The map to write to. | |
825 | * @param src The source of map information. | |
826 | */ | |
827 | protected void getMapInfo() { | |
824 | */ | |
825 | private void getMapInfo() { | |
828 | 826 | if (licenseFileName != null) { |
829 | 827 | File file = new File(licenseFileName); |
830 | 828 | |
831 | 829 | try { |
832 | BufferedReader reader = new BufferedReader(new FileReader(file)); | |
830 | BufferedReader reader = Files.newBufferedReader(file.toPath(), Charset.forName("utf-8")); | |
833 | 831 | String text; |
834 | 832 | |
835 | 833 | // repeat until all lines is read |
880 | 878 | * @param map The map to write to. |
881 | 879 | * @param src The source of map information. |
882 | 880 | */ |
883 | protected void processInfo(Map map, LoadableMapDataSource src) { | |
881 | private void processInfo(Map map, LoadableMapDataSource src) { | |
884 | 882 | // The bounds of the map. |
885 | 883 | map.setBounds(src.getBounds()); |
886 | 884 |
16 | 16 | package uk.me.parabola.mkgmap.build; |
17 | 17 | |
18 | 18 | import java.util.ArrayList; |
19 | import java.util.Collections; | |
19 | 20 | import java.util.List; |
20 | 21 | |
21 | 22 | import uk.me.parabola.imgfmt.app.Area; |
98 | 99 | log.debug("orig area", mapSource.getBounds()); |
99 | 100 | |
100 | 101 | MapArea ma = initialArea(mapSource); |
102 | MapArea[] origArea = {ma}; | |
101 | 103 | MapArea[] areas = splitMaxSize(ma, orderByDecreasingArea); |
104 | if (areas == null) { | |
105 | log.warn("initial split returned null for ",ma); | |
106 | return origArea; | |
107 | } | |
102 | 108 | |
103 | 109 | // Now step through each area and see if any have too many map features |
104 | 110 | // in them. For those that do, we further split them. This is done |
105 | 111 | // recursively until everything fits. |
106 | 112 | List<MapArea> alist = new ArrayList<>(); |
107 | 113 | addAreasToList(areas, alist, 0, orderByDecreasingArea); |
114 | if (alist.isEmpty()) { | |
115 | return origArea; | |
116 | } | |
108 | 117 | |
109 | 118 | MapArea[] results = new MapArea[alist.size()]; |
110 | 119 | return alist.toArray(results); |
136 | 145 | ", lines = " + area.getNumLines() + "/" + sizes[MapArea.LINE_KIND] + |
137 | 146 | ", shapes = " + area.getNumShapes() + "/" + sizes[MapArea.SHAPE_KIND]); |
138 | 147 | } |
139 | boolean doSplit = false; | |
140 | ||
148 | boolean wantSplit = false; | |
149 | boolean mustSplit = false; | |
141 | 150 | if (area.getNumLines() > MAX_NUM_LINES || |
142 | 151 | area.getNumPoints() > MAX_NUM_POINTS || |
143 | 152 | (sizes[MapArea.POINT_KIND] + |
146 | 155 | sizes[MapArea.XT_POINT_KIND] > MAX_XT_POINTS_SIZE || |
147 | 156 | sizes[MapArea.XT_LINE_KIND] > MAX_XT_LINES_SIZE || |
148 | 157 | sizes[MapArea.XT_SHAPE_KIND] > MAX_XT_SHAPES_SIZE) |
149 | doSplit = true; // we must split | |
158 | mustSplit = true; // we must split | |
150 | 159 | else if (bounds.getMaxDimension() > MIN_DIMENSION) { |
151 | 160 | int sumSize = 0; |
152 | 161 | for (int s : sizes) |
155 | 164 | if (area.getLines().size() + area.getShapes().size() >= 2) { |
156 | 165 | // area has more bytes than wanted, and we can split |
157 | 166 | log.debug("splitting area because size is larger than wanted: " + sumSize); |
158 | doSplit = true; | |
167 | wantSplit = true; | |
159 | 168 | } |
160 | 169 | } |
161 | 170 | } |
162 | if (doSplit){ | |
171 | if (wantSplit || mustSplit){ | |
163 | 172 | if (bounds.getMaxDimension() > MIN_DIMENSION) { |
164 | 173 | if (log.isDebugEnabled()) |
165 | 174 | log.debug("splitting area", area); |
169 | 178 | else |
170 | 179 | sublist = area.split(1, 2, res, bounds, orderByDecreasingArea); |
171 | 180 | if (sublist == null) { |
172 | log.warn("SubDivision is single point at this resolution so can't split at " + | |
173 | area.getBounds().getCenter().toOSMURL() + " (probably harmless)"); | |
181 | String msg = "SubDivision is single point at this resolution so can't split at " | |
182 | + area.getBounds().getCenter().toOSMURL(); | |
183 | if (wantSplit) { | |
184 | log.info(msg + " (probably harmless)"); | |
185 | } else { | |
186 | log.error(msg); | |
187 | } | |
174 | 188 | } else { |
175 | 189 | addAreasToList(sublist, alist, depth + 1, orderByDecreasingArea); |
176 | 190 | continue; |
47 | 47 | */ |
48 | 48 | public void onFinish(); |
49 | 49 | |
50 | public default String getFilename() { | |
51 | return null; | |
52 | } | |
50 | 53 | } |
209 | 209 | * @throws FileNotFoundException If the file doesn't exist. |
210 | 210 | */ |
211 | 211 | private static FileInfo imgInfo(String inputName) throws FileNotFoundException { |
212 | FileSystem imgFs = ImgFS.openFs(inputName); | |
213 | ||
214 | try { | |
212 | ||
213 | try (FileSystem imgFs = ImgFS.openFs(inputName)) { | |
215 | 214 | FileSystemParam params = imgFs.fsparam(); |
216 | 215 | log.info("Desc", params.getMapDescription()); |
217 | 216 | log.info("Blocksize", params.getBlockSize()); |
236 | 235 | info.setMapname(name); |
237 | 236 | |
238 | 237 | boolean hasTre = false; |
238 | DirectoryEntry treEnt = null; | |
239 | ||
239 | 240 | List<DirectoryEntry> entries = imgFs.list(); |
240 | 241 | for (DirectoryEntry ent : entries) { |
241 | 242 | if (ent.isSpecial()) |
248 | 249 | info.setTresize(ent.getSize()); |
249 | 250 | info.setInnername(ent.getName()); |
250 | 251 | |
251 | treInfo(imgFs, ent, info); | |
252 | 252 | hasTre = true; |
253 | treEnt = ent; | |
253 | 254 | } else if ("RGN".equals(ext)) { |
254 | 255 | int size = ent.getSize(); |
255 | 256 | info.setRgnsize(size); |
272 | 273 | info.fileSizes.add(ent.getSize()); |
273 | 274 | } |
274 | 275 | |
276 | if (hasTre) | |
277 | treInfo(imgFs, treEnt, info); | |
278 | ||
275 | 279 | if (info.getKind() == UNKNOWN_KIND && hasTre) |
276 | 280 | info.setKind(IMG_KIND); |
277 | ||
281 | ||
278 | 282 | return info; |
279 | } finally { | |
280 | imgFs.close(); | |
281 | 283 | } |
282 | 284 | } |
283 | 285 | |
296 | 298 | |
297 | 299 | info.setBounds(treFile.getBounds()); |
298 | 300 | |
299 | info.setLicenceInfo(treFile.getMapInfo()); | |
301 | info.setLicenceInfo(treFile.getMapInfo(info.getCodePage())); | |
300 | 302 | |
301 | 303 | info.setHexname(((TREHeader) treFile.getHeader()).getMapId()); |
302 | 304 | } finally { |
398 | 400 | } |
399 | 401 | |
400 | 402 | |
401 | protected void setLicenceInfo(String[] info) { | |
403 | private void setLicenceInfo(String[] info) { | |
402 | 404 | this.licenceInfo = info; |
403 | 405 | } |
404 | 406 | |
427 | 429 | } |
428 | 430 | |
429 | 431 | public String getFamilyName() { |
430 | return args.get("family-name", "family name"); | |
432 | return args.get("family-name", "OSM map"); | |
431 | 433 | } |
432 | 434 | |
433 | 435 | public String getSeriesName() { |
489 | 491 | public boolean hasSortOrder() { |
490 | 492 | return sortOrderId != 0; |
491 | 493 | } |
494 | ||
495 | public String getOverviewName() { | |
496 | return args.get("overview-mapname", "osmmap"); | |
497 | } | |
492 | 498 | } |
0 | /* | |
1 | * Copyright (C) 2016. | |
2 | * | |
3 | * This program is free software; you can redistribute it and/or modify | |
4 | * it under the terms of the GNU General Public License version 3 or | |
5 | * version 2 as published by the Free Software Foundation. | |
6 | * | |
7 | * This program is distributed in the hope that it will be useful, but | |
8 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
10 | * General Public License for more details. | |
11 | */ | |
12 | package uk.me.parabola.mkgmap.combiners; | |
13 | ||
14 | import java.io.File; | |
15 | import java.io.IOException; | |
16 | import java.io.Writer; | |
17 | import java.nio.ByteBuffer; | |
18 | import java.nio.channels.ByteChannel; | |
19 | import java.nio.file.Files; | |
20 | import java.nio.file.Path; | |
21 | import java.nio.file.Paths; | |
22 | import java.nio.file.StandardCopyOption; | |
23 | import java.util.HashMap; | |
24 | import java.util.Map; | |
25 | import java.util.Objects; | |
26 | ||
27 | import javax.xml.stream.XMLOutputFactory; | |
28 | import javax.xml.stream.XMLStreamException; | |
29 | import javax.xml.stream.XMLStreamWriter; | |
30 | ||
31 | import uk.me.parabola.imgfmt.ExitException; | |
32 | import uk.me.parabola.imgfmt.fs.DirectoryEntry; | |
33 | import uk.me.parabola.imgfmt.fs.FileSystem; | |
34 | import uk.me.parabola.imgfmt.fs.ImgChannel; | |
35 | import uk.me.parabola.imgfmt.sys.ImgFS; | |
36 | import uk.me.parabola.mkgmap.CommandArgs; | |
37 | ||
38 | import static java.nio.file.StandardOpenOption.*; | |
39 | ||
40 | /** | |
41 | * Create a map in the gmapi format. | |
42 | * | |
43 | * This is directory tree containing an XML file describing the contents, and exploded versions of | |
44 | * each .img file. | |
45 | */ | |
46 | public class GmapiBuilder implements Combiner { | |
47 | private final static String NS = "http://www.garmin.com/xmlschemas/MapProduct/v1"; | |
48 | ||
49 | private final Map<String, Combiner> combinerMap; | |
50 | ||
51 | private Path gmapDir; | |
52 | private final Map<Integer, ProductInfo> productMap = new HashMap<>(); | |
53 | ||
54 | private String familyName; | |
55 | private int familyId; | |
56 | private short productVersion; | |
57 | ||
58 | private String typFile; | |
59 | ||
60 | public GmapiBuilder(Map<String, Combiner> combinerMap) { | |
61 | this.combinerMap = combinerMap; | |
62 | } | |
63 | ||
64 | /** | |
65 | * Initialise with the command line arguments. This is called after all | |
66 | * the command line arguments have been processed, but before any calls to | |
67 | * the {@link #onMapEnd} methods. | |
68 | * | |
69 | * @param args The command line arguments. | |
70 | */ | |
71 | public void init(CommandArgs args) { | |
72 | familyName = args.get("family-name", "OSM map"); | |
73 | familyId = args.get("family-id", CommandArgs.DEFAULT_FAMILYID); | |
74 | productVersion = (short) args.get("product-version", 100); | |
75 | ||
76 | gmapDir = Paths.get(args.getOutputDir(), String.format("%s.gmap", familyName)); | |
77 | } | |
78 | ||
79 | /** | |
80 | * This is called when an individual map is complete. | |
81 | * | |
82 | * @param info An interface to read the map. | |
83 | */ | |
84 | public void onMapEnd(FileInfo info) { | |
85 | ||
86 | String fn = info.getFilename(); | |
87 | String mapname = info.getMapname(); | |
88 | ||
89 | int productId = info.getProductId(); | |
90 | if (!productMap.containsKey(productId)) | |
91 | productMap.put(productId, new ProductInfo(productId, info.getSeriesName(), info.getOverviewName())); | |
92 | ||
93 | // Unzip the image into the product tile directory. | |
94 | try { | |
95 | if (info.isImg()) | |
96 | unzipImg(fn, mapname, productId); | |
97 | else if (info.getKind() == FileKind.TYP_KIND) | |
98 | typFile = info.getFilename(); | |
99 | ||
100 | } catch (IOException e) { | |
101 | e.printStackTrace(); | |
102 | } | |
103 | } | |
104 | ||
105 | /** | |
106 | * The complete map set has been processed. Finish off anything that needs | |
107 | * doing. | |
108 | */ | |
109 | public void onFinish() { | |
110 | try { | |
111 | if (combinerMap.containsKey("mdx")) { | |
112 | File file = new File(getFilenameFor("mdx")); | |
113 | Files.copy(file.toPath(), gmapDir.resolve(file.getName()), StandardCopyOption.REPLACE_EXISTING); | |
114 | } | |
115 | if (combinerMap.containsKey("mdr")) { | |
116 | File file = new File(getFilenameFor("mdr")); | |
117 | unzipImg(file.getCanonicalPath(), gmapDir.resolve(nameWithoutExtension(file))); | |
118 | } | |
119 | ||
120 | if (typFile != null) { | |
121 | File file = new File(typFile); | |
122 | Files.copy(file.toPath(), gmapDir.resolve(file.getName()), StandardCopyOption.REPLACE_EXISTING); | |
123 | } | |
124 | ||
125 | for (ProductInfo info : productMap.values()) { | |
126 | finishTdbFile(info); | |
127 | unzipImg(getFilenameFor("img"), info.overviewName, info.id); | |
128 | } | |
129 | ||
130 | writeXmlFile(gmapDir); | |
131 | ||
132 | } catch (IOException e) { | |
133 | e.printStackTrace(); | |
134 | } | |
135 | } | |
136 | ||
137 | private String nameWithoutExtension(File file) { | |
138 | String name = file.getName(); | |
139 | int len = name.length(); | |
140 | if (len < 4) | |
141 | return name; | |
142 | return name.substring(0, len-4); | |
143 | } | |
144 | ||
145 | private void finishTdbFile(ProductInfo info) throws IOException { | |
146 | Path tdbPath = Paths.get(getFilenameFor("tdb")); | |
147 | ||
148 | Files.copy(tdbPath, gmapDir | |
149 | .resolve(String.format("Product%d", info.id)) | |
150 | .resolve(String.format("%s.tdb", info.overviewName)), StandardCopyOption.REPLACE_EXISTING); | |
151 | } | |
152 | ||
153 | private void unzipImg(String srcImgName, String mapname, int productId) throws IOException { | |
154 | Path destDir = Paths.get(gmapDir.toString(), "Product" + productId, mapname); | |
155 | ||
156 | unzipImg(srcImgName, destDir); | |
157 | } | |
158 | ||
159 | private void unzipImg(String srcImgName, Path destDir) throws IOException { | |
160 | FileSystem fs = ImgFS.openFs(srcImgName); | |
161 | for (DirectoryEntry ent : fs.list()) { | |
162 | String fullname = ent.getFullName(); | |
163 | ||
164 | try (ImgChannel f = fs.open(fullname, "r")) { | |
165 | String name = displayName(fullname); | |
166 | if (Objects.equals(name, ".")) | |
167 | continue; | |
168 | ||
169 | Files.createDirectories(destDir); | |
170 | copyToFile(f, destDir.resolve(name)); | |
171 | } | |
172 | } | |
173 | } | |
174 | ||
175 | private void copyToFile(ImgChannel f, Path dest) { | |
176 | ByteBuffer buf = ByteBuffer.allocate(8 * 1024); | |
177 | try (ByteChannel outchan = Files.newByteChannel(dest, CREATE, WRITE, TRUNCATE_EXISTING)) { | |
178 | while (f.read(buf) > 0) { | |
179 | buf.flip(); | |
180 | outchan.write(buf); | |
181 | buf.compact(); | |
182 | } | |
183 | } catch (IOException e) { | |
184 | throw new ExitException("Cannot write file " + e); | |
185 | } | |
186 | } | |
187 | ||
188 | private String getFilenameFor(String kind) { | |
189 | return combinerMap.get(kind).getFilename(); | |
190 | } | |
191 | ||
192 | private String displayName(String fullname) { | |
193 | return fullname.trim().replace("\000", ""); | |
194 | } | |
195 | ||
196 | /** | |
197 | * An xml file contains similar information that is contained in the windows registry. | |
198 | * | |
199 | * @param gDir The directory where the Info.xml file will be created. | |
200 | */ | |
201 | private void writeXmlFile(Path gDir) { | |
202 | Path infoFile = gDir.resolve("Info.xml"); | |
203 | ||
204 | XMLOutputFactory factory = XMLOutputFactory.newFactory(); | |
205 | ||
206 | try (Writer stream = Files.newBufferedWriter(infoFile)) { | |
207 | ||
208 | XMLStreamWriter writer = factory.createXMLStreamWriter(stream); | |
209 | ||
210 | writer.writeStartDocument("UTF-8", "1.0"); | |
211 | writer.setDefaultNamespace(NS); | |
212 | writer.writeCharacters("\n"); | |
213 | ||
214 | writer.writeStartElement(NS,"MapProduct"); | |
215 | writer.writeDefaultNamespace(NS); | |
216 | writer.writeCharacters("\n"); | |
217 | ||
218 | xmlElement(writer, "Name", familyName); | |
219 | xmlElement(writer, "DataVersion", String.valueOf(productVersion)); | |
220 | xmlElement(writer, "DataFormat", "Original"); | |
221 | xmlElement(writer, "ID", String.valueOf(familyId)); | |
222 | ||
223 | if (combinerMap.containsKey("mdx")) { | |
224 | String mdxFile = getFilenameFor("mdx"); | |
225 | ||
226 | File file = new File(mdxFile); | |
227 | xmlElement(writer, "IDX", file.getName()); | |
228 | } | |
229 | ||
230 | if (combinerMap.containsKey("mdr")) { | |
231 | String mdrName = getFilenameFor("mdr"); | |
232 | File file = new File(mdrName); | |
233 | xmlElement(writer, "MDR", nameWithoutExtension(file)); | |
234 | } | |
235 | ||
236 | if (typFile != null) { | |
237 | File file = new File(typFile); | |
238 | xmlElement(writer, "TYP", file.getName()); | |
239 | } | |
240 | ||
241 | for (ProductInfo prod : productMap.values()) { | |
242 | writer.writeStartElement(NS, "SubProduct"); | |
243 | writer.writeCharacters("\n"); | |
244 | ||
245 | xmlElement(writer, "Name", prod.seriesName); | |
246 | xmlElement(writer, "ID", String.valueOf(prod.id)); | |
247 | xmlElement(writer, "BaseMap", prod.overviewName); | |
248 | xmlElement(writer, "TDB", String.format("%s.tdb", prod.overviewName)); | |
249 | xmlElement(writer, "Directory", String.format("Product%s", prod.id)); | |
250 | writer.writeEndElement(); | |
251 | writer.writeCharacters("\n"); | |
252 | } | |
253 | ||
254 | writer.writeEndElement(); | |
255 | writer.writeEndDocument(); | |
256 | writer.flush(); | |
257 | } catch (XMLStreamException | IOException e) { | |
258 | throw new ExitException("Could not create file " + infoFile + "; " + e); | |
259 | } | |
260 | } | |
261 | ||
262 | private void xmlElement(XMLStreamWriter writer, String name, String value) throws XMLStreamException { | |
263 | writer.writeCharacters(" "); | |
264 | writer.writeStartElement(NS, name); | |
265 | writer.writeCharacters(value); | |
266 | writer.writeEndElement(); | |
267 | writer.writeCharacters("\n"); | |
268 | } | |
269 | ||
270 | private static class ProductInfo { | |
271 | ||
272 | private final String seriesName; | |
273 | private final String overviewName; | |
274 | private final int id; | |
275 | ||
276 | public ProductInfo(int id, String seriesName, String overviewName) { | |
277 | this.id = id; | |
278 | this.seriesName = seriesName; | |
279 | this.overviewName = overviewName; | |
280 | } | |
281 | } | |
282 | } |
67 | 67 | private static final int ENTRY_SIZE = 240; |
68 | 68 | private static final int DIRECTORY_OFFSET_ENTRY = 2; |
69 | 69 | |
70 | private final Map<String, FileInfo> files = new LinkedHashMap<String, FileInfo>(); | |
70 | private final Map<String, FileInfo> files = new LinkedHashMap<>(); | |
71 | 71 | |
72 | 72 | // all these need to be set in the init routine from arguments. |
73 | 73 | private String areaName; |
80 | 80 | private boolean createIndex; // True if we should create and add an index file |
81 | 81 | |
82 | 82 | // There is a separate MDR and SRT file for each family id in the gmapsupp |
83 | private final Map<Integer, MdrBuilder> mdrBuilderMap = new LinkedHashMap<Integer, MdrBuilder>(); | |
84 | private final Map<Integer, Sort> sortMap = new LinkedHashMap<Integer, Sort>(); | |
83 | private final Map<Integer, MdrBuilder> mdrBuilderMap = new LinkedHashMap<>(); | |
84 | private final Map<Integer, Sort> sortMap = new LinkedHashMap<>(); | |
85 | 85 | private boolean splitName; |
86 | 86 | private boolean hideGmapsuppOnPC; |
87 | 87 | |
230 | 230 | } |
231 | 231 | |
232 | 232 | private MapBlock makeMapBlock(FileInfo info) { |
233 | MapBlock mb = new MapBlock(); | |
233 | MapBlock mb = new MapBlock(info.getCodePage()); | |
234 | 234 | mb.setMapNumber(info.getMapnameAsInt()); |
235 | 235 | mb.setHexNumber(info.getHexname()); |
236 | 236 | mb.setMapDescription(info.getDescription()); |
242 | 242 | } |
243 | 243 | |
244 | 244 | private ProductBlock makeProductBlock(FileInfo info) { |
245 | ProductBlock pb = new ProductBlock(); | |
245 | ProductBlock pb = new ProductBlock(info.getCodePage()); | |
246 | 246 | pb.setFamilyId(info.getFamilyId()); |
247 | 247 | pb.setProductId(info.getProductId()); |
248 | 248 | pb.setDescription(info.getFamilyName()); |
281 | 281 | FileSystem fs = null; |
282 | 282 | try { |
283 | 283 | fs = ImgFS.openFs(name); |
284 | MpsFileReader mr = new MpsFileReader(fs.open(info.getMpsName(), "r")); | |
284 | MpsFileReader mr = new MpsFileReader(fs.open(info.getMpsName(), "r"), info.getCodePage()); | |
285 | 285 | for (MapBlock block : mr.getMaps()) |
286 | 286 | mpsFile.addMap(block); |
287 | 287 | |
355 | 355 | int dot = name.lastIndexOf('.'); |
356 | 356 | |
357 | 357 | String base = name.substring(0, dot); |
358 | String ext = name.substring(dot + 1); | |
359 | 358 | if (base.length() > 8) |
360 | 359 | base = base.substring(0, 8); |
360 | ||
361 | String ext = name.substring(dot + 1); | |
361 | 362 | if (ext.length() > 3) |
362 | 363 | ext = ext.substring(0, 3); |
363 | 364 | |
372 | 373 | */ |
373 | 374 | private void addImg(FileSystem outfs, String filename) { |
374 | 375 | try { |
375 | FileSystem infs = ImgFS.openFs(filename); | |
376 | ||
377 | try { | |
376 | try (FileSystem infs = ImgFS.openFs(filename)) { | |
378 | 377 | copyAllFiles(infs, outfs); |
379 | } finally { | |
380 | infs.close(); | |
381 | } | |
378 | } | |
379 | ||
382 | 380 | } catch (FileNotFoundException e) { |
383 | 381 | log.error("Could not open file " + filename); |
384 | 382 | } |
416 | 414 | private FileSystem createGmapsupp() throws FileNotWritableException { |
417 | 415 | BlockInfo bi = calcBlockSize(); |
418 | 416 | int blockSize = bi.blockSize; |
417 | ||
419 | 418 | // Create this file, containing all the sub files |
420 | 419 | FileSystemParam params = new FileSystemParam(); |
421 | 420 | params.setBlockSize(blockSize); |
428 | 427 | params.setReservedDirectoryBlocks(reserveBlocks); |
429 | 428 | |
430 | 429 | FileSystem outfs = ImgFS.createFs(Utils.joinPath(outputDir, GMAPSUPP), params); |
431 | ||
430 | ||
432 | 431 | mpsFile = createMpsFile(outfs); |
433 | 432 | mpsFile.setMapsetName(mapsetName); |
434 | 433 |
361 | 361 | Utils.closeFile(file); |
362 | 362 | } |
363 | 363 | |
364 | public String getFilename() { | |
365 | return outputName; | |
366 | } | |
367 | ||
364 | 368 | public int getSize() { |
365 | 369 | return (int) tmpName.length(); |
366 | 370 | } |
54 | 54 | throw new ExitException("Could not create MDX file", e); |
55 | 55 | } |
56 | 56 | } |
57 | ||
58 | public String getFilename() { | |
59 | return Utils.joinPath(outputDir, mdxFilename); | |
60 | } | |
57 | 61 | } |
89 | 89 | calcLevels(); |
90 | 90 | writeOverviewMap(); |
91 | 91 | } |
92 | ||
92 | ||
93 | @Override | |
94 | public String getFilename() { | |
95 | return Utils.joinPath(outputDir, overviewMapname, "img"); | |
96 | } | |
97 | ||
93 | 98 | private void calcLevels() { |
94 | 99 | List<MapShape> shapes = overviewSource.getShapes(); |
95 | 100 | int maxRes = 16; // we can write a 0x4a polygon for planet in res 16 |
46 | 46 | private String overviewMapnumber; |
47 | 47 | private String outputDir; |
48 | 48 | private int tdbVersion; |
49 | private List<String[]> copyrightMsgs = new ArrayList<String[]>(); | |
49 | private final List<String[]> copyrightMsgs = new ArrayList<>(); | |
50 | 50 | |
51 | 51 | public TdbBuilder(OverviewBuilder ovb) { |
52 | 52 | overviewBuilder = ovb; |
59 | 59 | * |
60 | 60 | * @param args The command line arguments as they are at the end of the list. |
61 | 61 | * In other words if the same argument appears more than once, then it will |
62 | * have the latest value set. | |
62 | 63 | */ |
63 | 64 | public void init(CommandArgs args) { |
64 | 65 | overviewMapname = args.get("overview-mapname", "osmmap"); |
181 | 182 | writeTdbFile(); |
182 | 183 | } |
183 | 184 | |
185 | public String getFilename() { | |
186 | return Utils.joinPath(outputDir, overviewMapname, "tdb"); | |
187 | } | |
188 | ||
184 | 189 | /** |
185 | 190 | * Write out the TDB file at the end of processing. |
186 | 191 | */ |
14 | 14 | import it.unimi.dsi.fastutil.ints.IntArrayList; |
15 | 15 | |
16 | 16 | import java.util.ArrayList; |
17 | import java.util.Collections; | |
17 | 18 | import java.util.IdentityHashMap; |
18 | 19 | import java.util.Iterator; |
19 | 20 | import java.util.LinkedHashMap; |
51 | 52 | if (shapes.size() <= 1) |
52 | 53 | return shapes; |
53 | 54 | int count = 0; |
54 | MultiHashMap<Integer, Map<MapShape, List<ShapeHelper>>> topMap = new MultiHashMap<Integer, Map<MapShape,List<ShapeHelper>>>(); | |
55 | List<MapShape> mergedShapes = new ArrayList<MapShape>(); | |
55 | MultiHashMap<Integer, Map<MapShape, List<ShapeHelper>>> topMap = new MultiHashMap<>(); | |
56 | List<MapShape> mergedShapes = new ArrayList<>(); | |
56 | 57 | for (MapShape shape: shapes) { |
57 | 58 | if (shape.getMinResolution() > resolution || shape.getMaxResolution() < resolution) |
58 | 59 | continue; |
75 | 76 | continue; |
76 | 77 | } |
77 | 78 | if (sameTypeList.isEmpty()){ |
78 | Map<MapShape, List<ShapeHelper>> lowMap = new LinkedHashMap<MapShape, List<ShapeHelper>>(); | |
79 | ArrayList<ShapeHelper> list = new ArrayList<ShapeHelper>(); | |
79 | Map<MapShape, List<ShapeHelper>> lowMap = new LinkedHashMap<>(); | |
80 | ArrayList<ShapeHelper> list = new ArrayList<>(); | |
80 | 81 | list.add(sh); |
81 | 82 | lowMap.put(shape, list); |
82 | 83 | topMap.add(shape.getType(),lowMap); |
104 | 105 | } |
105 | 106 | } |
106 | 107 | if (!added){ |
107 | ArrayList<ShapeHelper> list = new ArrayList<ShapeHelper>(); | |
108 | ArrayList<ShapeHelper> list = new ArrayList<>(); | |
108 | 109 | list.add(sh); |
109 | 110 | lowMap.put(shape, list); |
110 | 111 | } |
156 | 157 | private List<ShapeHelper> addWithConnectedHoles(List<ShapeHelper> list, |
157 | 158 | final ShapeHelper toAdd, final int type) { |
158 | 159 | assert toAdd.getPoints().size() > 3; |
159 | List<ShapeHelper> result = new ArrayList<ShapeHelper>(list.size()+1); | |
160 | List<ShapeHelper> result = new ArrayList<>(list.size()+1); | |
160 | 161 | ShapeHelper shNew = new ShapeHelper(toAdd); |
161 | 162 | for (ShapeHelper shOld:list){ |
162 | 163 | if (shOld.getBounds().intersects(shNew.getBounds()) == false){ |
223 | 224 | List<Coord> merged = null; |
224 | 225 | if (points1.size() + points2.size() - 2*sh1PositionsToCheck.size() < PolygonSplitterFilter.MAX_POINT_IN_ELEMENT){ |
225 | 226 | merged = mergeLongestSequence(points1, points2, sh1PositionsToCheck, sh2PositionsToCheck, sameDir); |
227 | if (merged.isEmpty()) | |
228 | return dupShape; | |
226 | 229 | if (merged.get(0) != merged.get(merged.size()-1)) |
227 | 230 | merged = null; |
228 | 231 | else if (merged.size() > PolygonSplitterFilter.MAX_POINT_IN_ELEMENT){ |
261 | 264 | * @param s1PositionsToCheck will contain common positions in shape 1 |
262 | 265 | * @param s2PositionsToCheck will contain common positions in shape 2 |
263 | 266 | */ |
264 | private void findCommonCoords(List<Coord> s1, List<Coord> s2, | |
267 | private static void findCommonCoords(List<Coord> s1, List<Coord> s2, | |
265 | 268 | IntArrayList s1PositionsToCheck, |
266 | 269 | IntArrayList s2PositionsToCheck) { |
267 | 270 | Map<Coord, Integer> s2PosMap = new IdentityHashMap<>(s2.size() - 1); |
311 | 314 | * @param sameDir true if both shapes are clockwise or both are ccw |
312 | 315 | * @return the merged shape or null if no points are common. |
313 | 316 | */ |
314 | private List<Coord> mergeLongestSequence(List<Coord> points1, List<Coord> points2, IntArrayList sh1PositionsToCheck, | |
317 | private static List<Coord> mergeLongestSequence(List<Coord> points1, List<Coord> points2, IntArrayList sh1PositionsToCheck, | |
315 | 318 | IntArrayList sh2PositionsToCheck, boolean sameDir) { |
316 | 319 | if (sh1PositionsToCheck.isEmpty()) |
317 | 320 | return null; |
359 | 362 | } |
360 | 363 | // now merge the shapes. The longest sequence of common points is removed. |
361 | 364 | // The remaining points are connected in the direction of the 1st shape. |
362 | List<Coord> merged = new ArrayList<Coord>(s1Size + s2Size - 2*longestSequence -1); | |
365 | int remaining = s1Size + s2Size - 2*longestSequence -1; | |
366 | if (remaining < 3) { | |
367 | return Collections.emptyList(); // may happen with self-intersecting duplicated shapes | |
368 | } | |
369 | List<Coord> merged = new ArrayList<>(remaining); | |
363 | 370 | int s1Pos = sh1PositionsToCheck.getInt(startOfLongestSequence+longestSequence); |
364 | 371 | for (int i = 0; i < s1Size - longestSequence - 1; i++){ |
365 | 372 | merged.add(points1.get(s1Pos)); |
386 | 393 | return merged; |
387 | 394 | } |
388 | 395 | |
389 | private class ShapeHelper{ | |
396 | private static class ShapeHelper{ | |
390 | 397 | final private List<Coord> points; |
391 | 398 | long id; // TODO: remove debugging aid |
392 | 399 | long areaTestVal; |
439 | 446 | return new Area(minLat, minLon, maxLat, maxLon); |
440 | 447 | } |
441 | 448 | } |
442 | private final static long smallArea = 1L<<6 * 1L<<6; | |
449 | public final static long SINGLE_POINT_AREA = 1L<<6 * 1L<<6; | |
443 | 450 | |
444 | 451 | /** |
445 | 452 | * Calculate the high precision area size test value. |
463 | 470 | signedAreaSize += (long) (c2.getHighPrecLon() + c1.getHighPrecLon()) |
464 | 471 | * (c1.getHighPrecLat() - c2.getHighPrecLat()); |
465 | 472 | } |
466 | if (Math.abs(signedAreaSize) < smallArea){ | |
473 | if (Math.abs(signedAreaSize) < SINGLE_POINT_AREA){ | |
467 | 474 | log.debug("very small shape near", points.get(0).toOSMURL(), "signed area in high prec map units:", signedAreaSize ); |
468 | 475 | } |
469 | 476 | return signedAreaSize; |
20 | 20 | import java.io.PrintStream; |
21 | 21 | import java.util.ArrayList; |
22 | 22 | import java.util.Arrays; |
23 | import java.util.Collections; | |
24 | 23 | import java.util.Comparator; |
25 | 24 | import java.util.Date; |
26 | 25 | import java.util.HashMap; |
29 | 28 | import java.util.List; |
30 | 29 | import java.util.Locale; |
31 | 30 | import java.util.Map; |
31 | import java.util.Objects; | |
32 | 32 | import java.util.Set; |
33 | 33 | import java.util.concurrent.Callable; |
34 | 34 | import java.util.concurrent.ExecutionException; |
48 | 48 | import uk.me.parabola.mkgmap.Version; |
49 | 49 | import uk.me.parabola.mkgmap.combiners.Combiner; |
50 | 50 | import uk.me.parabola.mkgmap.combiners.FileInfo; |
51 | import uk.me.parabola.mkgmap.combiners.GmapiBuilder; | |
51 | 52 | import uk.me.parabola.mkgmap.combiners.GmapsuppBuilder; |
52 | 53 | import uk.me.parabola.mkgmap.combiners.MdrBuilder; |
53 | 54 | import uk.me.parabola.mkgmap.combiners.MdxBuilder; |
94 | 95 | |
95 | 96 | private volatile int programRC = 0; |
96 | 97 | |
98 | private final Map<String, Combiner> combinerMap = new HashMap<>(); | |
99 | ||
97 | 100 | /** |
98 | 101 | * Used for unit tests |
99 | 102 | */ |
100 | public static void mainNoSystemExit(String[] args) { | |
103 | public static void mainNoSystemExit(String... args) { | |
101 | 104 | Main.mainStart(args); |
102 | 105 | } |
103 | 106 | |
104 | public static void main(String[] args) { | |
107 | public static void main(String... args) { | |
105 | 108 | int rc = Main.mainStart(args); |
106 | 109 | if (rc != 0) |
107 | 110 | System.exit(1); |
114 | 117 | * |
115 | 118 | * @param args The command line arguments. |
116 | 119 | */ |
117 | private static int mainStart(String[] args) { | |
120 | private static int mainStart(String... args) { | |
118 | 121 | long start = System.currentTimeMillis(); |
119 | 122 | System.out.println("Time started: " + new Date()); |
120 | 123 | // We need at least one argument. |
323 | 326 | } |
324 | 327 | |
325 | 328 | public void removeOption(String opt) { |
326 | if ("tdbfile".equals(opt)) | |
329 | if (Objects.equals("tdbfile", opt)) | |
327 | 330 | createTdbFiles = false; |
328 | 331 | } |
329 | 332 | |
336 | 339 | if (!tdbBuilderAdded ){ |
337 | 340 | OverviewMap overviewSource = new OverviewMapDataSource(); |
338 | 341 | OverviewBuilder overviewBuilder = new OverviewBuilder(overviewSource); |
339 | addCombiner(overviewBuilder); | |
342 | addCombiner("img", overviewBuilder); | |
340 | 343 | TdbBuilder tdbBuilder = new TdbBuilder(overviewBuilder); |
341 | addCombiner(tdbBuilder); | |
344 | addCombiner("tdb", tdbBuilder); | |
342 | 345 | tdbBuilderAdded = true; |
343 | 346 | } |
344 | 347 | } |
394 | 397 | } |
395 | 398 | int checked = 0; |
396 | 399 | for (String name : names) { |
397 | if (styleOption != null && !name.equals(styleOption)) | |
400 | if (styleOption != null && !Objects.equals(name, styleOption)) | |
398 | 401 | continue; |
399 | 402 | if (names.length > 1){ |
400 | 403 | System.out.println("checking style: " + name); |
401 | 404 | } |
402 | 405 | ++checked; |
403 | 406 | boolean performChecks = true; |
404 | if ("classpath:styles".equals(styleFile) && !"default".equals(name)){ | |
407 | if (Objects.equals("classpath:styles", styleFile) && !Objects.equals("default", name)){ | |
405 | 408 | performChecks = false; |
406 | 409 | } |
407 | 410 | Style style = readOneStyle(name, performChecks); |
445 | 448 | return "en"; |
446 | 449 | } |
447 | 450 | |
448 | private void addCombiner(Combiner combiner) { | |
451 | private void addCombiner(String name, Combiner combiner) { | |
452 | combinerMap.put(name, combiner); | |
449 | 453 | combiners.add(combiner); |
450 | 454 | } |
451 | 455 | |
535 | 539 | for (Combiner c : combiners) |
536 | 540 | c.init(args); |
537 | 541 | |
538 | Collections.sort(filenames, new Comparator<FilenameTask>() { | |
542 | filenames.sort(new Comparator<FilenameTask>() { | |
539 | 543 | public int compare(FilenameTask o1, FilenameTask o2) { |
540 | 544 | if (!o1.getFilename().endsWith(".img") || !o2.getFilename().endsWith(".img")) |
541 | 545 | return o1.getFilename().compareTo(o2.getFilename()); |
619 | 623 | |
620 | 624 | private void fileOptions(CommandArgs args) { |
621 | 625 | boolean indexOpt = args.exists("index"); |
622 | boolean gmapOpt = args.exists("gmapsupp"); | |
626 | boolean gmapsuppOpt = args.exists("gmapsupp"); | |
623 | 627 | boolean tdbOpt = args.exists("tdbfile"); |
628 | boolean gmapiOpt = args.exists("gmapi"); | |
629 | ||
624 | 630 | if (tdbOpt || createTdbFiles){ |
625 | 631 | addTdbBuilder(); |
626 | 632 | } |
627 | 633 | if (args.exists("nsis")) { |
628 | addCombiner(new NsisBuilder()); | |
629 | } | |
630 | if (gmapOpt) { | |
634 | addCombiner("nsis", new NsisBuilder()); | |
635 | } | |
636 | if (gmapsuppOpt) { | |
631 | 637 | GmapsuppBuilder gmapBuilder = new GmapsuppBuilder(); |
632 | 638 | gmapBuilder.setCreateIndex(indexOpt); |
633 | 639 | |
634 | addCombiner(gmapBuilder); | |
635 | } | |
636 | ||
637 | if (indexOpt && (tdbOpt || !gmapOpt)) { | |
638 | addCombiner(new MdrBuilder()); | |
639 | addCombiner(new MdxBuilder()); | |
640 | addCombiner("gmapsupp", gmapBuilder); | |
641 | } | |
642 | ||
643 | if (indexOpt && (tdbOpt || !gmapsuppOpt)) { | |
644 | addCombiner("mdr", new MdrBuilder()); | |
645 | addCombiner("mdx", new MdxBuilder()); | |
646 | } | |
647 | ||
648 | if (gmapiOpt) { | |
649 | addCombiner("gmapi", new GmapiBuilder(combinerMap)); | |
640 | 650 | } |
641 | 651 | } |
642 | 652 |
21 | 21 | import java.io.FileReader; |
22 | 22 | import java.io.IOException; |
23 | 23 | import java.io.InputStream; |
24 | import java.nio.charset.Charset; | |
25 | import java.nio.file.Files; | |
24 | 26 | import java.util.ArrayList; |
25 | 27 | import java.util.HashMap; |
26 | 28 | import java.util.HashSet; |
64 | 66 | new HousenumberHooks(), |
65 | 67 | }; |
66 | 68 | protected OsmConverter converter; |
67 | private final Set<String> usedTags = new HashSet<String>(); | |
69 | private final Set<String> usedTags = new HashSet<>(); | |
68 | 70 | protected ElementSaver elementSaver; |
69 | 71 | protected OsmReadingHooks osmReadingHooks; |
70 | 72 | |
138 | 140 | */ |
139 | 141 | public String[] copyrightMessages() { |
140 | 142 | String copyrightFileName = getConfig().getProperty("copyright-file", null); |
141 | if (copyrightFileName != null) | |
142 | { | |
143 | File file = new File(copyrightFileName); | |
144 | List<String> copyrightArray = new ArrayList<String>(); | |
143 | if (copyrightFileName != null) { | |
144 | List<String> copyrightArray = new ArrayList<>(); | |
145 | 145 | try { |
146 | BufferedReader reader = new BufferedReader(new FileReader(file)); | |
146 | File file = new File(copyrightFileName); | |
147 | BufferedReader reader = Files.newBufferedReader(file.toPath(), Charset.forName("utf-8")); | |
148 | ||
147 | 149 | String text; |
148 | 150 | while ((text = reader.readLine()) != null) { |
149 | 151 | copyrightArray.add(text); |
385 | 385 | ioPos++; // skip terminating zero from uid |
386 | 386 | --bytesToRead; |
387 | 387 | } |
388 | int start = 0; | |
389 | int buffPos = 0; | |
390 | stringPair[1] = null; | |
391 | while(stringPair[1] == null){ | |
392 | final int b = ioBuf[ioPos++]; | |
393 | --bytesToRead; | |
394 | cnvBuffer[buffPos++] = (byte) b; | |
395 | ||
396 | if (b == 0) | |
397 | stringPair[1] = new String(cnvBuffer, start, buffPos-1, "UTF-8"); | |
398 | } | |
388 | stringPair[1] = readString(); | |
399 | 389 | long bytes = toReadStart - bytesToRead; |
400 | 390 | if (bytes <= MAX_STRING_PAIR_SIZE) |
401 | 391 | storeStringPair(); |
422 | 412 | refType = 3; |
423 | 413 | stringPair[0] = REL_REF_TYPES[refType]; |
424 | 414 | |
425 | int start = 0; | |
426 | int buffPos = 0; | |
427 | stringPair[1] = null; | |
428 | while(stringPair[1] == null){ | |
429 | final int b = ioBuf[ioPos++]; | |
430 | --bytesToRead; | |
431 | cnvBuffer[buffPos++] = (byte)b; | |
432 | ||
433 | if (b == 0) | |
434 | stringPair[1] = new String(cnvBuffer, start, buffPos-1, "UTF-8"); | |
435 | } | |
415 | stringPair[1] = readString(); | |
436 | 416 | long bytes = toReadStart - bytesToRead; |
437 | 417 | if (bytes <= MAX_STRING_PAIR_SIZE) |
438 | 418 | storeStringPair(); |
459 | 439 | if (stringRef == 0){ |
460 | 440 | long toReadStart = bytesToRead; |
461 | 441 | int cnt = 0; |
462 | int buffPos = 0; | |
463 | int start = 0; | |
464 | 442 | while (cnt < 2){ |
465 | final int b = ioBuf[ioPos++]; | |
466 | --bytesToRead; | |
467 | cnvBuffer[buffPos++] = (byte)b; | |
468 | ||
469 | if (b == 0){ | |
470 | stringPair[cnt] = new String(cnvBuffer, start, buffPos-start-1, "UTF-8"); | |
471 | ++cnt; | |
472 | start = buffPos; | |
473 | } | |
443 | stringPair[cnt++] = readString(); | |
474 | 444 | } |
475 | 445 | long bytes = toReadStart - bytesToRead; |
476 | 446 | if (bytes <= MAX_STRING_PAIR_SIZE) |
479 | 449 | else |
480 | 450 | setStringRefPair(stringRef); |
481 | 451 | } |
452 | ||
453 | /** | |
454 | * Read a zero-terminated string (see o5m definition). | |
455 | * @throws IOException | |
456 | */ | |
457 | String readString() throws IOException { | |
458 | int length = 0; | |
459 | while (true) { | |
460 | final int b = ioBuf[ioPos++]; | |
461 | --bytesToRead; | |
462 | if (b == 0) | |
463 | return new String(cnvBuffer, 0, length, "UTF-8"); | |
464 | cnvBuffer[length++] = (byte) b; | |
465 | } | |
466 | } | |
467 | ||
482 | 468 | |
483 | 469 | /** reset the delta values and string table */ |
484 | 470 | private void reset(){ |
0 | /* | |
1 | * Copyright (C) 2007 Steve Ratcliffe | |
2 | * | |
3 | * This program is free software; you can redistribute it and/or modify | |
4 | * it under the terms of the GNU General Public License version 2 as | |
5 | * published by the Free Software Foundation. | |
6 | * | |
7 | * This program is distributed in the hope that it will be useful, | |
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
10 | * GNU General Public License for more details. | |
11 | * | |
12 | * | |
13 | * Author: Steve Ratcliffe | |
14 | * Create date: 23-Sep-2007 | |
15 | */ | |
16 | package uk.me.parabola.tdbfmt; | |
17 | ||
18 | import uk.me.parabola.log.Logger; | |
19 | import uk.me.parabola.io.StructuredInputStream; | |
20 | import uk.me.parabola.io.StructuredOutputStream; | |
21 | ||
22 | import java.io.ByteArrayInputStream; | |
23 | import java.io.ByteArrayOutputStream; | |
24 | import java.io.IOException; | |
25 | import java.io.OutputStream; | |
26 | ||
27 | /** | |
28 | * A block within the tdb file. Really just a type and the contents. | |
29 | * | |
30 | * @author Steve Ratcliffe | |
31 | */ | |
32 | class Block { | |
33 | private static final Logger log = Logger.getLogger(Block.class); | |
34 | ||
35 | private final int blockId; | |
36 | private int blockLength; | |
37 | private byte[] body; | |
38 | private StructuredInputStream istream; | |
39 | private ByteArrayOutputStream arrayBody; | |
40 | private StructuredOutputStream ostream; | |
41 | ||
42 | /** | |
43 | * Create a block that is going to be written to. | |
44 | * @param blockId The id for this block. | |
45 | */ | |
46 | Block(int blockId) { | |
47 | this.blockId = blockId; | |
48 | } | |
49 | ||
50 | /** | |
51 | * Create a block from data that is read in from a file. | |
52 | * @param type The block type. | |
53 | * @param body The raw bytes in the block. | |
54 | */ | |
55 | Block(int type, byte[] body) { | |
56 | blockId = type; | |
57 | this.body = body; | |
58 | this.blockLength = body.length; | |
59 | ByteArrayInputStream stream = new ByteArrayInputStream(body); | |
60 | this.istream = new StructuredInputStream(stream); | |
61 | } | |
62 | ||
63 | public int getBlockId() { | |
64 | return blockId; | |
65 | } | |
66 | ||
67 | /** | |
68 | * Get the raw bytes for this block. The source depends on if this block | |
69 | * was constructed from file data, or is being created from program calls | |
70 | * so that it can be written. | |
71 | * | |
72 | * @return A byte array of the raw bytes representing this block. | |
73 | */ | |
74 | byte[] getBody() { | |
75 | if (body == null && arrayBody != null) { | |
76 | byte[] bytes = arrayBody.toByteArray(); | |
77 | ||
78 | blockLength = bytes.length - 3; | |
79 | ||
80 | // Fill in the length in the space that we left earlier. | |
81 | bytes[1] = (byte) (blockLength & 0xff); | |
82 | bytes[2] = (byte) ((blockLength >> 8) & 0xff); | |
83 | return bytes; | |
84 | } | |
85 | return body; | |
86 | } | |
87 | ||
88 | /** | |
89 | * Get a stream for the body of this block. | |
90 | * | |
91 | * @return A structured stream that can be used to read the body of this | |
92 | * block. | |
93 | */ | |
94 | public StructuredInputStream getInputStream() { | |
95 | arrayBody = null; | |
96 | return this.istream; | |
97 | } | |
98 | ||
99 | public StructuredOutputStream getOutputStream() { | |
100 | if (ostream == null) { | |
101 | arrayBody = new ByteArrayOutputStream(); | |
102 | body = null; | |
103 | ostream = new StructuredOutputStream(arrayBody); | |
104 | try { | |
105 | ostream.write(blockId); | |
106 | ostream.write2(0); // This will be filled in later. | |
107 | } catch (IOException e) { | |
108 | log.warn("failed writing to array"); | |
109 | } | |
110 | } | |
111 | ||
112 | return ostream; | |
113 | } | |
114 | ||
115 | public void write(OutputStream stream) throws IOException { | |
116 | byte[] b = getBody(); | |
117 | if (b != null) | |
118 | stream.write(b); | |
119 | } | |
120 | } |
15 | 15 | */ |
16 | 16 | package uk.me.parabola.tdbfmt; |
17 | 17 | |
18 | import uk.me.parabola.io.FileBlock; | |
19 | import uk.me.parabola.io.StructuredOutputStream; | |
18 | 20 | import uk.me.parabola.log.Logger; |
19 | 21 | import uk.me.parabola.io.StructuredInputStream; |
20 | 22 | |
29 | 31 | * |
30 | 32 | * @author Steve Ratcliffe |
31 | 33 | */ |
32 | class CopyrightBlock { | |
34 | class CopyrightBlock extends FileBlock { | |
35 | public static final int BLOCK_ID = 0x44; | |
36 | ||
33 | 37 | private static final Logger log = Logger.getLogger(CopyrightBlock.class); |
34 | 38 | |
35 | private final List<CopyrightSegment> segments = new ArrayList<CopyrightSegment>(); | |
36 | private final Set<CopyrightSegment> copySet = new HashSet<CopyrightSegment>(); | |
39 | private final List<CopyrightSegment> segments = new ArrayList<>(); | |
40 | private final Set<CopyrightSegment> copySet = new HashSet<>(); | |
37 | 41 | |
38 | 42 | CopyrightBlock() { |
43 | super(BLOCK_ID); | |
39 | 44 | } |
40 | 45 | |
41 | CopyrightBlock(Block block) throws IOException { | |
42 | StructuredInputStream ds = block.getInputStream(); | |
46 | CopyrightBlock(StructuredInputStream ds) throws IOException { | |
47 | super(BLOCK_ID); | |
43 | 48 | |
44 | 49 | while (!ds.testEof()) { |
45 | 50 | CopyrightSegment segment = new CopyrightSegment(ds); |
49 | 54 | } |
50 | 55 | } |
51 | 56 | |
52 | public void write(Block block) throws IOException { | |
57 | /** | |
58 | * This is to overridden in a subclass. | |
59 | */ | |
60 | protected void writeBody(StructuredOutputStream ds) throws IOException { | |
53 | 61 | for (CopyrightSegment seg : segments) { |
54 | seg.write(block); | |
62 | seg.write(ds); | |
55 | 63 | } |
56 | 64 | } |
57 | 65 |
66 | 66 | this.extraProperties = 0; |
67 | 67 | } |
68 | 68 | |
69 | public void write(Block block) throws IOException { | |
70 | StructuredOutputStream os = block.getOutputStream(); | |
69 | public void write(StructuredOutputStream os) throws IOException { | |
71 | 70 | os.write(copyrightCode); |
72 | 71 | os.write(whereCode); |
73 | 72 | os.write2(extraProperties); |
27 | 27 | * @author Steve Ratcliffe |
28 | 28 | */ |
29 | 29 | public class DetailMapBlock extends OverviewMapBlock { |
30 | public static final int BLOCK_ID = 0x4c; | |
30 | 31 | |
31 | 32 | private int tdbVersion; |
32 | 33 | |
40 | 41 | private int nodDataSize; |
41 | 42 | |
42 | 43 | public DetailMapBlock(int tdbVersion) { |
44 | super(BLOCK_ID); | |
43 | 45 | assert tdbVersion > 0; |
44 | 46 | this.tdbVersion = tdbVersion; |
45 | 47 | } |
46 | 48 | |
47 | 49 | /** |
48 | 50 | * Initialise this block from the raw block given. |
49 | * @param block The raw block read from the file. | |
51 | * | |
50 | 52 | * @throws IOException For io problems. |
51 | 53 | */ |
52 | public DetailMapBlock(Block block) throws IOException { | |
53 | super(block); | |
54 | ||
55 | StructuredInputStream ds = block.getInputStream(); | |
54 | public DetailMapBlock(StructuredInputStream ds) throws IOException { | |
55 | super(ds); | |
56 | 56 | |
57 | 57 | // First there are a couple of fields that we ignore. |
58 | 58 | int junk = ds.read2(); |
74 | 74 | /** |
75 | 75 | * Write into the given block. |
76 | 76 | * |
77 | * @param block The block that will have been initialised to be a detail | |
78 | * block. | |
79 | 77 | * @throws IOException Problems writing, probably can't really happen as |
80 | 78 | * we use an array backed stream. |
81 | 79 | */ |
82 | public void write(Block block) throws IOException { | |
83 | super.write(block); | |
84 | ||
85 | StructuredOutputStream os = block.getOutputStream(); | |
80 | public void writeBody(StructuredOutputStream os) throws IOException { | |
81 | super.writeBody(os); | |
86 | 82 | |
87 | 83 | int n = 3; |
88 | 84 | if (tdbVersion >= TdbFile.TDB_V407) { |
119 | 115 | } |
120 | 116 | } |
121 | 117 | |
122 | public String getInnername() { | |
118 | private String getInnername() { | |
123 | 119 | return innername; |
124 | 120 | } |
125 | 121 |
17 | 17 | |
18 | 18 | import java.io.IOException; |
19 | 19 | |
20 | import uk.me.parabola.io.FileBlock; | |
20 | 21 | import uk.me.parabola.io.StructuredInputStream; |
21 | 22 | import uk.me.parabola.io.StructuredOutputStream; |
22 | 23 | |
25 | 26 | * |
26 | 27 | * @author Steve Ratcliffe |
27 | 28 | */ |
28 | class HeaderBlock { | |
29 | class HeaderBlock extends FileBlock { | |
30 | static final int BLOCK_ID = 0x50; | |
29 | 31 | |
30 | 32 | /** The map family. */ |
31 | 33 | private short familyId; |
53 | 55 | private int codePage; |
54 | 56 | |
55 | 57 | HeaderBlock(int tdbVersion) { |
58 | super(BLOCK_ID); | |
56 | 59 | this.tdbVersion = tdbVersion; |
57 | 60 | } |
58 | 61 | |
59 | HeaderBlock(Block block) throws IOException { | |
60 | StructuredInputStream ds = block.getInputStream(); | |
62 | public HeaderBlock(StructuredInputStream ds) throws IOException { | |
63 | super(BLOCK_ID); | |
61 | 64 | |
62 | 65 | productId = (short) ds.read2(); |
63 | 66 | familyId = (short) ds.read2(); |
68 | 71 | familyName = ds.readString(); |
69 | 72 | } |
70 | 73 | |
71 | public void write(Block block) throws IOException { | |
72 | StructuredOutputStream os = block.getOutputStream(); | |
74 | /** | |
75 | * This is to overridden in a subclass. | |
76 | */ | |
77 | protected void writeBody(StructuredOutputStream os) throws IOException { | |
73 | 78 | os.write2(productId); |
74 | 79 | os.write2(familyId); |
75 | 80 | os.write2(tdbVersion); |
95 | 100 | os.write3(0); |
96 | 101 | os.write4(codePage); |
97 | 102 | os.write4(10000); |
98 | os.write(1); // map is routable | |
103 | os.write(1); // map is routable | |
99 | 104 | if (enableProfile == 1) |
100 | os.write(1); // map has profile information | |
105 | os.write(1); // map has profile information | |
101 | 106 | else |
102 | 107 | os.write(0); |
103 | os.write(0); // map has DEM sub files | |
108 | os.write(0); // map has DEM sub files | |
104 | 109 | } |
105 | 110 | } |
106 | 111 | |
107 | // good | |
108 | //os.write(0); | |
109 | //os.write(0x12); | |
110 | //os.write(1); | |
111 | //os.write(1); | |
112 | //os.write(1); | |
113 | //os.write4(0); | |
114 | //os.write(0); | |
115 | //os.write(0x15); | |
116 | //os.write4(0); | |
117 | //os.write4(0); | |
118 | //os.write4(0); | |
119 | //os.write4(0); | |
120 | //os.write3(0); | |
121 | //os.write4(1252); | |
122 | //os.write4(10000); | |
123 | //os.write(1); | |
124 | //os.write(0); | |
125 | //os.write(0); | |
126 | 112 | public String toString() { |
127 | 113 | return "TDB header: " |
128 | 114 | + productId |
18 | 18 | import java.io.IOException; |
19 | 19 | |
20 | 20 | import uk.me.parabola.imgfmt.app.Area; |
21 | import uk.me.parabola.io.FileBlock; | |
21 | 22 | import uk.me.parabola.io.StructuredInputStream; |
22 | 23 | import uk.me.parabola.io.StructuredOutputStream; |
23 | 24 | |
35 | 36 | * |
36 | 37 | * @author Steve Ratcliffe |
37 | 38 | */ |
38 | public class OverviewMapBlock { | |
39 | public class OverviewMapBlock extends FileBlock { | |
40 | public static final int BLOCK_ID = 0x42; | |
41 | ||
39 | 42 | |
40 | 43 | private int mapNumber; |
41 | private String mapName; | |
42 | 44 | private int parentMapNumber; |
43 | 45 | |
44 | 46 | private String description; |
49 | 51 | private int minLong; |
50 | 52 | |
51 | 53 | public OverviewMapBlock() { |
54 | super(BLOCK_ID); | |
52 | 55 | description = "overview map"; |
53 | 56 | } |
54 | 57 | |
55 | public OverviewMapBlock(Block block) throws IOException { | |
56 | StructuredInputStream ds = block.getInputStream(); | |
58 | protected OverviewMapBlock(int blockId) { | |
59 | super(blockId); | |
60 | } | |
61 | ||
62 | public OverviewMapBlock(StructuredInputStream ds) throws IOException { | |
63 | super(BLOCK_ID); | |
57 | 64 | |
58 | 65 | mapNumber = ds.read4(); |
59 | 66 | parentMapNumber = ds.read4(); |
66 | 73 | description = ds.readString(); |
67 | 74 | } |
68 | 75 | |
69 | public void write(Block block) throws IOException { | |
70 | StructuredOutputStream os = block.getOutputStream(); | |
71 | ||
76 | public void writeBody(StructuredOutputStream os) throws IOException { | |
72 | 77 | os.write4(mapNumber); |
73 | 78 | os.write4(parentMapNumber); |
74 | 79 | os.write4(maxLat); |
107 | 112 | } |
108 | 113 | |
109 | 114 | public void setMapName(String mapName) { |
110 | this.mapName = mapName; | |
111 | 115 | try { |
112 | 116 | this.mapNumber = Integer.parseInt(mapName); |
113 | 117 | } catch (NumberFormatException e) { |
115 | 119 | } |
116 | 120 | } |
117 | 121 | |
118 | protected String getMapName() { | |
119 | return mapName; | |
120 | } | |
121 | ||
122 | 122 | public void setParentMapNumber(int parentMapNumber) { |
123 | 123 | this.parentMapNumber = parentMapNumber; |
124 | 124 | } |
17 | 17 | |
18 | 18 | import java.io.IOException; |
19 | 19 | |
20 | import uk.me.parabola.io.FileBlock; | |
20 | 21 | import uk.me.parabola.io.StructuredOutputStream; |
21 | 22 | |
22 | 23 | /** |
23 | 24 | * @author Steve Ratcliffe |
24 | 25 | */ |
25 | public class RBlock { | |
26 | public class RBlock extends FileBlock { | |
27 | private static final int BLOCK_ID = 'R'; | |
28 | ||
26 | 29 | private final String previewDescription = "Test preview map"; |
27 | 30 | |
28 | public void write(Block block) throws IOException { | |
29 | StructuredOutputStream os = block.getOutputStream(); | |
31 | public RBlock() { | |
32 | super(BLOCK_ID); | |
33 | } | |
30 | 34 | |
35 | public void writeBody(StructuredOutputStream os) throws IOException { | |
31 | 36 | os.write(0xc3); |
32 | 37 | os.writeString(previewDescription); |
33 | 38 | } |
17 | 17 | |
18 | 18 | import java.io.IOException; |
19 | 19 | |
20 | import uk.me.parabola.io.FileBlock; | |
20 | 21 | import uk.me.parabola.io.StructuredOutputStream; |
21 | 22 | |
22 | 23 | /** |
23 | 24 | * @author Steve Ratcliffe |
24 | 25 | */ |
25 | public class TBlock { | |
26 | public class TBlock extends FileBlock { | |
27 | private static final int BLOCK_ID = 'T'; | |
28 | ||
26 | 29 | private long sum; |
27 | 30 | |
28 | public void write(Block block) throws IOException { | |
29 | StructuredOutputStream os = block.getOutputStream(); | |
31 | public TBlock() { | |
32 | super(BLOCK_ID); | |
33 | } | |
34 | ||
35 | /** | |
36 | * This is to overridden in a subclass. | |
37 | */ | |
38 | protected void writeBody(StructuredOutputStream os) throws IOException { | |
30 | 39 | // If you change A,B,C or D the maps |
31 | 40 | // will not load, you can change the rest without easily visible |
32 | 41 | // problems although I suppose they must do something. |
17 | 17 | |
18 | 18 | import java.io.BufferedInputStream; |
19 | 19 | import java.io.BufferedOutputStream; |
20 | import java.io.ByteArrayInputStream; | |
20 | 21 | import java.io.FileInputStream; |
21 | 22 | import java.io.FileOutputStream; |
22 | 23 | import java.io.IOException; |
41 | 42 | |
42 | 43 | public static final int TDB_V407 = 407; |
43 | 44 | |
44 | private static final int BLOCK_OVERVIEW = 0x42; | |
45 | private static final int BLOCK_HEADER = 0x50; | |
46 | private static final int BLOCK_COPYRIGHT = 0x44; | |
47 | private static final int BLOCK_DETAIL = 0x4c; | |
48 | private static final int BLOCK_R = 0x52; | |
49 | private static final int BLOCK_T = 0x54; | |
50 | ||
51 | 45 | // The version number of the TDB format |
52 | 46 | private int tdbVersion; |
53 | 47 | |
55 | 49 | private HeaderBlock headerBlock; |
56 | 50 | private CopyrightBlock copyrightBlock = new CopyrightBlock(); |
57 | 51 | private OverviewMapBlock overviewMapBlock; |
58 | private final List<DetailMapBlock> detailBlocks = new ArrayList<DetailMapBlock>(); | |
52 | private final List<DetailMapBlock> detailBlocks = new ArrayList<>(); | |
59 | 53 | private final RBlock rblock = new RBlock(); |
60 | 54 | private final TBlock tblock = new TBlock(); |
61 | 55 | private String overviewDescription; |
56 | private int codePage; | |
62 | 57 | |
63 | 58 | public TdbFile() { |
64 | 59 | } |
77 | 72 | public static TdbFile read(String name) throws IOException { |
78 | 73 | TdbFile tdb = new TdbFile(); |
79 | 74 | |
80 | InputStream is = new BufferedInputStream(new FileInputStream(name)); | |
81 | ||
82 | try { | |
83 | StructuredInputStream ds = new StructuredInputStream(is); | |
84 | tdb.load(ds); | |
85 | } finally { | |
86 | is.close(); | |
75 | try (InputStream is = new BufferedInputStream(new FileInputStream(name))) { | |
76 | tdb.load(is); | |
87 | 77 | } |
88 | 78 | |
89 | 79 | return tdb; |
104 | 94 | } |
105 | 95 | |
106 | 96 | public void setCodePage(int codePage) { |
97 | this.codePage = codePage; | |
107 | 98 | headerBlock.setCodePage(codePage); |
108 | 99 | } |
109 | 100 | |
112 | 103 | * @param msg The message to add. |
113 | 104 | */ |
114 | 105 | public void addCopyright(String msg) { |
106 | if (msg.isEmpty()) | |
107 | return; | |
108 | ||
115 | 109 | CopyrightSegment seg = new CopyrightSegment(CopyrightSegment.CODE_COPYRIGHT_TEXT_STRING, 3, msg); |
116 | 110 | copyrightBlock.addSegment(seg); |
117 | 111 | } |
138 | 132 | } |
139 | 133 | |
140 | 134 | public void write(String name) throws IOException { |
141 | CheckedOutputStream stream = new CheckedOutputStream( | |
142 | new BufferedOutputStream(new FileOutputStream(name)), | |
143 | new CRC32()); | |
144 | 135 | |
145 | 136 | if (headerBlock == null || overviewMapBlock == null) |
146 | 137 | throw new IOException("Attempting to write file without being fully set up"); |
147 | 138 | |
148 | try { | |
149 | Block block = new Block(BLOCK_HEADER); | |
150 | headerBlock.write(block); | |
151 | block.write(stream); | |
152 | ||
153 | block = new Block(BLOCK_COPYRIGHT); | |
154 | copyrightBlock.write(block); | |
155 | block.write(stream); | |
139 | try (CheckedOutputStream stream = new CheckedOutputStream( | |
140 | new BufferedOutputStream(new FileOutputStream(name)), | |
141 | new CRC32())) | |
142 | { | |
143 | headerBlock.writeTo(stream, codePage); | |
144 | ||
145 | copyrightBlock.writeTo(stream, codePage); | |
156 | 146 | |
157 | 147 | if (tdbVersion >= TDB_V407) { |
158 | block = new Block(BLOCK_R); | |
159 | rblock.write(block); | |
160 | block.write(stream); | |
161 | } | |
162 | ||
163 | block = new Block(BLOCK_OVERVIEW); | |
164 | overviewMapBlock.write(block); | |
165 | block.write(stream); | |
148 | rblock.writeTo(stream, codePage); | |
149 | } | |
150 | ||
151 | overviewMapBlock.writeTo(stream, codePage); | |
166 | 152 | |
167 | 153 | for (DetailMapBlock detail : detailBlocks) { |
168 | block = new Block(BLOCK_DETAIL); | |
169 | detail.write(block); | |
170 | block.write(stream); | |
154 | detail.writeTo(stream, codePage); | |
171 | 155 | } |
172 | 156 | |
173 | 157 | if (tdbVersion >= TDB_V407) { |
174 | 158 | tblock.setSum(stream.getChecksum().getValue()); |
175 | ||
176 | block = new Block(BLOCK_T); | |
177 | tblock.write(block); | |
178 | block.write(stream); | |
179 | } | |
180 | } finally { | |
181 | stream.close(); | |
159 | tblock.writeTo(stream, codePage); | |
160 | } | |
182 | 161 | } |
183 | 162 | } |
184 | 163 | |
188 | 167 | * @param ds The stream to read from. |
189 | 168 | * @throws IOException For problems reading the file. |
190 | 169 | */ |
191 | private void load(StructuredInputStream ds) throws IOException { | |
192 | ||
193 | while (!ds.testEof()) { | |
194 | Block block = readBlock(ds); | |
195 | ||
196 | switch (block.getBlockId()) { | |
197 | case BLOCK_HEADER: | |
198 | headerBlock = new HeaderBlock(block); | |
199 | log.info("header block seen", headerBlock); | |
200 | break; | |
201 | case BLOCK_COPYRIGHT: | |
202 | log.info("copyright block"); | |
203 | copyrightBlock = new CopyrightBlock(block); | |
204 | break; | |
205 | case BLOCK_OVERVIEW: | |
206 | overviewMapBlock = new OverviewMapBlock(block); | |
207 | log.info("overview block", overviewMapBlock); | |
208 | break; | |
209 | case BLOCK_DETAIL: | |
210 | DetailMapBlock db = new DetailMapBlock(block); | |
211 | log.info("detail block", db); | |
212 | detailBlocks.add(db); | |
213 | break; | |
214 | default: | |
215 | log.warn("Unknown block in tdb file"); | |
216 | break; | |
217 | } | |
218 | } | |
219 | ||
170 | private void load(InputStream ds) throws IOException { | |
171 | ||
172 | boolean eof = false; | |
173 | while (!eof) { | |
174 | try { | |
175 | readBlock(ds); | |
176 | } catch (EndOfFileException ignore) { | |
177 | eof = true; | |
178 | } | |
179 | } | |
220 | 180 | } |
221 | 181 | |
222 | 182 | /** |
223 | 183 | * The file is divided into blocks. This reads a single block. |
224 | 184 | * |
225 | 185 | * @param is The input stream. |
226 | * @return A block from the file. | |
227 | 186 | * @throws IOException For problems reading the file. |
228 | 187 | */ |
229 | private Block readBlock(StructuredInputStream is) throws IOException { | |
188 | private void readBlock(InputStream is) throws IOException { | |
230 | 189 | int blockType = is.read(); |
231 | 190 | if (blockType == -1) |
232 | 191 | throw new EndOfFileException(); |
233 | int blockLength = is.read2(); | |
192 | ||
193 | int blockLength = readBlockLength(is); | |
194 | if (blockLength == -1) | |
195 | throw new EndOfFileException(); | |
234 | 196 | |
235 | 197 | byte[] body = new byte[blockLength]; |
236 | 198 | int n = is.read(body); |
237 | 199 | if (n < 0) |
238 | 200 | throw new IOException("failed to read block"); |
239 | 201 | |
240 | return new Block(blockType, body); | |
202 | StructuredInputStream ds = new StructuredInputStream(new ByteArrayInputStream(body)); | |
203 | switch (blockType) { | |
204 | case HeaderBlock.BLOCK_ID: | |
205 | headerBlock = new HeaderBlock(ds); | |
206 | log.info("header block seen", headerBlock); | |
207 | break; | |
208 | case CopyrightBlock.BLOCK_ID: | |
209 | log.info("copyright block"); | |
210 | copyrightBlock = new CopyrightBlock(ds); | |
211 | break; | |
212 | case OverviewMapBlock.BLOCK_ID: | |
213 | overviewMapBlock = new OverviewMapBlock(ds); | |
214 | log.info("overview block", overviewMapBlock); | |
215 | break; | |
216 | case DetailMapBlock.BLOCK_ID: | |
217 | DetailMapBlock db = new DetailMapBlock(ds); | |
218 | log.info("detail block", db); | |
219 | detailBlocks.add(db); | |
220 | break; | |
221 | default: | |
222 | log.warn("Unknown block in tdb file"); | |
223 | break; | |
224 | } | |
225 | } | |
226 | ||
227 | private int readBlockLength(InputStream is) throws IOException { | |
228 | int b1 = is.read(); | |
229 | if (b1 < 0) | |
230 | return -1; | |
231 | ||
232 | int b2 = is.read(); | |
233 | if (b2 < 0) | |
234 | return -1; | |
235 | ||
236 | return ((b2 & 0xff) << 8) | (b1 & 0xff); | |
241 | 237 | } |
242 | 238 | |
243 | 239 | public int getTdbVersion() { |
92 | 92 | |
93 | 93 | assertEquals("display priority", pri, ((TREHeader) treFile.getHeader()).getDisplayPriority()); |
94 | 94 | } |
95 | ||
96 | @Test | |
97 | public void testNoDescription() { | |
98 | Outputs op = TestUtils.run("--description", Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz"); | |
99 | op.checkNoError(); | |
100 | } | |
95 | 101 | } |
52 | 52 | @Test |
53 | 53 | public void testBasic() throws FileNotFoundException { |
54 | 54 | |
55 | Main.mainNoSystemExit(new String[]{ | |
56 | Args.TEST_STYLE_ARG, | |
57 | "--preserve-element-order", | |
58 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz" | |
59 | }); | |
55 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, "--preserve-element-order", | |
56 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz"); | |
60 | 57 | |
61 | 58 | MapReader mr = new MapReader(Args.DEF_MAP_ID + ".img"); |
62 | 59 | TestUtils.registerFile(mr); |
76 | 73 | |
77 | 74 | @Test |
78 | 75 | public void testNoSuchFile() { |
79 | Main.mainNoSystemExit(new String[]{ | |
80 | "no-such-file-xyz.osm", | |
81 | }); | |
76 | Main.mainNoSystemExit("no-such-file-xyz.osm"); | |
82 | 77 | assertFalse("no file generated", new File(Args.DEF_MAP_FILENAME).exists()); |
83 | 78 | } |
84 | 79 | |
85 | 80 | @Test |
86 | 81 | public void testPolish() throws FileNotFoundException { |
87 | Main.mainNoSystemExit(new String[]{ | |
88 | Args.TEST_STYLE_ARG, | |
89 | Args.TEST_RESOURCE_MP + "test1.mp" | |
90 | }); | |
82 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, Args.TEST_RESOURCE_MP + "test1.mp"); | |
91 | 83 | |
92 | 84 | FileSystem fs = openFs(Args.DEF_MAP_FILENAME); |
93 | 85 | assertNotNull("file exists", fs); |
108 | 100 | count++; |
109 | 101 | System.out.println("TRE size " + size); |
110 | 102 | // Size varies depending on svn modified status |
111 | assertThat("TRE size", size, new RangeMatcher(769, 2)); | |
103 | assertThat("TRE size", size, new RangeMatcher(770, 2)); | |
112 | 104 | break; |
113 | 105 | case "LBL": |
114 | 106 | count++; |
117 | 109 | } |
118 | 110 | } |
119 | 111 | assertTrue("enough checks run", count >= 3); |
112 | ||
120 | 113 | } |
121 | 114 | } |
71 | 71 | public static void init() throws FileNotFoundException { |
72 | 72 | TestUtils.deleteOutputFiles(); |
73 | 73 | |
74 | Main.mainNoSystemExit(new String[]{ | |
75 | Args.TEST_STYLE_ARG, | |
76 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz" | |
77 | }); | |
74 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz"); | |
78 | 75 | |
79 | 76 | fs = ImgFS.openFs(Args.DEF_MAP_FILENAME); |
80 | 77 | ImgChannel tre = fs.open(Args.DEF_MAP_ID + ".TRE", "r"); |
16 | 16 | import java.io.IOException; |
17 | 17 | import java.nio.ByteBuffer; |
18 | 18 | import java.nio.ByteOrder; |
19 | import java.util.Collections; | |
20 | 19 | import java.util.Comparator; |
21 | 20 | import java.util.List; |
22 | 21 | |
46 | 45 | File f = new File(GMAPSUPP_IMG); |
47 | 46 | assertFalse("does not pre-exist", f.exists()); |
48 | 47 | |
49 | Main.mainNoSystemExit(new String[]{ | |
50 | Args.TEST_STYLE_ARG, | |
51 | "--gmapsupp", | |
52 | Args.TEST_RESOURCE_IMG + "63240001.img", | |
53 | Args.TEST_RESOURCE_IMG + "63240002.img" | |
54 | }); | |
48 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
49 | "--gmapsupp", | |
50 | Args.TEST_RESOURCE_IMG + "63240001.img", | |
51 | Args.TEST_RESOURCE_IMG + "63240002.img"); | |
55 | 52 | |
56 | 53 | assertTrue("gmapsupp.img is created", f.exists()); |
57 | 54 | |
71 | 68 | */ |
72 | 69 | @Test |
73 | 70 | public void testMpsFile() throws IOException { |
74 | Main.mainNoSystemExit(new String[]{ | |
75 | Args.TEST_STYLE_ARG, | |
71 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
76 | 72 | "--gmapsupp", |
77 | 73 | "--family-id=150", |
78 | 74 | "--product-id=24", |
80 | 76 | "--family-name=tst family", |
81 | 77 | "--area-name=tst area", |
82 | 78 | Args.TEST_RESOURCE_IMG + "63240001.img", |
83 | Args.TEST_RESOURCE_IMG + "63240002.img" | |
84 | }); | |
79 | Args.TEST_RESOURCE_IMG + "63240002.img"); | |
85 | 80 | |
86 | 81 | MpsFileReader reader = getMpsFile(); |
87 | 82 | List<MapBlock> list = reader.getMaps(); |
107 | 102 | @Test |
108 | 103 | public void testCombiningSupps() throws IOException { |
109 | 104 | TestUtils.registerFile("g1.img", "g2.img"); |
110 | Main.mainNoSystemExit(new String[]{ | |
111 | Args.TEST_STYLE_ARG, | |
105 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
112 | 106 | "--gmapsupp", |
113 | 107 | "--family-id=150", |
114 | 108 | "--product-id=24", |
115 | 109 | "--series-name=tst series", |
116 | 110 | "--family-name=tst family", |
117 | 111 | "--area-name=tst area", |
118 | Args.TEST_RESOURCE_IMG + "63240001.img", | |
119 | }); | |
112 | Args.TEST_RESOURCE_IMG + "63240001.img"); | |
120 | 113 | |
121 | 114 | File f = new File("gmapsupp.img"); |
122 | 115 | f.renameTo(new File("g1.img")); |
123 | 116 | |
124 | Main.mainNoSystemExit(new String[]{ | |
125 | Args.TEST_STYLE_ARG, | |
117 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
126 | 118 | "--gmapsupp", |
127 | 119 | "--family-id=152", |
128 | 120 | "--product-id=26", |
129 | 121 | "--series-name=tst series 2", |
130 | 122 | "--family-name=tst family 2", |
131 | 123 | "--area-name=tst area 2", |
132 | Args.TEST_RESOURCE_IMG + "63240002.img", | |
133 | }); | |
124 | Args.TEST_RESOURCE_IMG + "63240002.img"); | |
125 | ||
134 | 126 | f.renameTo(new File("g2.img")); |
135 | 127 | |
136 | Main.mainNoSystemExit(new String[]{ | |
137 | Args.TEST_STYLE_ARG, | |
138 | "--gmapsupp", | |
139 | "g1.img", | |
140 | "g2.img" | |
141 | }); | |
128 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, "--gmapsupp", "g1.img", "g2.img"); | |
142 | 129 | |
143 | 130 | |
144 | 131 | MpsFileReader reader = getMpsFile(); |
172 | 159 | */ |
173 | 160 | @Test |
174 | 161 | public void testDifferentFamilies() throws IOException { |
175 | Main.mainNoSystemExit(new String[]{ | |
176 | Args.TEST_STYLE_ARG, | |
177 | "--gmapsupp", | |
178 | ||
179 | "--family-id=101", | |
180 | "--product-id=1", | |
181 | "--series-name=tst series1", | |
182 | Args.TEST_RESOURCE_IMG + "63240001.img", | |
183 | ||
162 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
163 | "--gmapsupp", | |
164 | "--family-id=101", | |
165 | "--product-id=1", | |
166 | "--series-name=tst series1", | |
167 | Args.TEST_RESOURCE_IMG + "63240001.img", | |
184 | 168 | "--family-id=102", |
185 | 169 | "--product-id=2", |
186 | 170 | "--series-name=tst series2", |
187 | Args.TEST_RESOURCE_IMG + "63240002.img" | |
188 | }); | |
171 | Args.TEST_RESOURCE_IMG + "63240002.img"); | |
189 | 172 | |
190 | 173 | MpsFileReader reader = getMpsFile(); |
191 | 174 | List<MapBlock> list = reader.getMaps(); |
211 | 194 | */ |
212 | 195 | @Test |
213 | 196 | public void testProductBlocks() throws IOException { |
214 | Main.mainNoSystemExit(new String[]{ | |
215 | Args.TEST_STYLE_ARG, | |
216 | "--gmapsupp", | |
217 | ||
197 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
198 | "--gmapsupp", | |
218 | 199 | "--family-id=101", |
219 | 200 | "--product-id=1", |
220 | 201 | "--family-name=tst family1", |
221 | 202 | "--series-name=tst series1", |
222 | 203 | Args.TEST_RESOURCE_IMG + "63240001.img", |
223 | ||
224 | 204 | "--family-id=102", |
225 | 205 | "--product-id=2", |
226 | 206 | "--family-name=tst family2", |
227 | 207 | "--series-name=tst series2", |
228 | Args.TEST_RESOURCE_IMG + "63240002.img" | |
229 | }); | |
208 | Args.TEST_RESOURCE_IMG + "63240002.img"); | |
230 | 209 | |
231 | 210 | MpsFileReader reader = getMpsFile(); |
232 | 211 | |
233 | 212 | List<ProductBlock> products = reader.getProducts(); |
234 | Collections.sort(products, new Comparator<ProductBlock>() { | |
213 | products.sort(new Comparator<ProductBlock>() { | |
235 | 214 | public int compare(ProductBlock o1, ProductBlock o2) { |
236 | 215 | if (o1.getFamilyId() == o2.getFamilyId()) |
237 | 216 | return 0; |
258 | 237 | */ |
259 | 238 | @Test |
260 | 239 | public void testProductWithSeveralMaps() throws IOException { |
261 | Main.mainNoSystemExit(new String[]{ | |
262 | Args.TEST_STYLE_ARG, | |
263 | "--gmapsupp", | |
264 | ||
265 | "--family-id=101", | |
266 | "--product-id=1", | |
267 | "--family-name=tst family1", | |
268 | "--series-name=tst series1", | |
269 | Args.TEST_RESOURCE_IMG + "63240001.img", | |
270 | Args.TEST_RESOURCE_IMG + "63240002.img" | |
271 | }); | |
240 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
241 | "--gmapsupp", | |
242 | "--family-id=101", | |
243 | "--product-id=1", | |
244 | "--family-name=tst family1", | |
245 | "--series-name=tst series1", | |
246 | Args.TEST_RESOURCE_IMG + "63240001.img", | |
247 | Args.TEST_RESOURCE_IMG + "63240002.img"); | |
272 | 248 | |
273 | 249 | MpsFileReader reader = getMpsFile(); |
274 | 250 | assertEquals("number of map blocks", 2, reader.getMaps().size()); |
278 | 254 | @Test |
279 | 255 | public void testWithIndex() throws IOException { |
280 | 256 | new File("osmmap_mdr.img").delete(); |
281 | Main.mainNoSystemExit(new String[]{ | |
282 | Args.TEST_STYLE_ARG, | |
257 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
283 | 258 | "--gmapsupp", |
284 | 259 | "--index", |
285 | 260 | "--latin1", |
286 | ||
287 | 261 | "--family-id=101", |
288 | 262 | "--product-id=1", |
289 | 263 | "--family-name=tst family1", |
290 | 264 | "--series-name=tst series1", |
291 | 265 | Args.TEST_RESOURCE_IMG + "63240001.img", |
292 | Args.TEST_RESOURCE_IMG + "63240002.img" | |
293 | }); | |
266 | Args.TEST_RESOURCE_IMG + "63240002.img"); | |
294 | 267 | |
295 | 268 | assertFalse(new File("osmmap_mdr.img").exists()); |
296 | 269 | |
314 | 287 | public void testWithTwoIndexes() throws IOException { |
315 | 288 | TestUtils.registerFile("osmmap_mdr.img", "osmmap.img", "osmmap.tbd", "osmmap.mdx"); |
316 | 289 | |
317 | Main.mainNoSystemExit(new String[]{ | |
318 | Args.TEST_STYLE_ARG, | |
290 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
319 | 291 | "--gmapsupp", |
320 | 292 | "--index", |
321 | 293 | "--tdbfile", |
322 | 294 | "--latin1", |
323 | ||
324 | 295 | "--family-id=101", |
325 | 296 | "--product-id=1", |
326 | 297 | "--family-name=tst family1", |
327 | 298 | "--series-name=tst series1", |
328 | 299 | Args.TEST_RESOURCE_IMG + "63240001.img", |
329 | Args.TEST_RESOURCE_IMG + "63240002.img" | |
330 | }); | |
300 | Args.TEST_RESOURCE_IMG + "63240002.img"); | |
331 | 301 | |
332 | 302 | assertTrue(new File("osmmap_mdr.img").exists()); |
333 | 303 | |
354 | 324 | public void testTwoFamilyIndex() throws IOException { |
355 | 325 | TestUtils.registerFile("osmmap_mdr.img", "osmmap.img", "osmmap.tbd", "osmmap.mdx"); |
356 | 326 | |
357 | Main.mainNoSystemExit(new String[]{ | |
358 | Args.TEST_STYLE_ARG, | |
327 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, | |
359 | 328 | "--gmapsupp", |
360 | 329 | "--index", |
361 | 330 | "--latin1", |
362 | ||
363 | 331 | "--family-id=101", |
364 | 332 | "--product-id=1", |
365 | 333 | "--family-name=tst family1", |
368 | 336 | "--family-id=202", |
369 | 337 | "--family-name=tst family2", |
370 | 338 | "--series-name=tst series2", |
371 | Args.TEST_RESOURCE_OSM + "uk-test-2.osm.gz" | |
372 | }); | |
339 | Args.TEST_RESOURCE_OSM + "uk-test-2.osm.gz"); | |
373 | 340 | |
374 | 341 | assertFalse(new File("osmmap_mdr.img").exists()); |
375 | 342 | |
406 | 373 | public void testImplicitCodePageIndex() throws IOException { |
407 | 374 | TestUtils.registerFile("osmmap_mdr.img", "osmmap.img", "osmmap.tbd", "osmmap.mdx"); |
408 | 375 | |
409 | Main.mainNoSystemExit(new String[]{ | |
410 | Args.TEST_STYLE_ARG, | |
411 | "--code-page=1256", | |
412 | ||
413 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz", | |
414 | }); | |
415 | ||
416 | Main.mainNoSystemExit(new String[]{ | |
417 | Args.TEST_STYLE_ARG, | |
418 | "--gmapsupp", | |
419 | "--index", | |
420 | ||
421 | "63240001.img", | |
422 | }); | |
376 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, "--code-page=1256", | |
377 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz"); | |
378 | ||
379 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, "--gmapsupp", "--index", "63240001.img"); | |
423 | 380 | |
424 | 381 | assertFalse(new File("osmmap_mdr.img").exists()); |
425 | 382 | |
441 | 398 | public void testWarningOnMismatchedCodePages() throws IOException { |
442 | 399 | TestUtils.registerFile("osmmap.img"); |
443 | 400 | |
444 | Main.mainNoSystemExit(new String[]{ | |
445 | Args.TEST_STYLE_ARG, | |
446 | "--route", | |
447 | "--code-page=1256", | |
401 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, "--route", "--code-page=1256", | |
448 | 402 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz", |
449 | ||
450 | 403 | "--latin1", |
451 | Args.TEST_RESOURCE_OSM + "uk-test-2.osm.gz", | |
452 | }); | |
404 | Args.TEST_RESOURCE_OSM + "uk-test-2.osm.gz"); | |
453 | 405 | |
454 | 406 | Outputs outputs = TestUtils.run(Args.TEST_STYLE_ARG, |
455 | 407 | "--gmapsupp", |
464 | 416 | |
465 | 417 | private MpsFileReader getMpsFile() throws IOException { |
466 | 418 | FileSystem fs = openFs(GMAPSUPP_IMG); |
467 | MpsFileReader reader = new MpsFileReader(fs.open("MAKEGMAP.MPS", "r")); | |
419 | MpsFileReader reader = new MpsFileReader(fs.open("MAKEGMAP.MPS", "r"), 0); | |
468 | 420 | TestUtils.registerFile(reader); |
469 | 421 | return reader; |
470 | 422 | } |
35 | 35 | */ |
36 | 36 | @Test |
37 | 37 | public void testBasic() throws IOException { |
38 | Main.mainNoSystemExit(new String[]{ | |
39 | Args.TEST_STYLE_ARG, | |
40 | "--tdbfile", | |
38 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, "--tdbfile", | |
41 | 39 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz", |
42 | Args.TEST_RESOURCE_OSM + "uk-test-2.osm.gz" | |
43 | }); | |
40 | Args.TEST_RESOURCE_OSM + "uk-test-2.osm.gz"); | |
44 | 41 | |
45 | 42 | File f = new File(TDBNAME); |
46 | 43 | assertTrue("TDB was created", f.exists()); |
57 | 54 | public void testOptions() { |
58 | 55 | int thisMapname = 11112222; |
59 | 56 | TestUtils.registerFile(thisMapname + ".img", thisMapname + ".tdb"); |
60 | Main.mainNoSystemExit(new String[]{ | |
61 | Args.TEST_STYLE_ARG, | |
62 | "--tdbfile", | |
63 | "--overview-mapname=" + thisMapname, | |
64 | "--family-id=198", | |
65 | "--product-id=2", | |
66 | "--series-name=Test series", | |
67 | "--family-name=Test family", | |
68 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz" | |
69 | }); | |
57 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, "--tdbfile", "--overview-mapname=" + thisMapname, "--family-id=198", "--product-id=2", "--series-name=Test series", "--family-name=Test family", Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz"); | |
70 | 58 | |
71 | 59 | File f = new File(thisMapname + ".tdb"); |
72 | 60 | assertTrue("TDB was created", f.exists()); |
35 | 35 | */ |
36 | 36 | @Test |
37 | 37 | public void testSize() throws FileNotFoundException { |
38 | Main.mainNoSystemExit(new String[]{ | |
39 | Args.TEST_STYLE_ARG, | |
40 | "--preserve-element-order", | |
41 | "--route", | |
42 | Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz", | |
43 | Args.TEST_RESOURCE_MP + "test1.mp" | |
44 | }); | |
38 | Main.mainNoSystemExit(Args.TEST_STYLE_ARG, "--preserve-element-order", | |
39 | "--route", Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz", Args.TEST_RESOURCE_MP + "test1.mp"); | |
45 | 40 | |
46 | 41 | FileSystem fs = openFs(Args.DEF_MAP_ID + ".img"); |
47 | 42 | assertNotNull("file exists", fs); |
62 | 57 | count++; |
63 | 58 | System.out.println("TRE size " + size); |
64 | 59 | // Size varies depending on svn modified status |
65 | assertThat("TRE size", size, new RangeMatcher(1454, 2)); | |
60 | assertThat("TRE size", size, new RangeMatcher(1455, 2)); | |
66 | 61 | break; |
67 | 62 | case "LBL": |
68 | 63 | count++; |
99 | 94 | count++; |
100 | 95 | System.out.println("TRE size " + size); |
101 | 96 | // Size varies depending on svn modified status |
102 | assertThat("TRE size", size, new RangeMatcher(769, 2)); | |
97 | assertThat("TRE size", size, new RangeMatcher(770, 2)); | |
103 | 98 | break; |
104 | 99 | case "LBL": |
105 | 100 | count++; |
32 | 32 | @Test |
33 | 33 | public void testAllElements() { |
34 | 34 | checkNoStdFile(); |
35 | Main.mainNoSystemExit(new String[]{ | |
36 | "test-map:all-elements" | |
37 | }); | |
35 | Main.mainNoSystemExit("test-map:all-elements"); | |
38 | 36 | checkStdFile(); |
39 | 37 | } |
40 | 38 | |
43 | 41 | */ |
44 | 42 | @Test |
45 | 43 | public void testAllPoints() { |
46 | Main.mainNoSystemExit(new String[]{ | |
47 | "test-map:test-points" | |
48 | }); | |
44 | Main.mainNoSystemExit("test-map:test-points"); | |
49 | 45 | checkStdFile(); |
50 | 46 | } |
51 | 47 | } |