Codebase list mkgmap / upstream/0.0.0+svn3741
Imported Upstream version 0.0.0+svn3741 Bas Couwenberg 7 years ago
57 changed file(s) with 1210 addition(s) and 849 deletion(s). Raw diff Collapse all Expand all
2929 <w>garmin's</w>
3030 <w>gawron</w>
3131 <w>geofabrik</w>
32 <w>gmapi</w>
3233 <w>gmapsupp</w>
3334 <w>gpsmapedit</w>
3435 <w>gtype</w>
00 <component name="InspectionProjectProfileManager">
11 <profile version="1.0" is_locked="true">
22 <option name="myName" value="Mapping" />
3 <option name="myLocal" value="false" />
43 <inspection_tool class="AbsoluteAlignmentInUserInterface" enabled="false" level="WARNING" enabled_by_default="false" />
54 <inspection_tool class="AbstractBeanReferencesInspection" enabled="true" level="ERROR" enabled_by_default="true" />
65 <inspection_tool class="AbstractClassExtendsConcreteClass" enabled="false" level="WARNING" enabled_by_default="false" />
2827 <inspection_tool class="AndroidDomInspection" enabled="true" level="ERROR" enabled_by_default="true" />
2928 <inspection_tool class="AndroidElementNotAllowed" enabled="false" level="WARNING" enabled_by_default="false" />
3029 <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" />
3131 <inspection_tool class="AndroidKLintAlwaysShowAction" enabled="false" level="WARNING" enabled_by_default="true" />
3232 <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" />
3336 <inspection_tool class="AndroidKLintCommitPrefEdits" enabled="false" level="WARNING" enabled_by_default="true" />
3437 <inspection_tool class="AndroidKLintCommitTransaction" enabled="false" level="WARNING" enabled_by_default="true" />
3538 <inspection_tool class="AndroidKLintCustomViewStyleable" enabled="false" level="WARNING" enabled_by_default="true" />
3639 <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" />
3741 <inspection_tool class="AndroidKLintDrawAllocation" enabled="false" level="WARNING" enabled_by_default="true" />
3842 <inspection_tool class="AndroidKLintEasterEgg" enabled="false" level="WARNING" enabled_by_default="false" />
3943 <inspection_tool class="AndroidKLintExportedContentProvider" enabled="false" level="WARNING" enabled_by_default="true" />
4044 <inspection_tool class="AndroidKLintExportedPreferenceActivity" enabled="false" level="WARNING" enabled_by_default="true" />
4145 <inspection_tool class="AndroidKLintExportedReceiver" enabled="false" level="WARNING" enabled_by_default="true" />
4246 <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" />
4348 <inspection_tool class="AndroidKLintGetInstance" enabled="false" level="WARNING" enabled_by_default="true" />
4449 <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" />
4553 <inspection_tool class="AndroidKLintGrantAllUris" enabled="false" level="WARNING" enabled_by_default="true" />
4654 <inspection_tool class="AndroidKLintHandlerLeak" enabled="false" level="WARNING" enabled_by_default="true" />
4755 <inspection_tool class="AndroidKLintIconColors" enabled="false" level="WARNING" enabled_by_default="true" />
6068 <inspection_tool class="AndroidKLintInconsistentLayout" enabled="false" level="WARNING" enabled_by_default="true" />
6169 <inspection_tool class="AndroidKLintInflateParams" enabled="false" level="WARNING" enabled_by_default="true" />
6270 <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" />
6372 <inspection_tool class="AndroidKLintJavascriptInterface" enabled="false" level="ERROR" enabled_by_default="true" />
6473 <inspection_tool class="AndroidKLintLocalSuppress" enabled="false" level="ERROR" enabled_by_default="true" />
6574 <inspection_tool class="AndroidKLintLogConditional" enabled="false" level="WARNING" enabled_by_default="false" />
6675 <inspection_tool class="AndroidKLintLogTagMismatch" enabled="false" level="ERROR" enabled_by_default="true" />
6776 <inspection_tool class="AndroidKLintLongLogTag" enabled="false" level="ERROR" enabled_by_default="true" />
6877 <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" />
6981 <inspection_tool class="AndroidKLintMissingSuperCall" enabled="false" level="ERROR" enabled_by_default="true" />
7082 <inspection_tool class="AndroidKLintNewApi" enabled="false" level="ERROR" enabled_by_default="true" />
7183 <inspection_tool class="AndroidKLintOverdraw" enabled="false" level="WARNING" enabled_by_default="true" />
7284 <inspection_tool class="AndroidKLintOverride" enabled="false" level="ERROR" enabled_by_default="true" />
7385 <inspection_tool class="AndroidKLintOverrideAbstract" enabled="false" level="ERROR" enabled_by_default="true" />
7486 <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" />
7588 <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" />
7690 <inspection_tool class="AndroidKLintPluralsCandidate" enabled="false" level="WARNING" enabled_by_default="true" />
7791 <inspection_tool class="AndroidKLintPrivateResource" enabled="false" level="WARNING" enabled_by_default="true" />
7892 <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" />
7995 <inspection_tool class="AndroidKLintRequiredSize" enabled="false" level="ERROR" enabled_by_default="true" />
8096 <inspection_tool class="AndroidKLintRtlCompat" enabled="false" level="ERROR" enabled_by_default="true" />
8197 <inspection_tool class="AndroidKLintRtlEnabled" enabled="false" level="WARNING" enabled_by_default="true" />
8298 <inspection_tool class="AndroidKLintRtlHardcoded" enabled="false" level="WARNING" enabled_by_default="true" />
8399 <inspection_tool class="AndroidKLintRtlSymmetry" enabled="false" level="WARNING" enabled_by_default="true" />
84100 <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" />
85103 <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" />
86105 <inspection_tool class="AndroidKLintServiceCast" enabled="false" level="ERROR" enabled_by_default="true" />
87106 <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" />
88111 <inspection_tool class="AndroidKLintShortAlarm" enabled="false" level="WARNING" enabled_by_default="true" />
89112 <inspection_tool class="AndroidKLintShowToast" enabled="false" level="WARNING" enabled_by_default="true" />
90113 <inspection_tool class="AndroidKLintSimpleDateFormat" enabled="false" level="WARNING" enabled_by_default="true" />
92115 <inspection_tool class="AndroidKLintStringFormatCount" enabled="false" level="WARNING" enabled_by_default="true" />
93116 <inspection_tool class="AndroidKLintStringFormatInvalid" enabled="false" level="ERROR" enabled_by_default="true" />
94117 <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" />
95119 <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" />
96123 <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" />
97129 <inspection_tool class="AndroidKLintUnusedIds" enabled="false" level="WARNING" enabled_by_default="false" />
98130 <inspection_tool class="AndroidKLintUnusedResources" enabled="false" level="WARNING" enabled_by_default="true" />
99131 <inspection_tool class="AndroidKLintUseSparseArrays" enabled="false" level="WARNING" enabled_by_default="true" />
101133 <inspection_tool class="AndroidKLintValidFragment" enabled="false" level="ERROR" enabled_by_default="true" />
102134 <inspection_tool class="AndroidKLintViewConstructor" enabled="false" level="WARNING" enabled_by_default="true" />
103135 <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" />
104137 <inspection_tool class="AndroidKLintWorldReadableFiles" enabled="false" level="WARNING" enabled_by_default="true" />
105138 <inspection_tool class="AndroidKLintWorldWriteableFiles" enabled="false" level="WARNING" enabled_by_default="true" />
106139 <inspection_tool class="AndroidKLintWrongCall" enabled="false" level="ERROR" enabled_by_default="true" />
119152 <inspection_tool class="AndroidLintAppLinksAutoVerifyError" enabled="false" level="ERROR" enabled_by_default="false" />
120153 <inspection_tool class="AndroidLintAppLinksAutoVerifyWarning" enabled="false" level="WARNING" enabled_by_default="false" />
121154 <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" />
122156 <inspection_tool class="AndroidLintBackButton" enabled="false" level="WARNING" enabled_by_default="false" />
123157 <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" />
124159 <inspection_tool class="AndroidLintButtonCase" enabled="false" level="WARNING" enabled_by_default="false" />
125160 <inspection_tool class="AndroidLintButtonOrder" enabled="false" level="WARNING" enabled_by_default="false" />
126161 <inspection_tool class="AndroidLintButtonStyle" enabled="false" level="WARNING" enabled_by_default="true" />
173208 <inspection_tool class="AndroidLintHandlerLeak" enabled="false" level="WARNING" enabled_by_default="true" />
174209 <inspection_tool class="AndroidLintHardcodedDebugMode" enabled="false" level="WARNING" enabled_by_default="false" />
175210 <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" />
176212 <inspection_tool class="AndroidLintIconColors" enabled="false" level="WARNING" enabled_by_default="true" />
177213 <inspection_tool class="AndroidLintIconDensities" enabled="false" level="WARNING" enabled_by_default="false" />
178214 <inspection_tool class="AndroidLintIconDipSize" enabled="false" level="WARNING" enabled_by_default="false" />
214250 <inspection_tool class="AndroidLintMergeRootFrame" enabled="false" level="WARNING" enabled_by_default="false" />
215251 <inspection_tool class="AndroidLintMipmapIcons" enabled="false" level="WARNING" enabled_by_default="true" />
216252 <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" />
217254 <inspection_tool class="AndroidLintMissingId" enabled="false" level="WARNING" enabled_by_default="true" />
218255 <inspection_tool class="AndroidLintMissingIntentFilterForMediaSearch" enabled="false" level="ERROR" enabled_by_default="true" />
219256 <inspection_tool class="AndroidLintMissingLeanbackLauncher" enabled="false" level="ERROR" enabled_by_default="true" />
246283 <inspection_tool class="AndroidLintPackagedPrivateKey" enabled="false" level="WARNING" enabled_by_default="true" />
247284 <inspection_tool class="AndroidLintParcelClassLoader" enabled="false" level="WARNING" enabled_by_default="true" />
248285 <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" />
249287 <inspection_tool class="AndroidLintPermissionImpliesUnsupportedHardware" enabled="false" level="WARNING" enabled_by_default="true" />
250288 <inspection_tool class="AndroidLintPluralsCandidate" enabled="false" level="WARNING" enabled_by_default="true" />
251289 <inspection_tool class="AndroidLintPrivateResource" enabled="false" level="ERROR" enabled_by_default="false" />
291329 <inspection_tool class="AndroidLintSpUsage" enabled="false" level="WARNING" enabled_by_default="true" />
292330 <inspection_tool class="AndroidLintSparseArray" enabled="false" level="WARNING" enabled_by_default="false" />
293331 <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" />
294333 <inspection_tool class="AndroidLintStopShip" enabled="false" level="WARNING" enabled_by_default="false" />
295334 <inspection_tool class="AndroidLintStringFormatCount" enabled="true" level="WARNING" enabled_by_default="true" />
296335 <inspection_tool class="AndroidLintStringFormatInvalid" enabled="true" level="ERROR" enabled_by_default="true" />
297336 <inspection_tool class="AndroidLintStringFormatMatches" enabled="true" level="ERROR" enabled_by_default="true" />
298337 <inspection_tool class="AndroidLintStringShouldBeInt" enabled="false" level="ERROR" enabled_by_default="true" />
299338 <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" />
300340 <inspection_tool class="AndroidLintSuspicious0dp" enabled="false" level="ERROR" enabled_by_default="true" />
301341 <inspection_tool class="AndroidLintSuspiciousImport" enabled="false" level="WARNING" enabled_by_default="false" />
302342 <inspection_tool class="AndroidLintSwitchIntDef" enabled="false" level="WARNING" enabled_by_default="true" />
336376 <inspection_tool class="AndroidLintUsingHttp" enabled="false" level="WARNING" enabled_by_default="true" />
337377 <inspection_tool class="AndroidLintValidFragment" enabled="false" level="ERROR" enabled_by_default="true" />
338378 <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" />
339380 <inspection_tool class="AndroidLintVectorRaster" enabled="false" level="WARNING" enabled_by_default="true" />
340381 <inspection_tool class="AndroidLintViewConstructor" enabled="false" level="WARNING" enabled_by_default="true" />
341382 <inspection_tool class="AndroidLintViewHolder" enabled="false" level="WARNING" enabled_by_default="true" />
342383 <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" />
343385 <inspection_tool class="AndroidLintWebViewLayout" enabled="false" level="ERROR" enabled_by_default="true" />
344386 <inspection_tool class="AndroidLintWorldReadableFiles" enabled="false" level="WARNING" enabled_by_default="true" />
345387 <inspection_tool class="AndroidLintWorldWriteableFiles" enabled="false" level="WARNING" enabled_by_default="false" />
368410 </inspection_tool>
369411 <inspection_tool class="AnonymousClassVariableHidesContainingMethodVariable" enabled="false" level="WARNING" enabled_by_default="false" />
370412 <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" />
371414 <inspection_tool class="AnonymousInnerClass" enabled="false" level="WARNING" enabled_by_default="false" />
372415 <inspection_tool class="AnonymousInnerClassMayBeStatic" enabled="false" level="WARNING" enabled_by_default="false" />
373416 <inspection_tool class="AntDuplicateTargetsInspection" enabled="true" level="ERROR" enabled_by_default="true" />
381424 <inspection_tool class="ArgNamesErrorsInspection" enabled="true" level="ERROR" enabled_by_default="true" />
382425 <inspection_tool class="ArgNamesWarningsInspection" enabled="true" level="WARNING" enabled_by_default="true" />
383426 <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" />
384428 <inspection_tool class="ArrayEquality" enabled="true" level="WARNING" enabled_by_default="true" />
385429 <inspection_tool class="ArrayEquals" enabled="true" level="WARNING" enabled_by_default="true" />
386430 <inspection_tool class="ArrayHashCode" enabled="true" level="WARNING" enabled_by_default="true" />
387431 <inspection_tool class="ArrayInDataClass" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
388432 <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" />
390434 <inspection_tool class="ArraysAsListWithZeroOrOneArgument" enabled="false" level="WARNING" enabled_by_default="false" />
391435 <inspection_tool class="AssertAsName" enabled="false" level="WARNING" enabled_by_default="false" />
392436 <inspection_tool class="AssertEqualsBetweenInconvertibleTypes" enabled="true" level="WARNING" enabled_by_default="true" />
396440 <inspection_tool class="AssertMessageNotString" enabled="false" level="WARNING" enabled_by_default="false" />
397441 <inspection_tool class="AssertStatement" enabled="false" level="WARNING" enabled_by_default="false" />
398442 <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" />
399444 <inspection_tool class="AssertsWithoutMessages" enabled="false" level="WARNING" enabled_by_default="false" />
400445 <inspection_tool class="AssertsWithoutMessagesTestNG" enabled="false" level="WARNING" enabled_by_default="false" />
401446 <inspection_tool class="AssignmentResultUsedJS" enabled="false" level="WARNING" enabled_by_default="false" />
419464 <inspection_tool class="AssignmentToStaticFieldFromInstanceMethod" enabled="false" level="WARNING" enabled_by_default="false" />
420465 <inspection_tool class="AssignmentToSuperclassField" enabled="false" level="WARNING" enabled_by_default="false" />
421466 <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" />
424469 <inspection_tool class="AutoBoxing" enabled="false" level="INFO" enabled_by_default="false">
425470 <option name="ignoreAddedToCollection" value="false" />
426471 </inspection_tool>
462507 <inspection_tool class="BlockMarkerComments" enabled="false" level="WARNING" enabled_by_default="false" />
463508 <inspection_tool class="BlockStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
464509 <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" />
466511 <inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
467512 <inspection_tool class="BooleanMethodNameMustStartWithQuestion" enabled="false" level="WARNING" enabled_by_default="false">
468513 <option name="ignoreBooleanMethods" value="false" />
631676 <inspection_tool class="CloneableImplementsClone" enabled="true" level="WARNING" enabled_by_default="true">
632677 <option name="m_ignoreCloneableDueToInheritance" value="true" />
633678 </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" />
635680 <inspection_tool class="CollectionAddAllCanBeReplacedWithConstructor" enabled="false" level="WARNING" enabled_by_default="false" />
636681 <inspection_tool class="CollectionAddedToSelf" enabled="false" level="WARNING" enabled_by_default="false" />
637682 <inspection_tool class="CollectionContainsUrl" enabled="false" level="WARNING" enabled_by_default="false" />
640685 <inspection_tool class="CommaExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
641686 <inspection_tool class="CommandLineInspection" enabled="false" level="WARNING" enabled_by_default="true" />
642687 <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" />
643689 <inspection_tool class="ComparatorMethodParameterNotUsed" enabled="true" level="WARNING" enabled_by_default="true" />
644690 <inspection_tool class="ComparatorNotSerializable" enabled="false" level="WARNING" enabled_by_default="false" />
645691 <inspection_tool class="CompareToUsesNonFinalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
710756 <inspection_tool class="ControlFlowStatementWithoutBraces" enabled="false" level="WARNING" enabled_by_default="false" />
711757 <inspection_tool class="Convert2Diamond" enabled="true" level="WARNING" enabled_by_default="true" />
712758 <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" />
715761 <inspection_tool class="ConvertAnnotations" enabled="false" level="WARNING" enabled_by_default="false" />
716762 <inspection_tool class="ConvertJavadoc" enabled="false" level="WARNING" enabled_by_default="false" />
717763 <inspection_tool class="ConvertLambdaToReference" enabled="false" level="INFO" enabled_by_default="true" />
718764 <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" />
719766 <inspection_tool class="ConvertToStringTemplate" enabled="false" level="INFO" enabled_by_default="true" />
720767 <inspection_tool class="CovariantCompareTo" enabled="false" level="WARNING" enabled_by_default="false" />
721768 <inspection_tool class="CovariantEquals" enabled="false" level="WARNING" enabled_by_default="false" />
761808 </inspection_tool>
762809 <inspection_tool class="CssUnknownTarget" enabled="false" level="ERROR" enabled_by_default="true" />
763810 <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" />
764812 <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" />
765814 <inspection_tool class="CssUnusedSymbol" enabled="false" level="WARNING" enabled_by_default="true" />
766815 <inspection_tool class="CssUnusedSymbolInspection" enabled="true" level="WARNING" enabled_by_default="true" />
767816 <inspection_tool class="CucumberExamplesColon" enabled="false" level="ERROR" enabled_by_default="false" />
800849 <inspection_tool class="DeprecatedCallableAddReplaceWith" enabled="false" level="INFO" enabled_by_default="true" />
801850 <inspection_tool class="DeprecatedClassUsageInspection" enabled="false" level="WARNING" enabled_by_default="false" />
802851 <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" />
803853 <inspection_tool class="DeprecatedObjectInstanceFieldReference" enabled="false" level="WARNING" enabled_by_default="true" />
804854 <inspection_tool class="DeprecatedUsageOfStaticField" enabled="false" level="WARNING" enabled_by_default="true" />
805855 <inspection_tool class="Deprecation" enabled="true" level="WARNING" enabled_by_default="true" />
806856 <inspection_tool class="DeserializableClassInSecureContext" enabled="false" level="WARNING" enabled_by_default="false" />
807857 <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" />
808859 <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" />
809861 <inspection_tool class="DifferentKotlinGradleVersion" enabled="false" level="WARNING" enabled_by_default="true" />
810862 <inspection_tool class="DifferentStdlibGradleVersion" enabled="false" level="WARNING" enabled_by_default="true" />
811863 <inspection_tool class="DisjointPackage" enabled="false" level="WARNING" enabled_by_default="false" />
864916 <inspection_tool class="ELSpecValidationInJSP" enabled="true" level="WARNING" enabled_by_default="true" />
865917 <inspection_tool class="ELValidationInJSP" enabled="true" level="WARNING" enabled_by_default="true" />
866918 <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" />
867920 <inspection_tool class="ES6ConvertVarToLetConst" enabled="false" level="WARNING" enabled_by_default="false" />
868921 <inspection_tool class="ES6ModulesDependencies" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
869922 <inspection_tool class="ES6UnusedImports" enabled="false" level="WARNING" enabled_by_default="true" />
933986 </inspection_tool>
934987 <inspection_tool class="EnumerationCanBeIteration" enabled="false" level="WARNING" enabled_by_default="false" />
935988 <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" />
936990 <inspection_tool class="EqualsAndHashcode" enabled="false" level="WARNING" enabled_by_default="false" />
937991 <inspection_tool class="EqualsBetweenInconvertibleTypes" enabled="true" level="WARNING" enabled_by_default="true" />
938992 <inspection_tool class="EqualsCalledOnEnumConstant" enabled="false" level="WARNING" enabled_by_default="false" />
939993 <inspection_tool class="EqualsHashCodeCalledOnUrl" enabled="false" level="WARNING" enabled_by_default="false" />
940994 <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" />
942996 <inspection_tool class="EqualsUsesNonFinalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
943997 <inspection_tool class="EqualsWhichDoesntCheckParameterClass" enabled="true" level="WARNING" enabled_by_default="true" />
944998 <inspection_tool class="EqualsWithItself" enabled="false" level="WARNING" enabled_by_default="true" />
10211075 <inspection_tool class="FlexUnitMixedAPIInspection" enabled="false" level="WARNING" enabled_by_default="false" />
10221076 <inspection_tool class="FlexUnitSuiteWithNoRunnerInspection" enabled="false" level="WARNING" enabled_by_default="false" />
10231077 <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" />
10241083 <inspection_tool class="ForCanBeForeach" enabled="true" level="WARNING" enabled_by_default="true">
10251084 <option name="REPORT_INDEXED_LOOP" value="true" />
10261085 <option name="ignoreUntypedCollections" value="false" />
10671126 <inspection_tool class="GrMethodMayBeStatic" enabled="false" level="WARNING" enabled_by_default="true" />
10681127 <inspection_tool class="GrPackage" enabled="false" level="WARNING" enabled_by_default="true" />
10691128 <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" />
10701132 <inspection_tool class="GrUnresolvedAccess" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
10711133 <inspection_tool class="GroovyAccessToStaticFieldLockedOnInstance" enabled="false" level="WARNING" enabled_by_default="false" />
10721134 <inspection_tool class="GroovyAccessibility" enabled="false" level="WARNING" enabled_by_default="false" />
12471309 <inspection_tool class="GspInspection" enabled="false" level="WARNING" enabled_by_default="false" />
12481310 <inspection_tool class="GspPropertiesInspection" enabled="false" level="ERROR" enabled_by_default="false" />
12491311 <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" />
12511313 <inspection_tool class="GuavaFluentIterable" enabled="false" level="WARNING" enabled_by_default="false" />
12521314 <inspection_tool class="GwtClientClassFromNonInheritedModule" enabled="true" level="ERROR" enabled_by_default="true" />
12531315 <inspection_tool class="GwtCssResourceErrors" enabled="true" level="ERROR" enabled_by_default="true" />
13261388 <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" />
13271389 <option name="insideTryAllowed" value="false" />
13281390 </inspection_tool>
1391 <inspection_tool class="IfCanBeAssertion" enabled="false" level="INFORMATION" enabled_by_default="false" />
13291392 <inspection_tool class="IfCanBeSwitch" enabled="true" level="WARNING" enabled_by_default="true">
13301393 <option name="minimumBranches" value="3" />
13311394 <option name="suggestIntSwitches" value="false" />
14351498 <inspection_tool class="IntentionDescriptionNotFoundInspection" enabled="false" level="WARNING" enabled_by_default="false" />
14361499 <inspection_tool class="InterceptionAnnotationWithoutRuntimeRetention" enabled="false" level="WARNING" enabled_by_default="false" />
14371500 <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" />
14391502 <inspection_tool class="InterfaceNamingConvention" enabled="false" level="WARNING" enabled_by_default="false">
14401503 <option name="m_regex" value="[A-Z][A-Za-z\d]*" />
14411504 <option name="m_minLength" value="8" />
14461509 </inspection_tool>
14471510 <inspection_tool class="InterfaceWithOnlyOneDirectInheritor" enabled="false" level="WARNING" enabled_by_default="false" />
14481511 <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" />
14491513 <inspection_tool class="InvalidImplementedBy" enabled="false" level="WARNING" enabled_by_default="false" />
14501514 <inspection_tool class="InvalidProvidedBy" enabled="false" level="WARNING" enabled_by_default="false" />
14511515 <inspection_tool class="InvalidRequestParameters" enabled="false" level="WARNING" enabled_by_default="false" />
14761540 <inspection_tool class="JSFieldCanBeLocal" enabled="false" level="WARNING" enabled_by_default="false" />
14771541 <inspection_tool class="JSFieldCanBeLocalInspection" enabled="false" level="WARNING" enabled_by_default="false" />
14781542 <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" />
14791544 <inspection_tool class="JSHint" enabled="false" level="ERROR" enabled_by_default="false" />
14801545 <inspection_tool class="JSImplicitlyInternalDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
14811546 <inspection_tool class="JSJQueryEfficiency" enabled="false" level="WARNING" enabled_by_default="false" />
15061571 <inspection_tool class="JSPrimitiveTypeWrapperUsage" enabled="false" level="WARNING" enabled_by_default="false" />
15071572 <inspection_tool class="JSReferencingArgumentsOutsideOfFunction" enabled="false" level="ERROR" enabled_by_default="true" />
15081573 <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" />
15091575 <inspection_tool class="JSSuspiciousNameCombination" enabled="false" level="WARNING" enabled_by_default="false">
15101576 <group names="x,width,left,right" />
15111577 <group names="y,height,top,bottom" />
15491615 <option name="m_maxLength" value="64" />
15501616 </inspection_tool>
15511617 <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" />
15531622 <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
15541623 <option name="TOP_LEVEL_CLASS_OPTIONS">
15551624 <value>
16251694 <inspection_tool class="KotlinUnusedImport" enabled="false" level="WARNING" enabled_by_default="true" />
16261695 <inspection_tool class="LabeledStatement" enabled="false" level="WARNING" enabled_by_default="false" />
16271696 <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" />
16281699 <inspection_tool class="LambdaParameterHidingMemberVariable" enabled="false" level="WARNING" enabled_by_default="false" />
16291700 <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" />
16311703 <inspection_tool class="LanguageMismatch" enabled="true" level="WARNING" enabled_by_default="true">
16321704 <option name="CHECK_NON_ANNOTATED_REFERENCES" value="true" />
16331705 </inspection_tool>
16831755 </inspection_tool>
16841756 <inspection_tool class="LoopStatementThatDoesntLoopJS" enabled="true" level="WARNING" enabled_by_default="true" />
16851757 <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" />
16861759 <inspection_tool class="LoopWithImplicitTerminationCondition" enabled="false" level="WARNING" enabled_by_default="false" />
16871760 <inspection_tool class="LossyEncoding" enabled="false" level="WARNING" enabled_by_default="false" />
16881761 <inspection_tool class="MVCPathVariableInspection" enabled="false" level="WARNING" enabled_by_default="false" />
16931766 <inspection_tool class="MakoArgumentListInspection" enabled="false" level="WARNING" enabled_by_default="false" />
16941767 <inspection_tool class="MalformedFormatString" enabled="true" level="WARNING" enabled_by_default="true" />
16951768 <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" />
16961770 <inspection_tool class="MalformedXPath" enabled="true" level="WARNING" enabled_by_default="true" />
16971771 <inspection_tool class="ManagedBeanClassInspection" enabled="true" level="ERROR" enabled_by_default="true" />
16981772 <inspection_tool class="ManualArrayCopy" enabled="true" level="WARNING" enabled_by_default="true" />
17031777 <inspection_tool class="MavenDuplicateDependenciesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
17041778 <inspection_tool class="MavenModelInspection" enabled="false" level="ERROR" enabled_by_default="false" />
17051779 <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">
17071781 <option name="ignoreByteAndShortArrayParameters" value="true" />
1782 <option name="ignoreOverridingMethods" value="true" />
17081783 </inspection_tool>
17091784 <inspection_tool class="MethodCount" enabled="false" level="WARNING" enabled_by_default="false">
17101785 <option name="m_limit" value="20" />
17341809 <inspection_tool class="MethodOverridesPackageLocalMethod" enabled="false" level="WARNING" enabled_by_default="false" />
17351810 <inspection_tool class="MethodOverridesPrivateMethod" enabled="false" level="WARNING" enabled_by_default="false" />
17361811 <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" />
17371813 <inspection_tool class="MethodReturnAlwaysConstant" enabled="false" level="WARNING" enabled_by_default="false" />
17381814 <inspection_tool class="MethodReturnOfConcreteClass" enabled="false" level="WARNING" enabled_by_default="false" />
17391815 <inspection_tool class="MethodWithMultipleLoops" enabled="false" level="WARNING" enabled_by_default="false" />
17691845 <inspection_tool class="MisspelledEquals" enabled="false" level="WARNING" enabled_by_default="false" />
17701846 <inspection_tool class="MisspelledHashcode" enabled="false" level="WARNING" enabled_by_default="false" />
17711847 <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" />
17721849 <inspection_tool class="MisspelledSetUp" enabled="false" level="WARNING" enabled_by_default="false" />
17731850 <inspection_tool class="MisspelledTearDown" enabled="false" level="WARNING" enabled_by_default="false" />
17741851 <inspection_tool class="MisspelledToString" enabled="false" level="WARNING" enabled_by_default="false" />
17781855 <inspection_tool class="ModuleWithTooManyClasses" enabled="false" level="WARNING" enabled_by_default="false">
17791856 <option name="limit" value="100" />
17801857 </inspection_tool>
1858 <inspection_tool class="MultiCatchCanBeSplit" enabled="false" level="INFORMATION" enabled_by_default="false" />
17811859 <inspection_tool class="MultipleBindingAnnotations" enabled="false" level="WARNING" enabled_by_default="false" />
17821860 <inspection_tool class="MultipleDeclaration" enabled="false" level="WARNING" enabled_by_default="false">
17831861 <option name="ignoreForLoopDeclarations" value="true" />
19272005 <inspection_tool class="OneButtonGroup" enabled="true" level="WARNING" enabled_by_default="true" />
19282006 <inspection_tool class="OneWayWebMethod" enabled="false" level="ERROR" enabled_by_default="false" />
19292007 <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" />
19322011 <inspection_tool class="OrredNotEqualExpression" enabled="true" level="WARNING" enabled_by_default="true" />
19332012 <inspection_tool class="OverloadedMethodsWithSameNumberOfParameters" enabled="false" level="WARNING" enabled_by_default="false">
19342013 <option name="ignoreInconvertibleTypes" value="true" />
19502029 <inspection_tool class="OverlyLargePrimitiveArrayInitializer" enabled="false" level="WARNING" enabled_by_default="false">
19512030 <option name="m_limit" value="64" />
19522031 </inspection_tool>
2032 <inspection_tool class="OverlyLongLambda" enabled="false" level="WARNING" enabled_by_default="false" />
19532033 <inspection_tool class="OverlyStrongTypeCast" enabled="false" level="WARNING" enabled_by_default="false">
19542034 <option name="ignoreInMatchingInstanceof" value="false" />
19552035 </inspection_tool>
21362216 <inspection_tool class="PyDictDuplicateKeysInspection" enabled="true" level="WARNING" enabled_by_default="true" />
21372217 <inspection_tool class="PyDocstringInspection" enabled="false" level="WARNING" enabled_by_default="false" />
21382218 <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" />
21392220 <inspection_tool class="PyExceptClausesOrderInspection" enabled="true" level="WARNING" enabled_by_default="true" />
21402221 <inspection_tool class="PyExceptionInheritInspection" enabled="true" level="WARNING" enabled_by_default="true" />
21412222 <inspection_tool class="PyFromFutureImportInspection" enabled="true" level="WARNING" enabled_by_default="true" />
22212302 </inspection_tool>
22222303 <inspection_tool class="RSReferenceInspection" enabled="false" level="WARNING" enabled_by_default="true" />
22232304 <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" />
22242306 <inspection_tool class="RawUseOfParameterizedType" enabled="true" level="WARNING" enabled_by_default="true">
22252307 <option name="ignoreTypeCasts" value="true" />
22262308 </inspection_tool>
22332315 <inspection_tool class="RedundantFieldInitialization" enabled="true" level="WARNING" enabled_by_default="true">
22342316 <option name="onlyWarnOnNull" value="true" />
22352317 </inspection_tool>
2318 <inspection_tool class="RedundantIf" enabled="false" level="WARNING" enabled_by_default="false" />
22362319 <inspection_tool class="RedundantImplements" enabled="false" level="WARNING" enabled_by_default="false">
22372320 <option name="ignoreSerializable" value="false" />
22382321 <option name="ignoreCloneable" value="false" />
22392322 </inspection_tool>
22402323 <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" />
22412325 <inspection_tool class="RedundantMethodOverride" enabled="false" level="WARNING" enabled_by_default="false" />
22422326 <inspection_tool class="RedundantModalityModifier" enabled="false" level="WARNING" enabled_by_default="true" />
22432327 <inspection_tool class="RedundantSamConstructor" enabled="false" level="WARNING" enabled_by_default="true" />
22612345 </inspection_tool>
22622346 <inspection_tool class="RemoveAtFromAnnotationArgument" enabled="false" level="WARNING" enabled_by_default="true" />
22632347 <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" />
22642350 <inspection_tool class="RemoveExplicitSuperQualifier" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
22652351 <inspection_tool class="RemoveExplicitTypeArguments" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
22662352 <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" />
22672354 <inspection_tool class="RemoveSetterParameterType" enabled="false" level="WARNING" enabled_by_default="true" />
22682355 <inspection_tool class="RemoveSingleExpressionStringTemplate" enabled="false" level="WARNING" enabled_by_default="true" />
22692356 <inspection_tool class="RemoveToStringInStringTemplate" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
22702357 <inspection_tool class="RemoveUnnecessaryLateinit" enabled="false" level="WARNING" enabled_by_default="true" />
22712358 <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" />
22722360 <inspection_tool class="ReplaceAssignmentWithOperatorAssignment" enabled="true" level="WARNING" enabled_by_default="true">
22732361 <option name="ignoreLazyOperators" value="true" />
22742362 <option name="ignoreObscureOperators" value="false" />
22762364 <inspection_tool class="ReplaceAssignmentWithOperatorAssignmentJS" enabled="false" level="WARNING" enabled_by_default="false" />
22772365 <inspection_tool class="ReplaceCallWithComparison" enabled="false" level="WARNING" enabled_by_default="true" />
22782366 <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" />
22792371 <inspection_tool class="ReplaceWithOperatorAssignment" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
22802372 <inspection_tool class="RequiredArtifactTypeInspection" enabled="false" level="ERROR" enabled_by_default="true" />
22812373 <inspection_tool class="RequiredAttributes" enabled="true" level="WARNING" enabled_by_default="true">
23082400 </inspection_tool>
23092401 <inspection_tool class="ReturnOfDateField" enabled="false" level="WARNING" enabled_by_default="false" />
23102402 <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" />
23112404 <inspection_tool class="ReturnThis" enabled="false" level="WARNING" enabled_by_default="false" />
23122405 <inspection_tool class="ReuseOfLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
23132406 <inspection_tool class="ReuseOfLocalVariableJS" enabled="false" level="WARNING" enabled_by_default="false" />
23152408 <inspection_tool class="RuntimeExecWithNonConstantString" enabled="false" level="WARNING" enabled_by_default="false" />
23162409 <inspection_tool class="SSBasedInspection" enabled="false" level="WARNING" enabled_by_default="false" />
23172410 <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" />
23192412 <inspection_tool class="SamePackageImport" enabled="true" level="WARNING" enabled_by_default="true" />
23202413 <inspection_tool class="SameParameterValue" enabled="false" level="WARNING" enabled_by_default="false" />
23212414 <inspection_tool class="SameReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
23892482 <inspection_tool class="Since15" enabled="false" level="ERROR" enabled_by_default="false" />
23902483 <inspection_tool class="SingleCharacterStartsWith" enabled="false" level="WARNING" enabled_by_default="false" />
23912484 <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" />
23922487 <inspection_tool class="Singleton" enabled="false" level="WARNING" enabled_by_default="false" />
23932488 <inspection_tool class="SingletonInjectsScoped" enabled="false" level="WARNING" enabled_by_default="false" />
23942489 <inspection_tool class="SizeReplaceableByIsEmpty" enabled="true" level="WARNING" enabled_by_default="true" />
24702565 <inspection_tool class="SqlShouldBeInGroupByInspection" enabled="false" level="WARNING" enabled_by_default="false" />
24712566 <inspection_tool class="SqlSignatureInspection" enabled="false" level="WARNING" enabled_by_default="true" />
24722567 <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" />
24732569 <inspection_tool class="StandardVariableNames" enabled="false" level="WARNING" enabled_by_default="false" />
24742570 <inspection_tool class="StatefulEp" enabled="false" level="WARNING" enabled_by_default="true" />
24752571 <inspection_tool class="StatementsPerFunctionJS" enabled="false" level="WARNING" enabled_by_default="false">
25512647 <inspection_tool class="StrutsValidatorFormInspection" enabled="false" level="ERROR" enabled_by_default="false" />
25522648 <inspection_tool class="StrutsValidatorInspection" enabled="false" level="ERROR" enabled_by_default="false" />
25532649 <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" />
25542651 <inspection_tool class="SubstringZero" enabled="true" level="WARNING" enabled_by_default="true" />
25552652 <inspection_tool class="SubtractionInCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
25562653 <inspection_tool class="SuperClassHasFrequentlyUsedInheritors" enabled="false" level="WARNING" enabled_by_default="false" />
25852682 <inspection_tool class="SwitchStatementsWithoutDefault" enabled="false" level="WARNING" enabled_by_default="false">
25862683 <option name="m_ignoreFullyCoveredEnums" value="true" />
25872684 </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" />
25892686 <inspection_tool class="SynchronizationOnLocalVariableOrMethodParameter" enabled="true" level="WARNING" enabled_by_default="true">
25902687 <option name="reportLocalVariables" value="true" />
25912688 <option name="reportMethodParameters" value="true" />
26512748 <inspection_tool class="ThrowFromFinallyBlock" enabled="true" level="WARNING" enabled_by_default="true" />
26522749 <inspection_tool class="ThrowFromFinallyBlockJS" enabled="true" level="WARNING" enabled_by_default="true" />
26532750 <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" />
26542752 <inspection_tool class="ThrowablePrintStackTrace" enabled="false" level="WARNING" enabled_by_default="false" />
26552753 <inspection_tool class="ThrowablePrintedToSystemOut" enabled="false" level="WARNING" enabled_by_default="false" />
26562754 <inspection_tool class="ThrowableResultOfMethodCallIgnored" enabled="true" level="WARNING" enabled_by_default="true" />
26792777 <inspection_tool class="TrivialMethodReference" enabled="false" level="WARNING" enabled_by_default="true" />
26802778 <inspection_tool class="TrivialStringConcatenation" enabled="false" level="WARNING" enabled_by_default="false" />
26812779 <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" />
26822781 <inspection_tool class="TryWithIdenticalCatches" enabled="true" level="WARNING" enabled_by_default="true" />
26832782 <inspection_tool class="TsLint" enabled="false" level="ERROR" enabled_by_default="false" />
26842783 <inspection_tool class="TypeCustomizer" enabled="false" level="WARNING" enabled_by_default="true" />
26982797 </inspection_tool>
26992798 <inspection_tool class="TypeScriptAccessibilityCheck" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
27002799 <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" />
27012801 <inspection_tool class="TypeScriptUnresolvedFunction" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
27022802 <inspection_tool class="TypeScriptUnresolvedVariable" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
27032803 <inspection_tool class="TypeScriptValidateJSTypes" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
27532853 <inspection_tool class="UnnecessaryContinue" enabled="true" level="WARNING" enabled_by_default="true" />
27542854 <inspection_tool class="UnnecessaryContinueJS" enabled="true" level="WARNING" enabled_by_default="true" />
27552855 <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" />
27562857 <inspection_tool class="UnnecessaryEnumModifier" enabled="false" level="WARNING" enabled_by_default="false" />
27572858 <inspection_tool class="UnnecessaryExplicitNumericCast" enabled="true" level="WARNING" enabled_by_default="true" />
27582859 <inspection_tool class="UnnecessaryFinalOnLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
27642865 <option name="m_ignoreJavadoc" value="false" />
27652866 </inspection_tool>
27662867 <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" />
27682869 <inspection_tool class="UnnecessaryInterfaceModifier" enabled="false" level="WARNING" enabled_by_default="false" />
27692870 <inspection_tool class="UnnecessaryJavaDocLink" enabled="true" level="WARNING" enabled_by_default="true">
27702871 <option name="ignoreInlineLinkToSuper" value="false" />
28222923 <inspection_tool class="UnresolvedMessageChannelWarningInspection" enabled="false" level="WARNING" enabled_by_default="false" />
28232924 <inspection_tool class="UnresolvedPropertyKey" enabled="true" level="ERROR" enabled_by_default="true" />
28242925 <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" />
28252927 <inspection_tool class="UnsafeReturnStatementVisitor" enabled="false" level="WARNING" enabled_by_default="true" />
28262928 <inspection_tool class="UnsafeVfsRecursion" enabled="false" level="WARNING" enabled_by_default="false" />
28272929 <inspection_tool class="UnsecureRandomNumberGeneration" enabled="false" level="WARNING" enabled_by_default="false" />
28752977 <inspection_tool class="UsePrimitiveTypes" enabled="false" level="WARNING" enabled_by_default="true" />
28762978 <inspection_tool class="UsePropertyAccessSyntax" enabled="false" level="WEAK WARNING" enabled_by_default="true" />
28772979 <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" />
28782981 <inspection_tool class="UtilSchemaInspection" enabled="true" level="ERROR" enabled_by_default="true" />
28792982 <inspection_tool class="UtilityClass" enabled="false" level="WARNING" enabled_by_default="false">
28802983 <option name="ignorableAnnotations">
29103013 <inspection_tool class="WaitCalledOnCondition" enabled="false" level="WARNING" enabled_by_default="false" />
29113014 <inspection_tool class="WaitNotInLoop" enabled="false" level="WARNING" enabled_by_default="false" />
29123015 <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" />
29133017 <inspection_tool class="WaitOrAwaitWithoutTimeout" enabled="false" level="WARNING" enabled_by_default="false" />
29143018 <inspection_tool class="WaitWhileHoldingTwoLocks" enabled="false" level="WARNING" enabled_by_default="false" />
29153019 <inspection_tool class="WaitWithoutCorrespondingNotify" enabled="false" level="WARNING" enabled_by_default="false" />
29393043 <inspection_tool class="XmlUnboundNsPrefix" enabled="false" level="WARNING" enabled_by_default="false" />
29403044 <inspection_tool class="XmlUnusedNamespaceDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
29413045 <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" />
29423047 <inspection_tool class="XmlWrongRootElement" enabled="true" level="ERROR" enabled_by_default="true" />
29433048 <inspection_tool class="XsltDeclarations" enabled="true" level="ERROR" enabled_by_default="true" />
29443049 <inspection_tool class="XsltTemplateInvocation" enabled="true" level="ERROR" enabled_by_default="true" />
00 <?xml version="1.0" encoding="UTF-8"?>
11 <project version="4">
22 <component name="EntryPointsManager">
3 <entry_points version="2.0" />
43 <list size="5">
54 <item index="0" class="java.lang.String" itemvalue="org.junit.After" />
65 <item index="1" class="java.lang.String" itemvalue="org.junit.AfterClass" />
7271 <component name="ProjectResources">
7372 <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
7473 </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">
7675 <output url="file://$PROJECT_DIR$/build/classes" />
7776 </component>
7877 <component name="SvnBranchConfigurationManager">
6060 rm -f gmapsupp.img 632*.img
6161 if [ -d 63240001 ]; then rmdir 6324000?; fi
6262 rm -f 11112222.img 11112222.tdb
63 rm -rf *.gmapi *.gmap
6364 rm -f osmmap*
6465 rm -f ovm_*.img
6566 rm -f g?.img
2121 device in USB mass storage mode). It can be used on ready
2222 compiled img files, if the input files are not already compiled
2323 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.
2428
2529 -c filename
2630 --read-config=filename
3135 long name instead.
3236
3337 --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.
3741
3842 -n name
3943 --mapname=name
7377 This is equivalent to --code-page=65001. Note that only newer devices support Unicode.
7478
7579 --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.
7983
8084 It is entirely dependent on the device firmware which code pages are
8185 supported.
120124 mkgmap:phone
121125 (mkgmap:is_in - used by location-autofill=is_in)
122126
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
127131 --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!
136140
137141 --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.
163167
164168 --location-autofill=[option1,[option2]]
165169 Controls how the address fields for country, region, city and zip info
167171 mkgmap address tags (e.g. mkgmap:city - see option index).
168172 Warning: automatic assignment of address fields is somehow a best guess.
169173
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.
171175
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
173177 to assign the missing address fields. Beware that cities located
174178 in the same tile are used only. So the results close to a tile
175179 border have less quality.
176180
177181 --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
197201 to find the best match.
198
202
199203 Overview map options:
200204 --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.
203207
204208 --overview-mapnumber=8 digit number
205209 If --tdbfile is enabled, this gives the internal 8 digit
207211 number is 63240000.
208212
209213 --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.
214218
215219 --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.
221225
222226 Style options:
223227 --style-file=file
240244
241245 --style=name
242246 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.
245249
246250 --list-styles
247251 List the available styles. If this option is preceded by a style-file
249253
250254 --check-styles
251255 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.
255259
256260 --levels=levels code
257261 Change the way that the levels on the map correspond to the zoom
292296 drop-down. The default is "OSM map".
293297
294298 --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
298302 --copyright-message=note
299303 Specify a copyright message for files that do not contain one.
300304
305309
306310 --license-file=file
307311 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.
309313
310314 Optimization options:
311315
328332 Default is enabled, use --no-merge-lines to disable.
329333
330334 --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
336340 --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
346350 Miscellaneous options:
347351
348352 --max-jobs[=number]
507511 * the centre point of the biggest area
508512
509513 --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
517521
518522 --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.
525529
526530 --coastlinefile=filename[,filename]
527531 Defines a comma separated list of files that contain coastline
592596 (NSIS) to create a Windows Mapsource Installer.
593597
594598 --make-all-cycleways
595 Deprecated, use --make-opposite-cycleways instead. Former meaning:
599 Deprecated, use --make-opposite-cycleways instead. Former meaning:
596600 Turn on all of the options that make cycleways.
597601
598602 --make-opposite-cycleways
601605 the original that allows bicycle traffic (in both directions).
602606
603607 --make-cycleways
604 Now ignored, former meaning:
608 Now ignored, former meaning:
605609 Some streets have a separate cycleway track/lane just for
606610 bicycle traffic and this option makes a way with the same
607611 points as the original that allows bicycle traffic. Also,
609613 (unless that way's bicycle access has been defined).
610614
611615 --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.
628632
629633 --process-destination
630634 Splits all motorway_link, trunk_link, primary_link, secondary_link,
641645 See also --process-exits.
642646
643647 --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
647651 way into three parts.
648652 All parts are tagged with the original tags of the link.
649653 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.
658662 The first part must have type 0x08 or 0x09 so that Garmin uses the hint.
659663
660664 --delete-tags-file=FILENAME
685689 things.
686690
687691 --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
689693 already installed on the PC and therefore there is no need to read it
690694 from the device.
691695
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
77 (waterway=stream | waterway=drain) & intermittent=yes [0x10A02 resolution 22]
88
99 waterway=canal [0x1f resolution 21]
10 waterway=drain [0x1f resolution 22]
1110 waterway=river [0x1f resolution 18]
1211 waterway=rapids|waterway=waterfall [0x1f resolution 22]
13 waterway=stream [0x18 resolution 22]
12 waterway=stream | waterway=drain [0x18 resolution 22]
162162 xstart = xend;
163163 }
164164
165 // assert areas.length == xsplit * ysplit;
166165 if (nAreas == areas.length) // no problem
167166 return areas;
168167 // beware - MapSplitter.splitMaxSize requests split of 1/1 if the original area wasn't too big
169168 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;
171172 else
172173 throw new MapFailedException("Area split shift align problems");
173174 }
1515 */
1616 package uk.me.parabola.imgfmt.app;
1717
18 import java.io.ByteArrayOutputStream;
1819 import java.io.IOException;
1920 import java.nio.ByteBuffer;
2021
171172 }
172173
173174 /**
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.
176178 * @throws ReadFailedException For failures.
177179 */
178 public String getZString() throws ReadFailedException {
179 StringBuffer sb = new StringBuffer();
180 public byte[] getZString() throws ReadFailedException {
181 ByteArrayOutputStream out = new ByteArrayOutputStream();
180182
181183 // Slow but sure implementation.
182184 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();
186188 }
187189
188190 /**
9595 * @return A string
9696 * @throws ReadFailedException For failures.
9797 */
98 public String getZString() throws ReadFailedException;
98 public byte[] getZString() throws ReadFailedException;
9999
100100 /**
101101 * Read in a string of digits in the compressed base 11 format that is used
3939 return encoder;
4040 }
4141
42 protected void setDecoder(CharacterDecoder decoder) {
42 private void setDecoder(CharacterDecoder decoder) {
4343 this.decoder = decoder;
4444 }
4545
5151 return encodingType;
5252 }
5353
54 protected void setEncodingType(int encodingType) {
54 private void setEncodingType(int encodingType) {
5555 this.encodingType = encodingType;
5656 }
5757
7676 funcs.setEncodingType(ENCODING_FORMAT6);
7777 funcs.setEncoder(new Format6Encoder());
7878 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);
7985 break;
8086 case "cp1252":
8187 case "latin1":
4949
5050 private CharacterEncoder textEncoder = CodeFunctions.getDefaultEncoder();
5151
52 private final Map<EncodedText, Label> labelCache = new HashMap<EncodedText, Label>();
52 private final Map<EncodedText, Label> labelCache = new HashMap<>();
5353
5454 private final LBLHeader lblHeader = new LBLHeader();
5555
223223 public int numZips() {
224224 return places.numZips();
225225 }
226
227 public int getCodePage() {
228 return lblHeader.getCodePage();
229 }
226230 }
1717 import java.util.List;
1818 import java.util.Map;
1919
20 import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
2021 import uk.me.parabola.imgfmt.app.BufferedImgFileReader;
2122 import uk.me.parabola.imgfmt.app.ImgFile;
2223 import uk.me.parabola.imgfmt.app.ImgFileReader;
4748
4849 private final LBLHeader header = new LBLHeader();
4950
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<>();
5253 private final List<Country> countries = new ArrayList<>();
5354 private final List<Region> regions = new ArrayList<>();
54 private final Map<Integer, Zip> zips = new HashMap<>();
55 private final Int2ObjectOpenHashMap<Zip> zips = new Int2ObjectOpenHashMap<>();
5556 private final List<City> cities = new ArrayList<>();
5657
5758 public LBLFileReader(ImgChannel chan) {
2222 import uk.me.parabola.imgfmt.app.Area;
2323 import uk.me.parabola.imgfmt.app.ImgFile;
2424 import uk.me.parabola.imgfmt.app.Label;
25 import uk.me.parabola.imgfmt.app.labelenc.CodeFunctions;
2526 import uk.me.parabola.imgfmt.app.lbl.LBLFile;
2627 import uk.me.parabola.imgfmt.app.net.NETFile;
2728 import uk.me.parabola.imgfmt.app.net.NODFile;
114115 }
115116
116117 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)){
119120 try {
120121 if (props.containsKey("route")) {
121122 addNet();
130131 treFile.config(props);
131132 }
132133
133 protected void addNet() throws FileExistsException {
134 private void addNet() throws FileExistsException {
134135 netFile = new NETFile(fileSystem.create(mapName + ".NET"));
135136 }
136137
137 protected void addNod() throws FileExistsException {
138 private void addNod() throws FileExistsException {
138139 nodFile = new NODFile(fileSystem.create(mapName + ".NOD"), true);
139140 }
140141
158159
159160 /**
160161 * 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));
167173 }
168174
169175 /**
2020 import java.util.Iterator;
2121 import java.util.List;
2222
23 import uk.me.parabola.imgfmt.Utils;
2423 import uk.me.parabola.imgfmt.app.Area;
2524 import uk.me.parabola.imgfmt.app.BufferedImgFileWriter;
2625 import uk.me.parabola.imgfmt.app.ImgFile;
2726 import uk.me.parabola.imgfmt.app.ImgFileWriter;
2827 import uk.me.parabola.imgfmt.app.Label;
28 import uk.me.parabola.imgfmt.app.labelenc.EncodedText;
2929 import uk.me.parabola.imgfmt.fs.ImgChannel;
3030 import uk.me.parabola.log.Logger;
3131 import uk.me.parabola.util.Configurable;
4949 // private List<Zoom> mapLevels = new ArrayList<Zoom>();
5050 private final Zoom[] mapLevels = new Zoom[16];
5151
52 private final List<Label> copyrights = new ArrayList<Label>();
52 private final List<Label> copyrights = new ArrayList<>();
5353
5454 // Information about polylines. eg roads etc.
5555 private final List<PolylineOverview> polylineOverviews = new ArrayList<PolylineOverview>();
8181 * Add a string to the 'mapinfo' section. This is a section between the
8282 * header and the start of the data. Nothing points to it directly.
8383 *
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();
8988 if (position() != header.getHeaderLength() + header.getMapInfoSize())
9089 throw new IllegalStateException("All info must be added before anything else");
9190
92 header.setMapInfoSize(header.getMapInfoSize() + (val.length+1));
91 header.setMapInfoSize(header.getMapInfoSize() + enc.getLength() + 1);
9392 getWriter().put(val);
9493 getWriter().put((byte) 0);
9594 }
2020 import uk.me.parabola.imgfmt.app.ImgReader;
2121 import uk.me.parabola.imgfmt.app.Label;
2222 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;
2326 import uk.me.parabola.imgfmt.app.lbl.LBLFileReader;
2427 import uk.me.parabola.imgfmt.fs.ImgChannel;
2528 import uk.me.parabola.util.EnhancedProperties;
195198 header.config(props);
196199 }
197200
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();
201204
202205 // First do the ones in the TRE header gap
203206 ImgFileReader reader = getReader();
204207 reader.position(header.getHeaderLength());
208 List<String> msgs = new ArrayList<>();
205209 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);
208220 }
209221
210222
214226 public String[] getCopyrights(LBLFileReader lblReader) {
215227 Section sect = header.getCopyrightSection();
216228 ImgFileReader reader = getReader();
217 List<String> msgs = new ArrayList<String>();
229 List<String> msgs = new ArrayList<>();
218230
219231 long pos = sect.getPosition();
220232 while (pos < sect.getEndPos()) {
+0
-78
src/uk/me/parabola/imgfmt/mps/Block.java less more
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 }
2323 *
2424 * @author Steve Ratcliffe
2525 */
26 public class MapBlock extends Block {
26 public class MapBlock extends MpsBlock {
2727 private static final int BLOCK_TYPE = 0x4c;
2828
2929 private int familyId;
3535 private String mapDescription;
3636 private String areaName;
3737
38 public MapBlock() {
39 super(BLOCK_TYPE);
38 public MapBlock(int codePage) {
39 super(BLOCK_TYPE, codePage);
4040 }
4141
4242 protected void writeBody(StructuredOutputStream out) throws IOException {
2424 *
2525 * @author Steve Ratcliffe
2626 */
27 public class MapsetBlock extends Block {
27 public class MapsetBlock extends MpsBlock {
2828 private static final int BLOCK_TYPE = 0x56;
2929
3030 private String name = "OSM map set";
3131
3232 public MapsetBlock() {
33 super(BLOCK_TYPE);
33 super(BLOCK_TYPE, 0);
3434 }
3535
3636 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 }
1616 package uk.me.parabola.imgfmt.mps;
1717
1818 import java.io.IOException;
19 import java.io.OutputStream;
20 import java.nio.channels.Channels;
1921 import java.util.ArrayList;
2022 import java.util.HashSet;
2123 import java.util.List;
3537 public class MpsFile {
3638 private String mapsetName = "OSM map set";
3739
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<>();
4042
4143 private final ImgChannel chan;
4244
4547 }
4648
4749 public void sync() throws IOException {
50 OutputStream os = Channels.newOutputStream(chan);
4851 for (MapBlock map : maps)
49 map.write(chan);
52 map.writeTo(os, map.getCodePage());
5053
5154 for (ProductBlock block : products)
52 block.write(chan);
55 block.writeTo(os, block.getCodePage());
5356
5457 MapsetBlock mapset = new MapsetBlock();
5558 mapset.setName(mapsetName);
56 mapset.write(chan);
59 mapset.writeTo(os, mapset.getCodePage());
5760 }
5861
5962 public void addMap(MapBlock map) {
2222
2323 import uk.me.parabola.imgfmt.app.BufferedImgFileReader;
2424 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;
2527 import uk.me.parabola.imgfmt.fs.ImgChannel;
2628
2729 /**
3537 */
3638 public class MpsFileReader implements Closeable {
3739
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<>();
4042
4143 private final ImgChannel chan;
4244 private final ImgFileReader reader;
45 private final CharacterDecoder decoder;
46 private final int codePage;
4347
44 public MpsFileReader(ImgChannel chan) {
48 public MpsFileReader(ImgChannel chan, int codePage) {
4549 this.chan = chan;
4650 this.reader = new BufferedImgFileReader(chan);
51
52 this.codePage = codePage;
53 CodeFunctions funcs = CodeFunctions.createEncoderForLBL(0, codePage);
54 decoder = funcs.getDecoder();
4755
4856 readBlocks();
4957 }
6977 }
7078
7179 private void readMapBlock() {
72 MapBlock block = new MapBlock();
80 MapBlock block = new MapBlock(codePage);
7381 int val = reader.getInt();
7482 block.setIds(val >>> 16, val & 0xffff);
7583 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()));
7989 block.setHexNumber(reader.getInt());
8090 reader.getInt();
8191 maps.add(block);
8292 }
8393
8494 private void readProductBlock() {
85 ProductBlock block = new ProductBlock();
95 ProductBlock block = new ProductBlock(codePage);
8696 block.setProductId(reader.getChar());
8797 block.setFamilyId(reader.getChar());
88 block.setDescription(reader.getZString());
98 block.setDescription(decodeToString(reader.getZString()));
8999 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();
90108 }
91109
92110 public List<MapBlock> getMaps() {
2525 *
2626 * @author Steve Ratcliffe
2727 */
28 public class ProductBlock extends Block {
28 public class ProductBlock extends MpsBlock {
2929 private static final int BLOCK_TYPE = 0x46;
3030
3131 private int familyId;
3232 private int productId;
3333 private String description = "OSM maps";
3434
35 public ProductBlock() {
36 super(BLOCK_TYPE);
35 public ProductBlock(int codePage) {
36 super(BLOCK_TYPE, codePage);
3737 }
3838
3939 protected void writeBody(StructuredOutputStream out) throws IOException {
1818 import java.io.IOException;
1919 import java.nio.ByteBuffer;
2020 import java.nio.ByteOrder;
21 import java.util.Arrays;
2122 import java.util.Calendar;
2223 import java.util.Date;
2324
2425 import uk.me.parabola.imgfmt.FileSystemParam;
2526 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;
2630 import uk.me.parabola.imgfmt.fs.ImgChannel;
2731 import uk.me.parabola.log.Logger;
2832
304308
305309 /**
306310 * 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 *
307314 * @param desc The description.
308315 */
309316 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;
311324 if (len > 50)
312325 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 }
320340 }
321341
322342 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);
326344
327345 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);
331347
332348 header.put((byte) 0); // really?
333349 }
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 }
1515 */
1616 package uk.me.parabola.io;
1717
18 import java.io.FilterOutputStream;
1819 import java.io.IOException;
1920 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;
2127
2228 /**
2329 * An output stream that has methods for writing strings and little endian
2632 * @author Steve Ratcliffe
2733 */
2834 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) {
3139 super(out);
40 this.encoder = encoder;
3241 }
3342
3443 public void write(int b) throws IOException {
6271 * @throws IOException If the write fails.
6372 */
6473 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");
6876
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());
7082 }
7183 }
3333 import uk.me.parabola.mkgmap.filters.MapFilterChain;
3434 import uk.me.parabola.mkgmap.filters.PolygonSplitterFilter;
3535 import uk.me.parabola.mkgmap.filters.PolygonSubdivSizeSplitterFilter;
36 import uk.me.parabola.mkgmap.filters.ShapeMergeFilter;
3637 import uk.me.parabola.mkgmap.general.MapDataSource;
3738 import uk.me.parabola.mkgmap.general.MapElement;
3839 import uk.me.parabola.mkgmap.general.MapLine;
622623 * @param dy30 The size of each division (y direction)
623624 * @return The index to areas where the map element fits.
624625 */
625 private int pickArea(MapArea[] areas, MapElement e,
626 private static int pickArea(MapArea[] areas, MapElement e,
626627 int xbase30, int ybase30,
627628 int nx, int ny,
628629 int dx30, int dy30)
732733 areasHashMap.put(hashVal, co);
733734 }
734735 }
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
735746 if (signedAreaSize == 0) {
736 log.warn("splitIntoAreas flat shape. id", e.getOsmid(),
747 log.warn("splitIntoAreas creates single point shape. id", e.getOsmid(),
737748 "type", uk.me.parabola.mkgmap.reader.osm.GType.formatType(e.getType()), subSize,
738749 "points, at", subShape.get(0).toOSMURL());
739750 continue;
1515 import java.io.BufferedReader;
1616 import java.io.File;
1717 import java.io.FileNotFoundException;
18 import java.io.FileReader;
1918 import java.io.IOException;
19 import java.nio.charset.Charset;
20 import java.nio.file.Files;
2021 import java.util.ArrayList;
2122 import java.util.Arrays;
2223 import java.util.Collections;
2526 import java.util.IdentityHashMap;
2627 import java.util.List;
2728 import java.util.Set;
28
29 import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
3029
3130 import uk.me.parabola.imgfmt.ExitException;
3231 import uk.me.parabola.imgfmt.Utils;
9493 import uk.me.parabola.util.Configurable;
9594 import uk.me.parabola.util.EnhancedProperties;
9695
96 import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
97
9798 /**
9899 * This is the core of the code to translate from the general representation
99100 * into the garmin representation.
134135
135136 private int minSizePolygon;
136137 private String polygonSizeLimitsOpt;
137 private HashMap<Integer,Integer> polygonSizeLimits = null;
138 private HashMap<Integer,Integer> polygonSizeLimits;
138139 private double reducePointError;
139140 private double reducePointErrorPolygon;
140141 private boolean mergeLines;
820821
821822 /**
822823 * 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() {
828826 if (licenseFileName != null) {
829827 File file = new File(licenseFileName);
830828
831829 try {
832 BufferedReader reader = new BufferedReader(new FileReader(file));
830 BufferedReader reader = Files.newBufferedReader(file.toPath(), Charset.forName("utf-8"));
833831 String text;
834832
835833 // repeat until all lines is read
880878 * @param map The map to write to.
881879 * @param src The source of map information.
882880 */
883 protected void processInfo(Map map, LoadableMapDataSource src) {
881 private void processInfo(Map map, LoadableMapDataSource src) {
884882 // The bounds of the map.
885883 map.setBounds(src.getBounds());
886884
1616 package uk.me.parabola.mkgmap.build;
1717
1818 import java.util.ArrayList;
19 import java.util.Collections;
1920 import java.util.List;
2021
2122 import uk.me.parabola.imgfmt.app.Area;
9899 log.debug("orig area", mapSource.getBounds());
99100
100101 MapArea ma = initialArea(mapSource);
102 MapArea[] origArea = {ma};
101103 MapArea[] areas = splitMaxSize(ma, orderByDecreasingArea);
104 if (areas == null) {
105 log.warn("initial split returned null for ",ma);
106 return origArea;
107 }
102108
103109 // Now step through each area and see if any have too many map features
104110 // in them. For those that do, we further split them. This is done
105111 // recursively until everything fits.
106112 List<MapArea> alist = new ArrayList<>();
107113 addAreasToList(areas, alist, 0, orderByDecreasingArea);
114 if (alist.isEmpty()) {
115 return origArea;
116 }
108117
109118 MapArea[] results = new MapArea[alist.size()];
110119 return alist.toArray(results);
136145 ", lines = " + area.getNumLines() + "/" + sizes[MapArea.LINE_KIND] +
137146 ", shapes = " + area.getNumShapes() + "/" + sizes[MapArea.SHAPE_KIND]);
138147 }
139 boolean doSplit = false;
140
148 boolean wantSplit = false;
149 boolean mustSplit = false;
141150 if (area.getNumLines() > MAX_NUM_LINES ||
142151 area.getNumPoints() > MAX_NUM_POINTS ||
143152 (sizes[MapArea.POINT_KIND] +
146155 sizes[MapArea.XT_POINT_KIND] > MAX_XT_POINTS_SIZE ||
147156 sizes[MapArea.XT_LINE_KIND] > MAX_XT_LINES_SIZE ||
148157 sizes[MapArea.XT_SHAPE_KIND] > MAX_XT_SHAPES_SIZE)
149 doSplit = true; // we must split
158 mustSplit = true; // we must split
150159 else if (bounds.getMaxDimension() > MIN_DIMENSION) {
151160 int sumSize = 0;
152161 for (int s : sizes)
155164 if (area.getLines().size() + area.getShapes().size() >= 2) {
156165 // area has more bytes than wanted, and we can split
157166 log.debug("splitting area because size is larger than wanted: " + sumSize);
158 doSplit = true;
167 wantSplit = true;
159168 }
160169 }
161170 }
162 if (doSplit){
171 if (wantSplit || mustSplit){
163172 if (bounds.getMaxDimension() > MIN_DIMENSION) {
164173 if (log.isDebugEnabled())
165174 log.debug("splitting area", area);
169178 else
170179 sublist = area.split(1, 2, res, bounds, orderByDecreasingArea);
171180 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 }
174188 } else {
175189 addAreasToList(sublist, alist, depth + 1, orderByDecreasingArea);
176190 continue;
4747 */
4848 public void onFinish();
4949
50 public default String getFilename() {
51 return null;
52 }
5053 }
209209 * @throws FileNotFoundException If the file doesn't exist.
210210 */
211211 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)) {
215214 FileSystemParam params = imgFs.fsparam();
216215 log.info("Desc", params.getMapDescription());
217216 log.info("Blocksize", params.getBlockSize());
236235 info.setMapname(name);
237236
238237 boolean hasTre = false;
238 DirectoryEntry treEnt = null;
239
239240 List<DirectoryEntry> entries = imgFs.list();
240241 for (DirectoryEntry ent : entries) {
241242 if (ent.isSpecial())
248249 info.setTresize(ent.getSize());
249250 info.setInnername(ent.getName());
250251
251 treInfo(imgFs, ent, info);
252252 hasTre = true;
253 treEnt = ent;
253254 } else if ("RGN".equals(ext)) {
254255 int size = ent.getSize();
255256 info.setRgnsize(size);
272273 info.fileSizes.add(ent.getSize());
273274 }
274275
276 if (hasTre)
277 treInfo(imgFs, treEnt, info);
278
275279 if (info.getKind() == UNKNOWN_KIND && hasTre)
276280 info.setKind(IMG_KIND);
277
281
278282 return info;
279 } finally {
280 imgFs.close();
281283 }
282284 }
283285
296298
297299 info.setBounds(treFile.getBounds());
298300
299 info.setLicenceInfo(treFile.getMapInfo());
301 info.setLicenceInfo(treFile.getMapInfo(info.getCodePage()));
300302
301303 info.setHexname(((TREHeader) treFile.getHeader()).getMapId());
302304 } finally {
398400 }
399401
400402
401 protected void setLicenceInfo(String[] info) {
403 private void setLicenceInfo(String[] info) {
402404 this.licenceInfo = info;
403405 }
404406
427429 }
428430
429431 public String getFamilyName() {
430 return args.get("family-name", "family name");
432 return args.get("family-name", "OSM map");
431433 }
432434
433435 public String getSeriesName() {
489491 public boolean hasSortOrder() {
490492 return sortOrderId != 0;
491493 }
494
495 public String getOverviewName() {
496 return args.get("overview-mapname", "osmmap");
497 }
492498 }
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 }
6767 private static final int ENTRY_SIZE = 240;
6868 private static final int DIRECTORY_OFFSET_ENTRY = 2;
6969
70 private final Map<String, FileInfo> files = new LinkedHashMap<String, FileInfo>();
70 private final Map<String, FileInfo> files = new LinkedHashMap<>();
7171
7272 // all these need to be set in the init routine from arguments.
7373 private String areaName;
8080 private boolean createIndex; // True if we should create and add an index file
8181
8282 // 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<>();
8585 private boolean splitName;
8686 private boolean hideGmapsuppOnPC;
8787
230230 }
231231
232232 private MapBlock makeMapBlock(FileInfo info) {
233 MapBlock mb = new MapBlock();
233 MapBlock mb = new MapBlock(info.getCodePage());
234234 mb.setMapNumber(info.getMapnameAsInt());
235235 mb.setHexNumber(info.getHexname());
236236 mb.setMapDescription(info.getDescription());
242242 }
243243
244244 private ProductBlock makeProductBlock(FileInfo info) {
245 ProductBlock pb = new ProductBlock();
245 ProductBlock pb = new ProductBlock(info.getCodePage());
246246 pb.setFamilyId(info.getFamilyId());
247247 pb.setProductId(info.getProductId());
248248 pb.setDescription(info.getFamilyName());
281281 FileSystem fs = null;
282282 try {
283283 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());
285285 for (MapBlock block : mr.getMaps())
286286 mpsFile.addMap(block);
287287
355355 int dot = name.lastIndexOf('.');
356356
357357 String base = name.substring(0, dot);
358 String ext = name.substring(dot + 1);
359358 if (base.length() > 8)
360359 base = base.substring(0, 8);
360
361 String ext = name.substring(dot + 1);
361362 if (ext.length() > 3)
362363 ext = ext.substring(0, 3);
363364
372373 */
373374 private void addImg(FileSystem outfs, String filename) {
374375 try {
375 FileSystem infs = ImgFS.openFs(filename);
376
377 try {
376 try (FileSystem infs = ImgFS.openFs(filename)) {
378377 copyAllFiles(infs, outfs);
379 } finally {
380 infs.close();
381 }
378 }
379
382380 } catch (FileNotFoundException e) {
383381 log.error("Could not open file " + filename);
384382 }
416414 private FileSystem createGmapsupp() throws FileNotWritableException {
417415 BlockInfo bi = calcBlockSize();
418416 int blockSize = bi.blockSize;
417
419418 // Create this file, containing all the sub files
420419 FileSystemParam params = new FileSystemParam();
421420 params.setBlockSize(blockSize);
428427 params.setReservedDirectoryBlocks(reserveBlocks);
429428
430429 FileSystem outfs = ImgFS.createFs(Utils.joinPath(outputDir, GMAPSUPP), params);
431
430
432431 mpsFile = createMpsFile(outfs);
433432 mpsFile.setMapsetName(mapsetName);
434433
361361 Utils.closeFile(file);
362362 }
363363
364 public String getFilename() {
365 return outputName;
366 }
367
364368 public int getSize() {
365369 return (int) tmpName.length();
366370 }
5454 throw new ExitException("Could not create MDX file", e);
5555 }
5656 }
57
58 public String getFilename() {
59 return Utils.joinPath(outputDir, mdxFilename);
60 }
5761 }
8989 calcLevels();
9090 writeOverviewMap();
9191 }
92
92
93 @Override
94 public String getFilename() {
95 return Utils.joinPath(outputDir, overviewMapname, "img");
96 }
97
9398 private void calcLevels() {
9499 List<MapShape> shapes = overviewSource.getShapes();
95100 int maxRes = 16; // we can write a 0x4a polygon for planet in res 16
4646 private String overviewMapnumber;
4747 private String outputDir;
4848 private int tdbVersion;
49 private List<String[]> copyrightMsgs = new ArrayList<String[]>();
49 private final List<String[]> copyrightMsgs = new ArrayList<>();
5050
5151 public TdbBuilder(OverviewBuilder ovb) {
5252 overviewBuilder = ovb;
5959 *
6060 * @param args The command line arguments as they are at the end of the list.
6161 * In other words if the same argument appears more than once, then it will
62 * have the latest value set.
6263 */
6364 public void init(CommandArgs args) {
6465 overviewMapname = args.get("overview-mapname", "osmmap");
181182 writeTdbFile();
182183 }
183184
185 public String getFilename() {
186 return Utils.joinPath(outputDir, overviewMapname, "tdb");
187 }
188
184189 /**
185190 * Write out the TDB file at the end of processing.
186191 */
1414 import it.unimi.dsi.fastutil.ints.IntArrayList;
1515
1616 import java.util.ArrayList;
17 import java.util.Collections;
1718 import java.util.IdentityHashMap;
1819 import java.util.Iterator;
1920 import java.util.LinkedHashMap;
5152 if (shapes.size() <= 1)
5253 return shapes;
5354 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<>();
5657 for (MapShape shape: shapes) {
5758 if (shape.getMinResolution() > resolution || shape.getMaxResolution() < resolution)
5859 continue;
7576 continue;
7677 }
7778 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<>();
8081 list.add(sh);
8182 lowMap.put(shape, list);
8283 topMap.add(shape.getType(),lowMap);
104105 }
105106 }
106107 if (!added){
107 ArrayList<ShapeHelper> list = new ArrayList<ShapeHelper>();
108 ArrayList<ShapeHelper> list = new ArrayList<>();
108109 list.add(sh);
109110 lowMap.put(shape, list);
110111 }
156157 private List<ShapeHelper> addWithConnectedHoles(List<ShapeHelper> list,
157158 final ShapeHelper toAdd, final int type) {
158159 assert toAdd.getPoints().size() > 3;
159 List<ShapeHelper> result = new ArrayList<ShapeHelper>(list.size()+1);
160 List<ShapeHelper> result = new ArrayList<>(list.size()+1);
160161 ShapeHelper shNew = new ShapeHelper(toAdd);
161162 for (ShapeHelper shOld:list){
162163 if (shOld.getBounds().intersects(shNew.getBounds()) == false){
223224 List<Coord> merged = null;
224225 if (points1.size() + points2.size() - 2*sh1PositionsToCheck.size() < PolygonSplitterFilter.MAX_POINT_IN_ELEMENT){
225226 merged = mergeLongestSequence(points1, points2, sh1PositionsToCheck, sh2PositionsToCheck, sameDir);
227 if (merged.isEmpty())
228 return dupShape;
226229 if (merged.get(0) != merged.get(merged.size()-1))
227230 merged = null;
228231 else if (merged.size() > PolygonSplitterFilter.MAX_POINT_IN_ELEMENT){
261264 * @param s1PositionsToCheck will contain common positions in shape 1
262265 * @param s2PositionsToCheck will contain common positions in shape 2
263266 */
264 private void findCommonCoords(List<Coord> s1, List<Coord> s2,
267 private static void findCommonCoords(List<Coord> s1, List<Coord> s2,
265268 IntArrayList s1PositionsToCheck,
266269 IntArrayList s2PositionsToCheck) {
267270 Map<Coord, Integer> s2PosMap = new IdentityHashMap<>(s2.size() - 1);
311314 * @param sameDir true if both shapes are clockwise or both are ccw
312315 * @return the merged shape or null if no points are common.
313316 */
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,
315318 IntArrayList sh2PositionsToCheck, boolean sameDir) {
316319 if (sh1PositionsToCheck.isEmpty())
317320 return null;
359362 }
360363 // now merge the shapes. The longest sequence of common points is removed.
361364 // 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);
363370 int s1Pos = sh1PositionsToCheck.getInt(startOfLongestSequence+longestSequence);
364371 for (int i = 0; i < s1Size - longestSequence - 1; i++){
365372 merged.add(points1.get(s1Pos));
386393 return merged;
387394 }
388395
389 private class ShapeHelper{
396 private static class ShapeHelper{
390397 final private List<Coord> points;
391398 long id; // TODO: remove debugging aid
392399 long areaTestVal;
439446 return new Area(minLat, minLon, maxLat, maxLon);
440447 }
441448 }
442 private final static long smallArea = 1L<<6 * 1L<<6;
449 public final static long SINGLE_POINT_AREA = 1L<<6 * 1L<<6;
443450
444451 /**
445452 * Calculate the high precision area size test value.
463470 signedAreaSize += (long) (c2.getHighPrecLon() + c1.getHighPrecLon())
464471 * (c1.getHighPrecLat() - c2.getHighPrecLat());
465472 }
466 if (Math.abs(signedAreaSize) < smallArea){
473 if (Math.abs(signedAreaSize) < SINGLE_POINT_AREA){
467474 log.debug("very small shape near", points.get(0).toOSMURL(), "signed area in high prec map units:", signedAreaSize );
468475 }
469476 return signedAreaSize;
2020 import java.io.PrintStream;
2121 import java.util.ArrayList;
2222 import java.util.Arrays;
23 import java.util.Collections;
2423 import java.util.Comparator;
2524 import java.util.Date;
2625 import java.util.HashMap;
2928 import java.util.List;
3029 import java.util.Locale;
3130 import java.util.Map;
31 import java.util.Objects;
3232 import java.util.Set;
3333 import java.util.concurrent.Callable;
3434 import java.util.concurrent.ExecutionException;
4848 import uk.me.parabola.mkgmap.Version;
4949 import uk.me.parabola.mkgmap.combiners.Combiner;
5050 import uk.me.parabola.mkgmap.combiners.FileInfo;
51 import uk.me.parabola.mkgmap.combiners.GmapiBuilder;
5152 import uk.me.parabola.mkgmap.combiners.GmapsuppBuilder;
5253 import uk.me.parabola.mkgmap.combiners.MdrBuilder;
5354 import uk.me.parabola.mkgmap.combiners.MdxBuilder;
9495
9596 private volatile int programRC = 0;
9697
98 private final Map<String, Combiner> combinerMap = new HashMap<>();
99
97100 /**
98101 * Used for unit tests
99102 */
100 public static void mainNoSystemExit(String[] args) {
103 public static void mainNoSystemExit(String... args) {
101104 Main.mainStart(args);
102105 }
103106
104 public static void main(String[] args) {
107 public static void main(String... args) {
105108 int rc = Main.mainStart(args);
106109 if (rc != 0)
107110 System.exit(1);
114117 *
115118 * @param args The command line arguments.
116119 */
117 private static int mainStart(String[] args) {
120 private static int mainStart(String... args) {
118121 long start = System.currentTimeMillis();
119122 System.out.println("Time started: " + new Date());
120123 // We need at least one argument.
323326 }
324327
325328 public void removeOption(String opt) {
326 if ("tdbfile".equals(opt))
329 if (Objects.equals("tdbfile", opt))
327330 createTdbFiles = false;
328331 }
329332
336339 if (!tdbBuilderAdded ){
337340 OverviewMap overviewSource = new OverviewMapDataSource();
338341 OverviewBuilder overviewBuilder = new OverviewBuilder(overviewSource);
339 addCombiner(overviewBuilder);
342 addCombiner("img", overviewBuilder);
340343 TdbBuilder tdbBuilder = new TdbBuilder(overviewBuilder);
341 addCombiner(tdbBuilder);
344 addCombiner("tdb", tdbBuilder);
342345 tdbBuilderAdded = true;
343346 }
344347 }
394397 }
395398 int checked = 0;
396399 for (String name : names) {
397 if (styleOption != null && !name.equals(styleOption))
400 if (styleOption != null && !Objects.equals(name, styleOption))
398401 continue;
399402 if (names.length > 1){
400403 System.out.println("checking style: " + name);
401404 }
402405 ++checked;
403406 boolean performChecks = true;
404 if ("classpath:styles".equals(styleFile) && !"default".equals(name)){
407 if (Objects.equals("classpath:styles", styleFile) && !Objects.equals("default", name)){
405408 performChecks = false;
406409 }
407410 Style style = readOneStyle(name, performChecks);
445448 return "en";
446449 }
447450
448 private void addCombiner(Combiner combiner) {
451 private void addCombiner(String name, Combiner combiner) {
452 combinerMap.put(name, combiner);
449453 combiners.add(combiner);
450454 }
451455
535539 for (Combiner c : combiners)
536540 c.init(args);
537541
538 Collections.sort(filenames, new Comparator<FilenameTask>() {
542 filenames.sort(new Comparator<FilenameTask>() {
539543 public int compare(FilenameTask o1, FilenameTask o2) {
540544 if (!o1.getFilename().endsWith(".img") || !o2.getFilename().endsWith(".img"))
541545 return o1.getFilename().compareTo(o2.getFilename());
619623
620624 private void fileOptions(CommandArgs args) {
621625 boolean indexOpt = args.exists("index");
622 boolean gmapOpt = args.exists("gmapsupp");
626 boolean gmapsuppOpt = args.exists("gmapsupp");
623627 boolean tdbOpt = args.exists("tdbfile");
628 boolean gmapiOpt = args.exists("gmapi");
629
624630 if (tdbOpt || createTdbFiles){
625631 addTdbBuilder();
626632 }
627633 if (args.exists("nsis")) {
628 addCombiner(new NsisBuilder());
629 }
630 if (gmapOpt) {
634 addCombiner("nsis", new NsisBuilder());
635 }
636 if (gmapsuppOpt) {
631637 GmapsuppBuilder gmapBuilder = new GmapsuppBuilder();
632638 gmapBuilder.setCreateIndex(indexOpt);
633639
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));
640650 }
641651 }
642652
2121 import java.io.FileReader;
2222 import java.io.IOException;
2323 import java.io.InputStream;
24 import java.nio.charset.Charset;
25 import java.nio.file.Files;
2426 import java.util.ArrayList;
2527 import java.util.HashMap;
2628 import java.util.HashSet;
6466 new HousenumberHooks(),
6567 };
6668 protected OsmConverter converter;
67 private final Set<String> usedTags = new HashSet<String>();
69 private final Set<String> usedTags = new HashSet<>();
6870 protected ElementSaver elementSaver;
6971 protected OsmReadingHooks osmReadingHooks;
7072
138140 */
139141 public String[] copyrightMessages() {
140142 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<>();
145145 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
147149 String text;
148150 while ((text = reader.readLine()) != null) {
149151 copyrightArray.add(text);
385385 ioPos++; // skip terminating zero from uid
386386 --bytesToRead;
387387 }
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();
399389 long bytes = toReadStart - bytesToRead;
400390 if (bytes <= MAX_STRING_PAIR_SIZE)
401391 storeStringPair();
422412 refType = 3;
423413 stringPair[0] = REL_REF_TYPES[refType];
424414
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();
436416 long bytes = toReadStart - bytesToRead;
437417 if (bytes <= MAX_STRING_PAIR_SIZE)
438418 storeStringPair();
459439 if (stringRef == 0){
460440 long toReadStart = bytesToRead;
461441 int cnt = 0;
462 int buffPos = 0;
463 int start = 0;
464442 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();
474444 }
475445 long bytes = toReadStart - bytesToRead;
476446 if (bytes <= MAX_STRING_PAIR_SIZE)
479449 else
480450 setStringRefPair(stringRef);
481451 }
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
482468
483469 /** reset the delta values and string table */
484470 private void reset(){
+0
-121
src/uk/me/parabola/tdbfmt/Block.java less more
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 }
1515 */
1616 package uk.me.parabola.tdbfmt;
1717
18 import uk.me.parabola.io.FileBlock;
19 import uk.me.parabola.io.StructuredOutputStream;
1820 import uk.me.parabola.log.Logger;
1921 import uk.me.parabola.io.StructuredInputStream;
2022
2931 *
3032 * @author Steve Ratcliffe
3133 */
32 class CopyrightBlock {
34 class CopyrightBlock extends FileBlock {
35 public static final int BLOCK_ID = 0x44;
36
3337 private static final Logger log = Logger.getLogger(CopyrightBlock.class);
3438
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<>();
3741
3842 CopyrightBlock() {
43 super(BLOCK_ID);
3944 }
4045
41 CopyrightBlock(Block block) throws IOException {
42 StructuredInputStream ds = block.getInputStream();
46 CopyrightBlock(StructuredInputStream ds) throws IOException {
47 super(BLOCK_ID);
4348
4449 while (!ds.testEof()) {
4550 CopyrightSegment segment = new CopyrightSegment(ds);
4954 }
5055 }
5156
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 {
5361 for (CopyrightSegment seg : segments) {
54 seg.write(block);
62 seg.write(ds);
5563 }
5664 }
5765
6666 this.extraProperties = 0;
6767 }
6868
69 public void write(Block block) throws IOException {
70 StructuredOutputStream os = block.getOutputStream();
69 public void write(StructuredOutputStream os) throws IOException {
7170 os.write(copyrightCode);
7271 os.write(whereCode);
7372 os.write2(extraProperties);
2727 * @author Steve Ratcliffe
2828 */
2929 public class DetailMapBlock extends OverviewMapBlock {
30 public static final int BLOCK_ID = 0x4c;
3031
3132 private int tdbVersion;
3233
4041 private int nodDataSize;
4142
4243 public DetailMapBlock(int tdbVersion) {
44 super(BLOCK_ID);
4345 assert tdbVersion > 0;
4446 this.tdbVersion = tdbVersion;
4547 }
4648
4749 /**
4850 * Initialise this block from the raw block given.
49 * @param block The raw block read from the file.
51 *
5052 * @throws IOException For io problems.
5153 */
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);
5656
5757 // First there are a couple of fields that we ignore.
5858 int junk = ds.read2();
7474 /**
7575 * Write into the given block.
7676 *
77 * @param block The block that will have been initialised to be a detail
78 * block.
7977 * @throws IOException Problems writing, probably can't really happen as
8078 * we use an array backed stream.
8179 */
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);
8682
8783 int n = 3;
8884 if (tdbVersion >= TdbFile.TDB_V407) {
119115 }
120116 }
121117
122 public String getInnername() {
118 private String getInnername() {
123119 return innername;
124120 }
125121
1717
1818 import java.io.IOException;
1919
20 import uk.me.parabola.io.FileBlock;
2021 import uk.me.parabola.io.StructuredInputStream;
2122 import uk.me.parabola.io.StructuredOutputStream;
2223
2526 *
2627 * @author Steve Ratcliffe
2728 */
28 class HeaderBlock {
29 class HeaderBlock extends FileBlock {
30 static final int BLOCK_ID = 0x50;
2931
3032 /** The map family. */
3133 private short familyId;
5355 private int codePage;
5456
5557 HeaderBlock(int tdbVersion) {
58 super(BLOCK_ID);
5659 this.tdbVersion = tdbVersion;
5760 }
5861
59 HeaderBlock(Block block) throws IOException {
60 StructuredInputStream ds = block.getInputStream();
62 public HeaderBlock(StructuredInputStream ds) throws IOException {
63 super(BLOCK_ID);
6164
6265 productId = (short) ds.read2();
6366 familyId = (short) ds.read2();
6871 familyName = ds.readString();
6972 }
7073
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 {
7378 os.write2(productId);
7479 os.write2(familyId);
7580 os.write2(tdbVersion);
95100 os.write3(0);
96101 os.write4(codePage);
97102 os.write4(10000);
98 os.write(1); // map is routable
103 os.write(1); // map is routable
99104 if (enableProfile == 1)
100 os.write(1); // map has profile information
105 os.write(1); // map has profile information
101106 else
102107 os.write(0);
103 os.write(0); // map has DEM sub files
108 os.write(0); // map has DEM sub files
104109 }
105110 }
106111
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);
126112 public String toString() {
127113 return "TDB header: "
128114 + productId
1818 import java.io.IOException;
1919
2020 import uk.me.parabola.imgfmt.app.Area;
21 import uk.me.parabola.io.FileBlock;
2122 import uk.me.parabola.io.StructuredInputStream;
2223 import uk.me.parabola.io.StructuredOutputStream;
2324
3536 *
3637 * @author Steve Ratcliffe
3738 */
38 public class OverviewMapBlock {
39 public class OverviewMapBlock extends FileBlock {
40 public static final int BLOCK_ID = 0x42;
41
3942
4043 private int mapNumber;
41 private String mapName;
4244 private int parentMapNumber;
4345
4446 private String description;
4951 private int minLong;
5052
5153 public OverviewMapBlock() {
54 super(BLOCK_ID);
5255 description = "overview map";
5356 }
5457
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);
5764
5865 mapNumber = ds.read4();
5966 parentMapNumber = ds.read4();
6673 description = ds.readString();
6774 }
6875
69 public void write(Block block) throws IOException {
70 StructuredOutputStream os = block.getOutputStream();
71
76 public void writeBody(StructuredOutputStream os) throws IOException {
7277 os.write4(mapNumber);
7378 os.write4(parentMapNumber);
7479 os.write4(maxLat);
107112 }
108113
109114 public void setMapName(String mapName) {
110 this.mapName = mapName;
111115 try {
112116 this.mapNumber = Integer.parseInt(mapName);
113117 } catch (NumberFormatException e) {
115119 }
116120 }
117121
118 protected String getMapName() {
119 return mapName;
120 }
121
122122 public void setParentMapNumber(int parentMapNumber) {
123123 this.parentMapNumber = parentMapNumber;
124124 }
1717
1818 import java.io.IOException;
1919
20 import uk.me.parabola.io.FileBlock;
2021 import uk.me.parabola.io.StructuredOutputStream;
2122
2223 /**
2324 * @author Steve Ratcliffe
2425 */
25 public class RBlock {
26 public class RBlock extends FileBlock {
27 private static final int BLOCK_ID = 'R';
28
2629 private final String previewDescription = "Test preview map";
2730
28 public void write(Block block) throws IOException {
29 StructuredOutputStream os = block.getOutputStream();
31 public RBlock() {
32 super(BLOCK_ID);
33 }
3034
35 public void writeBody(StructuredOutputStream os) throws IOException {
3136 os.write(0xc3);
3237 os.writeString(previewDescription);
3338 }
1717
1818 import java.io.IOException;
1919
20 import uk.me.parabola.io.FileBlock;
2021 import uk.me.parabola.io.StructuredOutputStream;
2122
2223 /**
2324 * @author Steve Ratcliffe
2425 */
25 public class TBlock {
26 public class TBlock extends FileBlock {
27 private static final int BLOCK_ID = 'T';
28
2629 private long sum;
2730
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 {
3039 // If you change A,B,C or D the maps
3140 // will not load, you can change the rest without easily visible
3241 // problems although I suppose they must do something.
1717
1818 import java.io.BufferedInputStream;
1919 import java.io.BufferedOutputStream;
20 import java.io.ByteArrayInputStream;
2021 import java.io.FileInputStream;
2122 import java.io.FileOutputStream;
2223 import java.io.IOException;
4142
4243 public static final int TDB_V407 = 407;
4344
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
5145 // The version number of the TDB format
5246 private int tdbVersion;
5347
5549 private HeaderBlock headerBlock;
5650 private CopyrightBlock copyrightBlock = new CopyrightBlock();
5751 private OverviewMapBlock overviewMapBlock;
58 private final List<DetailMapBlock> detailBlocks = new ArrayList<DetailMapBlock>();
52 private final List<DetailMapBlock> detailBlocks = new ArrayList<>();
5953 private final RBlock rblock = new RBlock();
6054 private final TBlock tblock = new TBlock();
6155 private String overviewDescription;
56 private int codePage;
6257
6358 public TdbFile() {
6459 }
7772 public static TdbFile read(String name) throws IOException {
7873 TdbFile tdb = new TdbFile();
7974
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);
8777 }
8878
8979 return tdb;
10494 }
10595
10696 public void setCodePage(int codePage) {
97 this.codePage = codePage;
10798 headerBlock.setCodePage(codePage);
10899 }
109100
112103 * @param msg The message to add.
113104 */
114105 public void addCopyright(String msg) {
106 if (msg.isEmpty())
107 return;
108
115109 CopyrightSegment seg = new CopyrightSegment(CopyrightSegment.CODE_COPYRIGHT_TEXT_STRING, 3, msg);
116110 copyrightBlock.addSegment(seg);
117111 }
138132 }
139133
140134 public void write(String name) throws IOException {
141 CheckedOutputStream stream = new CheckedOutputStream(
142 new BufferedOutputStream(new FileOutputStream(name)),
143 new CRC32());
144135
145136 if (headerBlock == null || overviewMapBlock == null)
146137 throw new IOException("Attempting to write file without being fully set up");
147138
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);
156146
157147 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);
166152
167153 for (DetailMapBlock detail : detailBlocks) {
168 block = new Block(BLOCK_DETAIL);
169 detail.write(block);
170 block.write(stream);
154 detail.writeTo(stream, codePage);
171155 }
172156
173157 if (tdbVersion >= TDB_V407) {
174158 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 }
182161 }
183162 }
184163
188167 * @param ds The stream to read from.
189168 * @throws IOException For problems reading the file.
190169 */
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 }
220180 }
221181
222182 /**
223183 * The file is divided into blocks. This reads a single block.
224184 *
225185 * @param is The input stream.
226 * @return A block from the file.
227186 * @throws IOException For problems reading the file.
228187 */
229 private Block readBlock(StructuredInputStream is) throws IOException {
188 private void readBlock(InputStream is) throws IOException {
230189 int blockType = is.read();
231190 if (blockType == -1)
232191 throw new EndOfFileException();
233 int blockLength = is.read2();
192
193 int blockLength = readBlockLength(is);
194 if (blockLength == -1)
195 throw new EndOfFileException();
234196
235197 byte[] body = new byte[blockLength];
236198 int n = is.read(body);
237199 if (n < 0)
238200 throw new IOException("failed to read block");
239201
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);
241237 }
242238
243239 public int getTdbVersion() {
9292
9393 assertEquals("display priority", pri, ((TREHeader) treFile.getHeader()).getDisplayPriority());
9494 }
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 }
95101 }
5252 @Test
5353 public void testBasic() throws FileNotFoundException {
5454
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");
6057
6158 MapReader mr = new MapReader(Args.DEF_MAP_ID + ".img");
6259 TestUtils.registerFile(mr);
7673
7774 @Test
7875 public void testNoSuchFile() {
79 Main.mainNoSystemExit(new String[]{
80 "no-such-file-xyz.osm",
81 });
76 Main.mainNoSystemExit("no-such-file-xyz.osm");
8277 assertFalse("no file generated", new File(Args.DEF_MAP_FILENAME).exists());
8378 }
8479
8580 @Test
8681 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");
9183
9284 FileSystem fs = openFs(Args.DEF_MAP_FILENAME);
9385 assertNotNull("file exists", fs);
108100 count++;
109101 System.out.println("TRE size " + size);
110102 // 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));
112104 break;
113105 case "LBL":
114106 count++;
117109 }
118110 }
119111 assertTrue("enough checks run", count >= 3);
112
120113 }
121114 }
7171 public static void init() throws FileNotFoundException {
7272 TestUtils.deleteOutputFiles();
7373
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");
7875
7976 fs = ImgFS.openFs(Args.DEF_MAP_FILENAME);
8077 ImgChannel tre = fs.open(Args.DEF_MAP_ID + ".TRE", "r");
1616 import java.io.IOException;
1717 import java.nio.ByteBuffer;
1818 import java.nio.ByteOrder;
19 import java.util.Collections;
2019 import java.util.Comparator;
2120 import java.util.List;
2221
4645 File f = new File(GMAPSUPP_IMG);
4746 assertFalse("does not pre-exist", f.exists());
4847
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");
5552
5653 assertTrue("gmapsupp.img is created", f.exists());
5754
7168 */
7269 @Test
7370 public void testMpsFile() throws IOException {
74 Main.mainNoSystemExit(new String[]{
75 Args.TEST_STYLE_ARG,
71 Main.mainNoSystemExit(Args.TEST_STYLE_ARG,
7672 "--gmapsupp",
7773 "--family-id=150",
7874 "--product-id=24",
8076 "--family-name=tst family",
8177 "--area-name=tst area",
8278 Args.TEST_RESOURCE_IMG + "63240001.img",
83 Args.TEST_RESOURCE_IMG + "63240002.img"
84 });
79 Args.TEST_RESOURCE_IMG + "63240002.img");
8580
8681 MpsFileReader reader = getMpsFile();
8782 List<MapBlock> list = reader.getMaps();
107102 @Test
108103 public void testCombiningSupps() throws IOException {
109104 TestUtils.registerFile("g1.img", "g2.img");
110 Main.mainNoSystemExit(new String[]{
111 Args.TEST_STYLE_ARG,
105 Main.mainNoSystemExit(Args.TEST_STYLE_ARG,
112106 "--gmapsupp",
113107 "--family-id=150",
114108 "--product-id=24",
115109 "--series-name=tst series",
116110 "--family-name=tst family",
117111 "--area-name=tst area",
118 Args.TEST_RESOURCE_IMG + "63240001.img",
119 });
112 Args.TEST_RESOURCE_IMG + "63240001.img");
120113
121114 File f = new File("gmapsupp.img");
122115 f.renameTo(new File("g1.img"));
123116
124 Main.mainNoSystemExit(new String[]{
125 Args.TEST_STYLE_ARG,
117 Main.mainNoSystemExit(Args.TEST_STYLE_ARG,
126118 "--gmapsupp",
127119 "--family-id=152",
128120 "--product-id=26",
129121 "--series-name=tst series 2",
130122 "--family-name=tst family 2",
131123 "--area-name=tst area 2",
132 Args.TEST_RESOURCE_IMG + "63240002.img",
133 });
124 Args.TEST_RESOURCE_IMG + "63240002.img");
125
134126 f.renameTo(new File("g2.img"));
135127
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");
142129
143130
144131 MpsFileReader reader = getMpsFile();
172159 */
173160 @Test
174161 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",
184168 "--family-id=102",
185169 "--product-id=2",
186170 "--series-name=tst series2",
187 Args.TEST_RESOURCE_IMG + "63240002.img"
188 });
171 Args.TEST_RESOURCE_IMG + "63240002.img");
189172
190173 MpsFileReader reader = getMpsFile();
191174 List<MapBlock> list = reader.getMaps();
211194 */
212195 @Test
213196 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",
218199 "--family-id=101",
219200 "--product-id=1",
220201 "--family-name=tst family1",
221202 "--series-name=tst series1",
222203 Args.TEST_RESOURCE_IMG + "63240001.img",
223
224204 "--family-id=102",
225205 "--product-id=2",
226206 "--family-name=tst family2",
227207 "--series-name=tst series2",
228 Args.TEST_RESOURCE_IMG + "63240002.img"
229 });
208 Args.TEST_RESOURCE_IMG + "63240002.img");
230209
231210 MpsFileReader reader = getMpsFile();
232211
233212 List<ProductBlock> products = reader.getProducts();
234 Collections.sort(products, new Comparator<ProductBlock>() {
213 products.sort(new Comparator<ProductBlock>() {
235214 public int compare(ProductBlock o1, ProductBlock o2) {
236215 if (o1.getFamilyId() == o2.getFamilyId())
237216 return 0;
258237 */
259238 @Test
260239 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");
272248
273249 MpsFileReader reader = getMpsFile();
274250 assertEquals("number of map blocks", 2, reader.getMaps().size());
278254 @Test
279255 public void testWithIndex() throws IOException {
280256 new File("osmmap_mdr.img").delete();
281 Main.mainNoSystemExit(new String[]{
282 Args.TEST_STYLE_ARG,
257 Main.mainNoSystemExit(Args.TEST_STYLE_ARG,
283258 "--gmapsupp",
284259 "--index",
285260 "--latin1",
286
287261 "--family-id=101",
288262 "--product-id=1",
289263 "--family-name=tst family1",
290264 "--series-name=tst series1",
291265 Args.TEST_RESOURCE_IMG + "63240001.img",
292 Args.TEST_RESOURCE_IMG + "63240002.img"
293 });
266 Args.TEST_RESOURCE_IMG + "63240002.img");
294267
295268 assertFalse(new File("osmmap_mdr.img").exists());
296269
314287 public void testWithTwoIndexes() throws IOException {
315288 TestUtils.registerFile("osmmap_mdr.img", "osmmap.img", "osmmap.tbd", "osmmap.mdx");
316289
317 Main.mainNoSystemExit(new String[]{
318 Args.TEST_STYLE_ARG,
290 Main.mainNoSystemExit(Args.TEST_STYLE_ARG,
319291 "--gmapsupp",
320292 "--index",
321293 "--tdbfile",
322294 "--latin1",
323
324295 "--family-id=101",
325296 "--product-id=1",
326297 "--family-name=tst family1",
327298 "--series-name=tst series1",
328299 Args.TEST_RESOURCE_IMG + "63240001.img",
329 Args.TEST_RESOURCE_IMG + "63240002.img"
330 });
300 Args.TEST_RESOURCE_IMG + "63240002.img");
331301
332302 assertTrue(new File("osmmap_mdr.img").exists());
333303
354324 public void testTwoFamilyIndex() throws IOException {
355325 TestUtils.registerFile("osmmap_mdr.img", "osmmap.img", "osmmap.tbd", "osmmap.mdx");
356326
357 Main.mainNoSystemExit(new String[]{
358 Args.TEST_STYLE_ARG,
327 Main.mainNoSystemExit(Args.TEST_STYLE_ARG,
359328 "--gmapsupp",
360329 "--index",
361330 "--latin1",
362
363331 "--family-id=101",
364332 "--product-id=1",
365333 "--family-name=tst family1",
368336 "--family-id=202",
369337 "--family-name=tst family2",
370338 "--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");
373340
374341 assertFalse(new File("osmmap_mdr.img").exists());
375342
406373 public void testImplicitCodePageIndex() throws IOException {
407374 TestUtils.registerFile("osmmap_mdr.img", "osmmap.img", "osmmap.tbd", "osmmap.mdx");
408375
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");
423380
424381 assertFalse(new File("osmmap_mdr.img").exists());
425382
441398 public void testWarningOnMismatchedCodePages() throws IOException {
442399 TestUtils.registerFile("osmmap.img");
443400
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",
448402 Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz",
449
450403 "--latin1",
451 Args.TEST_RESOURCE_OSM + "uk-test-2.osm.gz",
452 });
404 Args.TEST_RESOURCE_OSM + "uk-test-2.osm.gz");
453405
454406 Outputs outputs = TestUtils.run(Args.TEST_STYLE_ARG,
455407 "--gmapsupp",
464416
465417 private MpsFileReader getMpsFile() throws IOException {
466418 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);
468420 TestUtils.registerFile(reader);
469421 return reader;
470422 }
3535 */
3636 @Test
3737 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",
4139 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");
4441
4542 File f = new File(TDBNAME);
4643 assertTrue("TDB was created", f.exists());
5754 public void testOptions() {
5855 int thisMapname = 11112222;
5956 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");
7058
7159 File f = new File(thisMapname + ".tdb");
7260 assertTrue("TDB was created", f.exists());
3535 */
3636 @Test
3737 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");
4540
4641 FileSystem fs = openFs(Args.DEF_MAP_ID + ".img");
4742 assertNotNull("file exists", fs);
6257 count++;
6358 System.out.println("TRE size " + size);
6459 // 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));
6661 break;
6762 case "LBL":
6863 count++;
9994 count++;
10095 System.out.println("TRE size " + size);
10196 // 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));
10398 break;
10499 case "LBL":
105100 count++;
3232 @Test
3333 public void testAllElements() {
3434 checkNoStdFile();
35 Main.mainNoSystemExit(new String[]{
36 "test-map:all-elements"
37 });
35 Main.mainNoSystemExit("test-map:all-elements");
3836 checkStdFile();
3937 }
4038
4341 */
4442 @Test
4543 public void testAllPoints() {
46 Main.mainNoSystemExit(new String[]{
47 "test-map:test-points"
48 });
44 Main.mainNoSystemExit("test-map:test-points");
4945 checkStdFile();
5046 }
5147 }