update to version 2.3.3, add new map sources

This commit is contained in:
Cyberes 2024-05-22 20:06:32 -06:00
parent d438bb7caf
commit 53007aa2fa
721 changed files with 30995 additions and 23873 deletions

2
.gitignore vendored
View File

@ -1,5 +1,3 @@
!sqlite-jdbc-3.34.0.jar
Mobile_Atlas_Creator_UNLOCKED.jar
build
mapsources
mobac-rev.properties

824
CHANGELOG.txt Normal file
View File

@ -0,0 +1,824 @@
*******************************************************************************
* M O B I L E A T L A S C R E A T O R *
*******************************************************************************
* V E R S I O N I N F O R M A T I O N *
*******************************************************************************
+ = Additions since previous version
! = Bug fixes since previous version
~ = Changes since previous version
- = Features that has been removed
=======
2.3.3 (2023-10-13)
! BSH map sources: fixed Cannot access method addRequestProperty when using
Java 17+ (#383)
~ Custom map sources: validate map source names for disallowed characters
- Map source "4uMaps" removed (service discontinued)
2.3.2 (2023-09-29)
! MBTiles: prevent duplicate tiles in mbtiles database
! MBTiles: atlases are now restricted to one map per zoom level
~ Updated Mapsforge to 0.20
2.3.1 (2023-01-18)
! Mapsforge: VALIDATE_COORDINATES=false to avoid problems at the borders of
the world
! "Show Readme" menu command fixed (#380)
! MBTiles bounds changed to match the specification: "Bounds must define an
area covered by all zoom levels."
2.3.0 (2022-08-11)
~ Mapsforge library updated to version 0.18
! Fixed PNG 4bit/8bit tile processing
! Fixed problems with the used Berkeley DB JE on systems with Turkish locale
(tile store database library was upgraded to version 5.0.73)
~ MBTiles database format upgraded to 1.3 (minzoom/maxzoom added, FR #307)
+ Added image format WEBP as tile type including detection on download
+ Alpine Quest Map files (.aqm) can be used as local map source
<localTileSQLite>
2.2.3.2 (2022-05-15)
! Fixed StackOverflowError when opening settings dialog (#372)
2.2.3.1 (2022-05-09)
! Fixed problems with MapEvaluator (missing resources #370)
2.2.3 (2022-05-06)
! Fixed fallback to English when a localized string is missing in the selected
language
! Fixed min/max zoom info for SQLite based atlas: RMaps, BackCountry, OsmAnd
SQLite, Maverick, MBTiles, BigPlanet Tracks (#365)
~ Detection of JPEG image type improved (more variants are now detected)
~ Mapsforge library updated to version 0.17
+ customWmsMapSource: <coordinateunit> entry allows to switch between
meter/degree (replaces wgs84 parameter)
2.2.2 (2022-01-31)
- Dropped support for Java 8 - Java 11+ is now required
~ Allow transparent background on CustomMultiLayerMap (#359)
! FreemapSlovakia maps updated
~ Boolean fields in custom map sources that can be true or false now only
accept one of those values
+ BSH Tools method "alert" added
! BSH map sources did not correctly apply ignoreError=true setting in
multi-layer maps and other occasions
! Custom multi-layer XML map source: fixed a minor problem with mapping
alpha values to layers in case not all layers return an image
+ Custom WMS map source support for v1.3.0 with EPSG:4171 and wgs84 mode
thanks to Nicolas Paour
! Tile calculation fixed for local map sources
~ Logging backend changed from log4j to slf4j+logback
2.2.1 (2021-06-02)
! Loading an MOBAC XML profile can cause java.lang.NullPointerException
! "OsmAnd tile storage" atlas format: fixed file name scheme of generated
map tiles to "YYYYYYpng.tile" (#356)
! Freemap Slovakia maps fixed (FR#306)
- Non-working maps "OSMapa-Topo..." removed
- Non-working map "FAA Sectional Charts" removed
- Non-working map "MoldovaPointMd" removed
! Fixed bounds calculation for negative lat/lon values for MBTiles and
GeoPackage maps (#358)
2.2.0 (2021-04-10)
! MOBAC build system changed to Gradle
+ Support for ARM based MacOS systems (SQLite library)
- Support for 32bit systems dropped
! fixed Jaxb problem causing a NullPointerException with defineClass
is null (#355)
2.1.4 (2020-12-22)
+ Russian translation added (thanks to xmember)
+ Preview map view: Show detailed error in each tile if download had failed.
! Default map tile expiration time was not correctly applied when the server
does not provide an expiration time (see #342).
! TileDownloader ignored used customized settings (e.g. expiration times)
see #342
! Correct handling of tile counter for multi-layered local map sources (#345)
! Custom map sources with invertYCoordinate=true save tiles in cache to the
wrong (inverted) tile coordinate (#349). Note that fixing this issue means
that all saved tile caches of custom map sources have to be cleared as the
tiles are saved to invalid coordinates.
! MBTiles bounds issue with multiple maps in one atlas fixed (#348)
2.1.3 (2020-04-13)
! Custom map sources with UTF-8 characters now loaded correctly on platforms
with a different default encoding than UTF-8 (fix for #324)
! NullPointerException when creating an Magellan RMP (fix for #325)
+ New map sources (covering Spain): Instituto Geográfico Nacional (IGN)
WMTS Base/MTM/PNOA (ortho)
+ Measurement ruler on preview map added (patch #45)
+ Allow to set HTTP headers that are restricted by Java in custom map sources.
Such as "Origin", "Connection" and other.
- Map source removed: "Chartbundle US World Aeronautical Charts" (#332)
- Map source added: "Chartbundle US Helicopter Charts" (#332)
! Fixed: preview selection around GPX around not visible on the map (#333)
- Removed the undocumented feature to trust TLS certificates via settings.xml
(<trustedCertificates> and <certificateHash> entries)
+ Added entries to BeanShell and custom XML map sources to explicitly trust an
TLS certificate (via it's public key). The public key is identified via it's
sha-256 hash that can be placed in the custom map xml/bsh file.
+ BSH map source tools method added: "getDirectory(...)"
+ BSH map source tools method added: "calculateTileLatLon(zoom, x, y)"
2.1.2 (2019-08-07)
~ Minimum supported Java version increased to Java 8 (1.8)
! "mapFile must not be null" error when creating an atlas
! Save settings to settings.xml in UTF-8 format (fix for #324)
! Map creation error with JPEG (Garmin Custom and others) (fix for #326)
+ Add trusted certificate for HTTPS connections via settings.xml
2.1.1a (2019-04-13)
! NoSuchMethodException when clicking the "Create Atlas" button (fix for #321)
2.1.1 (2019-04-10)
~ Changed the MOBAC website URL (e.g. used for online update):
http://mobac.sourceforge.net -> https://mobac.sourceforge.io
! Map source initialization by atlas creation engine added (fix for #313)
! Multi-threading issue with TileImageWriter fixed
~ On Linux now always xdg-open is used for opening the atlas folder in file
manager (#317)
2.1.0 (2018-06-18)
! 4uMaps.eu fixed
~ Mapsforge updated to version 0.9.1
- Removed: map source OpenPisteMap (does not exist anymore)
+ JAXB libraries included into MOBAC (for Java 9+)
2.0.1 (2017-11-11)
! Fixed: Custom maps source loading problem when using custom map sources in a
custom multi-layer map source (#294)
~ Clean-up: USGS map sources (some removed, some updated)
+ Extra start commands for Java 9:
"start_java9.sh", "Mobile Atlas Creator Java9.exe"
2.0.0 (2017-04-14)
~ Mapsforge library updated to version 0.8.0
~ SQLite-jdbc library updated to version 3.16.1
2.0.0 beta 3 (2017-01-02)
~ Mapsforge library updated to version 0.7.0
! Fixed multi-threading problem for MapsForge maps (truncated labels)
~ Updated xerial sqlite-jdbc library to version 3.8.11.2
! Fixed: Mapsforge cusom map <textScale> did not had an effect
+ New: Mapsforge custom map property <userScaleFactor>
- MapQuest map source deleted (map not available anymore)
+ Custom Mapsforge Map: Multiple map files (<mapFile> elements) are now
possible (see example)
! Fixed: MOBAC on Windows now works when started on UNC network path
2.0.0 beta 2 (2016-04-24)
! Fixed New Zealand Topographic Maps (see bug #282 & patch #43)
- Removed maps: OpenStreetMap Mapnik and OpenSeaMap (maps are no longer
available for MOBAC)
+ Left panel is now resizeable by mouse
+ Refreshing the preview map view via "F5" now clears the label cache of
Mapsforge maps
+ BeanShell map source: "displayName" added (allows to use non-ascii characters
as map name shown in MOBAC
2.0.0 beta 1 (2015-11-26)
~ Mapsforge library updated to version 0.6.0
~ Map pack update certificate re-created due to expired certificate.
The map pack update url changed, old MOBAC versions can no longer receive
map pack online updates.
! NzTopoMaps updated to new schema
2.0.0 alpha 4 (2015-09-01)
+ Canada Toporama map source reactivated
~ Mapsforge library updated to version 0.5.2
2.0.0 alpha 3 (2015-04-16)
~ Mapsforge vector maps library updated to 0.5.1
! Mapsforge custom caching implemented (required for correct label rendering)
2.0.0 alpha 2 (2014-10-31)
! Fixed problems using mapsforge vector maps as a layer of a multi-layer map
! TrekBuddyTar: test added for too long layer & map names
+ Maverick: Old atlas format (.jpg.tile) reactivated as additional atlas format.
+ New atlas format (experimental): GeoPackage
2.0.0 alpha 1 (2014-07-31)
~ GUI design improved
+ Custom map sources can be grouped by subdirectories
+ Direct rendering of bitmap tiles based on mapsforge vector maps
(see README.HTM for details).
1.9.16 (2014-02-06)
! Background color does not work in case of a multi-layer map source with
only one layer (#252)
~ The atlas format Maverick was changed from OSMTracker format to RMaps
SQLite format (request from Maverick author).
1.9.15 (2013-11-20)
+ Selection around GPX track: preview map selection while selecting distance
+ Selection enclosed by GPX track (inner region)
! Minimum and maximum zoom level of custom multi-layer map sources in
combination with local file-based map sources corrected
! Maverick: Corrected that all files are expected to have ".jpg.tile"
! Maplorer: Custom tile width and height reactivated
extension, even if it is a PNG file.
+ Updated xerial SQLite library that comes with MOBAC to v1.3.15-M1.
1.9.14 (2013-07-29)
~ Custom SQlite map sources can now be specified using a relative path
~ BackCountry Navigator format updated - now SQLite based atlases are created
+ Japanese translation added (thanks to "u/ta-ka") [patch #33]
! Not translated tooltip corrected [patch #34]
! A problem with MapSourceInitializationException fixed (#245)
! Memory leak fixed in "TwoNav (RMAP)" atlas format causing an
OutOfMemoryError when creating a large atlas
1.9.13 (2013-05-29)
! HTML injection via Atlas name bug #242
! Workaround for Java bug in JPEG writer (if source image has alpha
transparency) implemented
+ French translation added (thanks to Jean-Claude Repetto) [patch #31]
1.9.12 (2013-04-17)
! Mapsource OpenStreetMap Maps4u.eu updated
~ Reduced the number of decimal places of coordinates in GPX files created by
MOBAC to 5 places (#242)
+ Custom multi-layer map sources: Each layer can now have an alpha
transparency value, specified as space separated list in <layersAlpha>
element
! Bufix of conversion between different coordinate formats (degree, deg/min,
deg/min/sec)
~ localImageFile support using <retinaDisplay> (patch by miocool)
~ More atlas format support retina (scale = 2) images, including Paper(PNG),
Paper(pdf). (patch by miocool)
! More atlas format can display retina (scale = 2) images correctly
(convert to scale = 1), such as iPhone v5 (patch by miocool)
+ Add <localImageFile> map source support (patch by miocool)
! Bug fix of 512x512 map tile images in Multiple layer (patch by miocool)
+ Multiple language for Simplify-Chinese, Traditional Chinese and English
(patch by miocool)
+ View 512x512 map tile images for retina display (patch by miocool)
1.9.11 (2013-02-19)
! Bugfix for servers that send case insensitive content-types
! Bugfix OruxMapsSQlite final commit was missing (patch #30)
+ New map sources: USGS National Map Base/Satellite/Satellite+/Vector/Topo
! Bugfix Garmin Custom Map: Removed possibility to set output format to PNG
1.9.10 (2012-12-04)
! Bugfix Local tile [zip] files in quadkey format causes a
NullPointerException when creating an atlas (#229)
+ Custom multi-layer map source can now contain <customWmsMapSource> maps
1.9.9 (2012-10-09)
! Bugfix in PNGW calibration (patch by allib)
! RMAPS: Error "failed to retrieve max tile zoom info" fixed (#3561323)
! GEMF: Error "NullPointerException" fixed (#3564146)
~ OruxMaps: Patch #3300055 applied
+ Custom XML map: <invertYCoordinate> now works in simple XML map, too
+ Loading multiple GPX files at once into MOBAC (based on patch by heckie)
! Bugfix NullPointerException when aborting atlas download fixed (#3568849)
+ Automatically splitted maps because of the specified maximum map size can
now overlap 1-5 tiles
1.9.8 (2012-07-05)
! Viewranger atlas format depends on Java Advanced Imaging without checking
! OurxMaps SQLite: Memory handling changed (should prevent OutOfMemoryError)
! Fixed progress bar in atlas progress window for large atlases
+ Possibility added to use SQLite Java Wrapper (ch-werner) instead of default
sqlite library
~ Replaced the old SQLite library with recent version of Xerial. This fixes
all problems creating databases larger than 2GB on Windows 64bit
! CacheWolf: Custom tile processing re-enabled
+ New atlas format: iPhone 3 Map Tiles v5
1.9.7 (2012-05-16)
+ Custom XML map source: New parameter {$q} for Quad-Tree encoded zoom, x & y
+ New atlas output format: Osmdroid GEMF
+ Increased default map size to 65536
1.9.6 (2012-04-02)
+ New settings.xml option: <garminCustomMaxMapCount>
+ New atlas format: TomTom raster
- Map source removed: Openstreetmap Osmarenderer (project has been retired)
! Paper atlas: Disabling compass in settings was ineffective
+ New map source: OpenStreetMap 4uMaps.eu (Europe)
+ backgroundColor option for customMultiLayerMapSource
! Message "The JPEG image format is not supported by OpenJDK." was shown at
start-up even is custom tiles processing was disabled
+ New atlas format: Viewranger
~ Magellan (RMP): Removed 18000 pixel check
1.9.5 (2012-03-09)
! Alpine Quest Map: Multiple bugs fixed (#3484328)
~ Improvements in atlas download progress dialog (patch by dvodvo)
~ Windows launcher "Mobile Atlas Creator.exe" increased max heap size to 1GB
~ Linux start.sh increased max heap size to 1GB
+ New selection mode: Circle (approximated by a 16 point polygon)
+ New map source: OSMapa-Topo with contours (PL)
1.9.4 (2012-01-29)
+ BeanShell map source: ignoreError=true feature added
+ Debug menu: Show/hide map tile borders
1.9.3 (2011-12-01)
+ Custom map source from local tiles XML schema changed:
new <sourceType> values: DIR_ZOOM_X_Y, DIR_ZOOM_Y_X, QUADKEY
removed flipXYDirs (use <sourceType>DIR_ZOOM_Y_X</sourceType> instead
! Custom map source from ZIPs: Handling for atlas types with two file
extensions fixed
! Bugfix Osmdroid SQlite: PRIMARY KEY must be unique (#3438206)
~ Turaterkep map updated (renamed internally to Turaterkep256 because of map
format change)
+ Support added for starting external tools from within MOBAC
1.9.2 (2011-10-12)
+ Custom map source from ZIP/files in file-system: added possibility to invert
y coordinate via "invertYCoordinate" like it is used by MapTiler
+ New settings.xml option: <downloadRetryCount> (default 1). Allows to reduce
or increase the maximum attempts MOBAC tries to download a tile in case
of errors occur while download or HTTP response is not as expected.
+ Logging verboseness now configurable for the current session via GUI
! PaperAtlas: NullPointerException when WGS Grid=off has been fixed
+ CustomSQLite atlas as map source: OSMAND format added
+ New atlas output format: OSMAND SQLite
1.9.1 (2011-09-09)
! Opening settings dialog: ClassCastException on Linux/OpenJDK
! Custom SQlite atlas as map source fixed for atlas formats AndNav,
BackCountry Navigator and Osmand
+ Background color for BeanShell map sources can be specified by adding
backgroundColor = "#ffffff";
! Custom SQLite atlas as map source had an undefined tileImageType;
Added auto-detection and user defined <tileImageType>
1.9 (2011-08-18)
! Calculation problem in MGMaps atlas format (fix by Pierre-Luc Paour)
! Custom mapsource from RMaps SQLite atlas shows wrong zoom levels
- Removed map source: Open Cycle Map (request by Andy Allan)
+ New map source: OSMapa-Topo (Poland)
+ Map source tile store coverage: button for hiding colored layer added
+ OziExplorer/Trekbuddy: MM1B calculation improved (patch by MrPete #3026830)
+ Custom XML map source: {$serverpart} / <serverParts> implemented for
balancing load among multiple servers with different DNS names
+ SQLite library included in MOBAC distribution
1.9 beta 6 (2011-06-21)
+ New atlas format: Geocaching Live offline maps
+ New atlas format: MBTiles (Experimental)
+ New atlas format: Paper Atlas (PDF) & Paper Atlas (PNG)
[provided by Ľubomír Vasek]
! Bug #3316081 - "String index out of range: -1" upon map sources update
! Incorrect selection and tile count calculation
+ New map source: Moldova (point.md)
1.9 beta 5 (2011-05-17)
+ Added possibility change directory syntax for file and zip based map sources
from zoom/x/y to zoom/y/x ("flipXYDir")
+ Added possibility to use <localTileFiles> and <localTileZip> within a custom
multi-layer map source
! CustomMultiLayerMapSource: "null" error when loading
! directories.ini: mobac.atlasprofilesdir not used for loading profiles list
+ directories.ini: System variables can be used in the form ${VARNAME}
+ Local map sources from SQLite atlases can now be used - supported formats are
RMaps, MBTiles, BigPlanetTracks, Galileo, NaviComputer
! Fixed OpenStreetMap Cycle Map
+ Experimental: adding user-defined polygon maps
~ Changed polygon selection behavior - selection stays now after adding it
1.9 beta 4 (2011-05-02)
~ Problem loading tile image type for custom map sources (ends up for TrekBuddy
atlas format in an NullPointerException like in bug #3290976
~ Settings dialog now lists all tile stores - not only the stores of loaded map
sources
+ Experimental: Polygonal map derived from GPX track segment
! Endless opening of exception dialog (endless recursion)
1.9 beta 3 (2011-04-21)
+ Map source UMP-pcPL reactivated
+ [Nokia] Sports Tracker file extension changed to jpg (feature request #3066161)
+ Reactivated atlas format "TwoNav (RMAP)"
+ New map source: FAA Sectional Charts (aeromaps.us)
+ Reactivated map sources Freemap.sk (Car atlas, Hiking map, Cycle map)
+ Map source New Zealand Topographic Maps (nztopomaps.com) reactivated
! OruxMapsSQLite: Last processed tiles missing in db file
1.9 beta 2 (2011-04-06)
! Custom atlas map source / locally generated tiles map source
+ New map source for using tiles from zip file(s)
+ Removed all map sources except the OSM related - for details see
http://sourceforge.net/projects/mobac/forums/forum/861096/topic/4470412
1.9 beta 1 (2011-03-29)
+ New map source: OpenStreetMap MapQuest
+ New map source: OpenStreetMap Bing layer (Mapnik powered by Microsoft)
~ Maximum zoom level of OpenStreetMap Mapnik decreased to 16 (zoom levels
17+ are blocked on server side because of high server stress for
generating such tiles)
+ New custom map source type: reading tiles offline from an OSMTracker/AndNav/
BackCountry Navigator/Maverick/OSMAND atlas (from file system)
~ Atlas format PNG+Worldfile: projection file for Arcgis added and calculation
improved (patch by user mmartin2)
~ JPEG compression level selectable for Magellan (RMP) atlas format
1.9 preview 14 (2011-03-17)
+ Osmdroid SQLite: Tile image format conversion implemented
- Osm Hiking maps removed (excluding the "Wanderreitkarte Abo" version)
- Outdooractive.com maps removed as requested by map provider
1.9 preview 13 (2011-03-12)
+ Download to tile store without creating an atlas:
new atlas format "Tile store download only"
! BeanShell map sources could not be used with certain atlas formats
+ New map source: Israel Topo (Amudanan) with and without trails
1.9 preview 12 (2011-03-05)
~ Cykloatlas: max zoom level extended to 16
+ New map source: Canada Toporama
+ Convert an existing atlas profile to a different output format
! Loading of custom CloudMade maps fixed
1.9 preview 11 (2011-03-02)
! Error when using a BeanShell map source with certain atlas formats
- Removed Map+ map sources because of license problem with swisstopo
1.9 preview 10 (2011-02-28)
! Fixed map source: Docelu.pl
+ Bookmarks can be added (saves map position and selected map source)
! Fixed map source: Cykloatlas and relief
! Fixed map source: Map+ (Switzerland)
+ New map source: Map+ Gelände (Switzerland)
+ New atlas format: nfComPass
1.9 preview 9 (2011-02-22)
+ New map source: Reit- und Wanderkarte (Abo) - (requires purchased ticket)
~ Updated New Zealand Topographic Maps url
! OpenStreetMap attribution + MOBAC user aget
1.9 preview 8 (2011-02-16)
+ NaviComputer: Possible to change tile image format (PNG, 4Bit-PNG, JPEG, ...)
+ OpenPisteMap: All three layers (base, contours and landshed are now supported)
- Disabled TwoNav RMAP output format because of legal/license problems
1.9 preview 7 (2011-02-04)
+ OSM Hiking ticket system implemented (Wanderreitkarte.de)
! NoSuchMethodError: mobac.program.ProgramInfo.getUserAgent()Ljava/lang/String;
1.9 preview 6 (2011-02-04)
! Custom tile size was not available for TrekBuddy and Glopus GFM
~ Tile usage policy implemented for OSM Mapnik
1.9 preview 5 (2011-01-21)
+ New map source: ICAO Maps (Germany)
+ Manual map pack online update via settings dialog
+ Add selection via Ctrl+A key combination possible (see "Maps" menu)
1.9 preview 4 (2011-01-14)
+ New: Support for CustomWmsMapSource (experimental)
+ Download bandwidth limitation selectable for very fast network connections
! Highest zoom level missing in tile store coverage zoom selector
+ New atlas format: OsmdroidSQlite
+ New map sources: ArcGIS topo map/satellite/street map
1.9 preview 3 (2011-01-09)
+ New atlas format: PNG + Worldfile (PNG & PGW)
~ Atlas output format has to be chosen before adding maps
~ Disabling of unsupported tile processing options (regarding the current
atlas format)
~ Enabled maps with ellipsoid projection for RMaps
1.9 preview 2 (2010-12-18)
+ New atlas format: BackCountry Navigator
+ New atlas format: TwoNav (RMAP)
+ Multi-layer maps with more than two layers are now possible
+ New map source: OSM Hiking with relief and base
+ New map source: Open Sea Map (sea layer joined with Mapnik)
+ New atlas format: MGMaps/MyTrails (MGM)
+ New map source: Topomapper.com
~ Map sources are now packed into "MapPacks" which can be updated
without changing the main MOBAC program
~ Custom map sources are moved from settings.xml into separate xml files
in the "mapsources" sub-directory
~ XML structure of multi-layer custom maps sources has changed
+ Multi-layer maps can now contain map sources that come with MOBAC
This allows to combine existing map sources with new overlays.
+ BeanShell map sources can be used if placed in the "mapsources"
sub-directory
+ All direcories used by MOBAC can be pre-configured via file
directories.ini in the MOBAC program directory
+ CustomMap: new parameter: ignoreErrors and backGroundColor can have
alpha transparency parameter
+ New map source: Cloudmade Map default style (1)
+ Tile image format conversion for RMaps/BigPlanet/Galileo
1.8 final: (2010-10-31)
+ New map source: New Zealand Topographic Maps
1.8 RC 1: (2010-10-23)
+ AlpineQuest handles tiles <> 256px and ellipsoid projections
+ New atlas format: Run.GPS Atlas
! Fixed map source: Emapi.pl
1.8 beta 4: (2010-10-09)
~ Implemented logging for ImageWriter warnings
~ Display selected areas: adding a new map selection does no longer resets the
map selection and therefore the highlighted area does not change.
1.8 beta 3: (2010-10-02)
! Fixed: NullPointerException when renaming an GPX file entry
! MyTopo URL updated and fixed
~ Unnecessary restriction of RMaps / BigPlanet Tracks to zoom 17 removed
+ New map source: Microsoft Maps with hill shade
~ Custom tile settings now possible with SportsTracker
+ New atlas format: Osmdroid ZIP
+ New map source: SIGPAC Mercator (Spain only) - patch by susinho
1.8 beta 2: (2010-09-13)
+ AlpineQuestMap atlas creator updated (patch by Camille)
+ New map source: Navitel (Russian)
! GPS Sport Tracker: space removed in tile file name
! MyTopo URL updated
1.8 beta 1: (2010-08-24)
! Fixed PNG 256 color output
+ New atlas format: OruxMaps (Android)
+ New atlas format: Glopus Map File (AFTrack and others)
~ BigPlanet SQL commit rate changed
! #2963490 Using custom tile size with multi-layer maps creates black map
tiles
+ GPX file editor improved
~ Austrian Map removed (does not work anymore - unable to fix)
+ Yandex Map & Sat added (works only with selected atlas creators because of a
different projection category - Yandex uses an ellipsoid)
~ Map source change: Emapi.pl replaces Emapa.pl
+ New atlas format: PathAway
! Alpha transparency problem with multi-layer maps
+ New atlas format: AFTrack (OSZ)
~ CacheBox layer name uses now the map source name
+ New atlas format: AlpineQuestMap (AQM)
+ New atlas format: Ublox
! Fixed OSM Hiking relief
+ New map source: Cykloatlas with relief
+ Custom Map Sources extended to multi-layer map source (2 layers)
+ New map source: Statkart sea/nautical (AKA "sjo_hovedkart2")
~ TouretechQV: Corrected "projparams" (removed unset UTM zone) - see #2970353
+ New atlas format: Google Earth Overlay (unrestricted Google Custom Map)
! Fixed: #3008934 (MM1B calculation problem in .map file)
+ New map source: MyTopo.com (USA only)
+ New map source: Yahoo Maps Japan
+ New atlas format: GPS Sports Tracker
+ New atlas format: Sports Tracker
+ New map source: OSM Hikebikemap.de
+ Background color for custom maps added
~ Freemap.sk maps updated and changed
+ New atlas format: Maplorer
+ New map source: Yahoo Taiwan
+ New map sources: Aero Charts VFR/IFR/IFR-H (USA only from runwayfinder.com)
+ New atlas format: OruxMaps Sqlite
+ New map source: Ordnance Survey Explorer Maps (UK)
+ Proxy authentication by user name/password added in GUI
+ New atlas format: OSMAND
~ SQLite back-end replaced - Zentus SqliteJDBC is now used
(see README.HTM for details)
! OpenPisteMap tile url updated
+ New atlas format: NaviComputer
1.7: (2010-02-05)
~ Project has been renamed to "Mobile Atlas Creator" taking account that
besides TrekBuddy a large number of atlas and map formats are supported
and for ending the mix-up of "TrekBuddy" and "TrekBuddy Atlas Creator"
~ Tiles tore now uses database (BerkelyDB) instead of tile files in file
system
+ Old tiles saved in the tile store are checked and updated when used
(displayed in map view or used in an atlas). Updating is done via
expiration settings - those provided by the server or otherwise user
specified.
+ Atlas output directory can be specified via settings dialog
+ AndNav and OSMTracker: Tile format conversion (JPG <->PNG) implemented
including color reduction
~ Docelu.pl can update it's base URL like the Google map sources do
~ Pause/resume button now works while map creation (not only while download)
+ New experimental map source: Turaterkep (Hungary hiking)
Uses tiles of size 512x512 (not supported by all atlas formats)
+ Multi-layer map sources such as Google Hybrid or OSM Hiking with relief
background can be used with all atlas creators
+ New map: NearMap Australia (high-resolution aerial images for Australia)
! GPX addWpt: Multiple way points added by one mouse click fixed
! Start.sh/Start.cmd Java max heap setting was ignored by Java because of
the position at the end of the command line
! #2904937 and #2905182 1px map calibration bug
+ New map source: Humbermedia Bavaria
+ New atlas format: Mobile Trail Explorer Cache (writes single MTECache file
per atlas)
+ New map sources: (Norway) Statkart Topo2, Toporaster2 (limited to 10.000
tiles per day and IP)
+ Drag & Drop for maps in "Atlas content" tree
+ New atlas format: Magellan RMP / VantagePoint
+ New atlas format: Touratech QV
! Fixed #2913874: ArrayIndexOutOfBoundsException in PNG 4-bit writer
+ New map source: Eniro.com map/aerial/nautical (Sweden, Norway, Finland)
+ Checkbox added in atlas progress dialog for ignoring all download errors
+ New atlas format: CacheWolf (as one large 24bit png + WFL or tiled with
multiple WLF files using the configured image format and tile size)
+ New map source: Mapplus.ch (Switzerland)
+ Coordinate format changeable ("deg" / "deg,min" / "deg,min,sec")
+ New atlas format: CacheBox
+ New atlas format: Garmin Custom Map
Image downscaling uses bilinear filter (improves image quality)
+ Each map source has now a background color (usually black) that is used
in case of missing tiles
+ Content-type check after download (HTTP header and image data header)
+ New map source: Ovi/Nokia Maps
+ New map source: Bergfex (Austria)
! Grid paint juddering on high zoom levels fixed
~ OpenStreetMap Hiking updated
1.6.1: (2009-10-30)
! Loading and saving of GPX failed
1.6: (2009-10-27)
+ Loading & saving of GPX 1.1 files (way- track- and routepoints are displayed
as overlay)
+ GPX 1.0 files are automatically transformed to GPX 1.1 file on load
+ Route and tracks are painted as connected line
+ Add new way points to a GPX file (properties: lat, lon, name)
+ Map scale bar added (metric/imperial selectable)
+ New atlas format: Mobile Trail Explorer (MTE)
+ New atlas format: RMaps / BigPlanet SQLite (Android applications, requires
additional SQLite libraries)
+ New atlas format: OSMTracker
+ New map source: OpenStreetMap Public Transport (öpnvkarte.de)
+ New map source: AustrianMap (z14 & z15 of www.austrianmap.at)
[provided by Guenther Hoelzl]
+ New map sources: Freemap Slovakia (normal, hiking & hiking plus hill shade)
+ New map sources: Google Maps Korea
+ New map sources: Open Piste Map (openpistemap.org)
+ New atlas format: Maverick (Android application)
+ New map sources: Emapa.pl (Poland)
+ New atlas format: Glopus (PNG & KAL)
+ New map sources: Outdooractive.com Austria and South Tyrol
~ Max zoom level of Google Maps increased from 17 to 19
~ Behavior on adding new maps and layers changed: the number of layers has
been reduced to a minimum making it easier switch between different zoom
levels when using TrekBuddy
! Extreme performance break-in in grid-mode fixed
! Map selections do no longer unwanted enlarge itself in grid mode beyond the
selected grid
1.5: (2009-08-01)
+ Flexible atlases containing different areas of multiple map sources are possible
+ New atlas output format: AndNav - Android Navigation System http://www.andnav.org
+ Atlas download can be paused/resumed interactively
+ Proxy settings rewritten - now system/Java wide or application settings can be
used alternatively to the user defined proxy
+ New regional map sources (Poland): ump.waw.pl and docelu.pl
+ Map sources can now be disabled which hides them from the list
+ Merging different layers via drag & drop
+ Custom map sources can be defined via settings.xml (see README.HTM)
+ Map sources manual online update via settings dialog
+ New atlas format: OziExplorer / large PNG export
~ Java requirement has changed: Now at least Java 1.6 is required!
~ Profile saving updated to new atlas structure
~ Fullscreen mode is currently unavailable
~ Google Maps, Earth, Mapmaker, Maps China url updated
~ Settings.xml format has changed
~ Max zoom for Cycloatlas changed from 14 to 15
~ Removed OpenArialMap map source
~ Panels on the left can be collapsed to save space
! Editing the atlas content while map creation in progress resulted in
unusable/abnormal atlases (see bug #2819613)
1.1: (2009-05-13)
+ New output format: JPEG with different quality levels
+ added map source Microsoft Maps China (Ditu)
~ Fixed url and name of Cykloatlas (fixes also bug #2755108)
~ Updated url of Google Map Maker & Earth
~ Fixed tar creation which had problems with default charset on some systems
~ Changed the color depth selector to an output format selector
~ OSM Hiking map moved to new server - url adapted
! "Open atlas folder" does now work on Linux (Gnome and may be Kde)
1.0: (2009-04-10)
+ Reload current map view by pressing "F5"
+ First experimental implementation of color reducing implemented (requires
additional library "Java Advanced Imaging": https://jai.dev.java.net/binary-builds.html
Download the library and place the Jar[s] in the same directory as TrekBuddyAtlasCreator
+ Experimental: Color reduced (<16) png files are saved using an own implementation
that writes real 4 bit PNG files (instead to the default Java one that only creates
8 bit or true color files)
+ added map source OSM hiking: http://opentiles.com/nop/
+ added map source OpenArialMap
~ Maximum map size reduced to 32767 (1 pixel less)
~ Atlas output format can now be specified: Tared or untared atlas. The created atlas
is always created in the folder "atlases" - the folder "atlasestared" is no longer used.
~ "ozi" / "tac_tmp" directory no longer used. Instead one temporary tar file per map
layer is created (and later deleted) in the default system temp directory
~ fixed GoogleMapMaker map source
! Loading tile store information in settings dialog blocked GUI
0.9.7: (2009-03-05)
+ New map sources (full support): Microsoft Maps, Earth, Hybrid,
Cycloatlas (Czech Republic only)
+ New map sources (partial support): Multimap.com
+ Window position, size and state (maximized or not) is saved
+ Preview map allows zoom move/zoom via keyboard controls (patch by Martin Loetzsch)
+ Fullscreen mode hides left panel and places control inside the preview map
(patch by Martin Loetzsch)
~ Google Maps, Earth & MapsChina urls updated
~ Custom tile size selection controls combined
~ Fixed several Swing thread safety problems (patch by Martin Loetzsch)
0.9.6: (2009-01-08)
+ New map source: Google Terrain
+ Download error counter added to atlas progress dialog
! Updated OpenCycleMap url (fixes zoom level > 13)
+ New map source: Yahoo Maps
+ New map source: Google Maps China (Ditu)
+ New map source (Germany only): Outdooractive.com
+ Selected/entered tile size is now saved/restored in/from settings.xml
+ Tooltip of "tiles-to-download-counter-label" (located right to the label
"Zoom levels (..)") now shows the breakdown of the number of tiles
to the different zoom levels including the area calculation
~ Exceptions that occur while downloading/creating an atlas are now displayed
in an dialog showing detailed information about the system and the exception
~ Updated Google Maps url & removed "Galileo" appendix
~ New experimental implementation for creating tile of custom size.
Disdvantage: Much slower that the algorithm before
Advantage: Only constant memory needed (approx. less than 10 MB)
~ Using custom tile size now does not concert the tiles to png format.
Instead the format used by the maps source is used.
0.9.5: (2008-10-27)
+ Detailed log files can be created by providing a configuration file log4j.xml
(see README.txt for details).
+ HTTP Proxy (host & port) can be specified via GUI
+ Added information about amount of tiles and total size for each tile source store
in Settings window.
+ Multithreaded download of tiles implemented (number of parallel download threads
changeable via settings dialog
~ Tile download system now reuses HTTP connections for HTTP 1.1 servers instead of
opening a new TCP connection for each tile
! Selection of whole world resulted in a wrong max longitude (-180 instead of 180)
! Tile number and index calculations near to the border of the world corrected
! Saving profiles works now (including map source, zoom levels and tile size)
! Aborting of stalled downloads works now as expected
0.9.1: (2008-10-17)
! Fixed wrong calculation of number of tiles when the amount was large.
0.9 alpha: (2008-10-15)
+ Added resizeable GUI
+ Added possibility to select map area by selection an area with mouse
+ Added tmi files for the tared atlases which make the map loading faster
~ Changed preview viewer to JMapViewer. It has several advantages:
different map sources
preview loads in background automatically
easy zooming (mouse wheel) and movement (right mouse button)
~ Tar generation rewritten, each tar is now only opened one time, not
once for each tile to be added (increases tar creation in case of a virus
scanner being active)
0.8:
+ Added xml based settings file via Java Properties
+ Added possibility to change tile size for the downloaded tiles.
+ Added possibility to set map size in atlas. Giving the possibility to create
large atlases
! Fixed the non working setting tile store enabled. It was always enabled,
despite of what was written in the settings file
! Fixed (hopefully) the generation of mixed up atlases at some Linux operating
system(s).
! Fixed bugs related to defect profiles in profiles.xml file by adding some
validation of the xml data at application start.
0.7:
+ Added possibility to abort an ongoing download of Atlas
+ Added label that shows how many tiles that will be downloaded with current
lat, long & zoom settings
+ Added persistent tile store (cache of tiles in a store which is persistent
between program sessions)
! Fixed wrong download link to ditu.google.com
0.61:
+ Added a possibility to select to download tiles from either ditu.google.com
or maps.google.com
! Fixed hard coded look and feel, which resulted in an
javax.swing.UnsupportedLookAndFeelException at other environments then Windows

View File

@ -1,4 +0,0 @@
increased tile limit to 1 million
added the default open street map server
included sqlite driver by default
removed some broken mapsources that i didnt feel like fixing

6
MOBAC.cmd Normal file
View File

@ -0,0 +1,6 @@
@Echo off
REM This file will start the TrekBuddy Atlas Creator with custom memory settings for
REM the JVM. With the below settings the heap size (Available memory for the application)
REM will range up to 1200 megabyte.
start javaw.exe -Xms64M -Xmx1200M -jar Mobile_Atlas_Creator.jar

Binary file not shown.

207
README-DEV.html Normal file
View File

@ -0,0 +1,207 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mobile Atlas Creator - Readme for Developers</title>
<style type="text/css">
body {
margin-left: 10px;
font-family: Helvetica, Arial, sans-serif;
}
h1,h2,h3,h4 {
color: #0000CC;
font-style: italic;
}
h1 {
border-bottom: solid thin black;
}
h2 {
margin-left: 20px;
}
h3 {
margin-left: 50px;
}
h4 {
margin-left: 80px;
}
pre {
margin-left: 140px;
}
p,ul,ol {
font-size: 110%;
margin-left: 100px;
}
</style>
</head>
<body>
<h1>Mobile Atlas Creator - Readme for Developers</h1>
<p>Welcome to the developer documentation of Mobile Atlas Creator
(MOBAC). First please read the <a href="README.html">standard readme</a>
for all users.</p>
<h2>Table of contents</h2>
<ul style="margin-left: 50px;">
<li><a href="#CodeAccess">Code access</a></li>
<li><a href="#BuildingMOBAC">Building Mobile Atlas Creator</a></li>
<li><a href="#Intellij">MOBAC in IntelliJ</a></li>
<li><a href="#GuidelinesCustomReleases">Guidelines for
publishing custom builds/releases</a></li>
<li><a href="#MapPacks">Map sources and map packs</a></li>
<li><a href="#CustomMapPack">Developing a custom map pack</a>
<ul style="margin-left: 10px;">
<li><a href="#MapPackBuilding">Building the map pack</a></li>
</ul>
</li>
<li><a href="#ImportantPackages">Source code overview - important packages</a></li>
<li><a href="#Participation">Participation</a></li>
</ul>
<h2><a name="CodeAccess">Code access</a></h2>
<p>If you want do get your hands on the latest source code of Mobile
Atlas Creator you can check out the code from the Subversion repository
at SourceForge:</p>
<p><a
href="https://svn.code.sf.net/p/mobac/code/trunk/MOBAC/"><tt>https://svn.code.sf.net/p/mobac/code/trunk/MOBAC/</tt></a>
</p>
<p>There you will find the latest sources of Mobile Atlas Creator in form of an Gradle project which can be imported for
example into IntelliJ.
All sources, tools and build files are included in this repository.
Java libraries are automatically retrieved from Maven central repository.
</p>
<h2><a name="BuildingMOBAC">Building Mobile Atlas Creator</a></h2>
<p>
If you want to compile MOBAC, an installation of Java Development Tools (JDK) is required.
Using OpenJDK version 8 or 11 is recommended.
For building MOBAC use the provided gradlew command-line script:
</p>
<pre>
# Linux/MacOS:
chmod u+x gradlew
./gradlew dist
# Windows
gradlew dist
</pre>
<h2><a name="Intellij">MOBAC in IntelliJ</a></h2>
<p>The main class for starting MOBAC in IntelliJ is in module <tt>mobac-run</tt> class <tt>mobac.StartMOBACdev</tt></p>
<h2><a name="GuidelinesCustomReleases">Guidelines for
publishing custom builds/releases</a></h2>
<p>If you modify Mobile Atlas Creator and you want to publish it
yourself please consider the following guidelines:</p>
<ol>
<li>Chose a version/release name that makes it clear that it is
not an official release: Change the version string to reflect that.<br>
Example: <tt>2.2 beta 3 XYZ edition</tt><br>
The version string is located in the file <tt>/build.gradle</tt>.
Change the entry <b>version ...</b> to your custom release name.
</li>
<li>Do not forget that Mobile Atlas Creator is a GPL project -
therefore publishing the source code together with the binary release
should went without saying.
</li>
<li>If your modification is useful you may consider to present it
to the Mobile Atlas Creator development team. <a
href="https://sourceforge.net/p/mobac/patches/">Patches</a>
are always welcome. Useful modifications have a great chance to be
integrated into the main branch.
</li>
</ol>
<h2><a name="MapPacks">Map sources and map packs</a></h2>
<p>Since version v1.9 map sources are no longer part of <tt>Mobile_Atlas_Creator.jar</tt>.
All map sources implementation are located in jar files in the <tt>mapsources</tt>
sub-directory. Those map sources implementation packages are called
"map-packs". Map packs files always starts with the term <tt>mp-</tt>
and they end with the term <tt>.jar</tt>.</p>
<p>For implementing new map sources in a development environment
like Eclipse it is sometimes faster to load the map sources directly
from class-path rather from the map-packs. You can enable it by setting
<tt>devmode</tt> in <tt>settings.xml</tt> to <tt>true</tt>. Afterwards
map sources will be loaded directly from the <tt>bin</tt> directory of
Eclipse (if available).</p>
<h2><a name="CustomMapPack">Developing a custom map pack</a></h2>
<p>For creating your own custom map pack you have to create a new module (Java)
inside <tt>/mappacks</tt>. for example <tt>/mappacks/mymappack</tt></p>
<p>Place the map source code in directory <tt>/mappacks/mymappack/src/main/java/mobac/mapsources/mappacks/mymappack</tt>
</p>
<p>Additionally you have to create a text file named <tt>mobac.program.interfaces.MapSource</tt>
inside the directory <tt>src/main/resources/META-INF/services/</tt>. This
file contains a list of class names (full class name including the
package name, one per line) that should be loaded by MOBAC as map
source.</p>
<p>Background: During the build process this file will be included
into the map-pack jar as <tt>META-INF/services/mobac.program.interfaces.MapSource</tt>
so that it can be found by the <a
href="http://download.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html">ServiceLoader</a>.
</p>
<h3><a name="MapPackBuilding">Building the map pack</a></h3>
<p>Map packs can be built separately using <a
href="http://ant.apache.org/">Apache Ant</a> and the build target <b>build_mapsources</b>:</p>
<pre>ant build_mapsources</pre>
<p>Apache Ant is already included in Eclipse, so that you only have
to select the file <tt>build.xml</tt>, press the right mouse button and
select <b>Run As</b> - <b>Ant Build...</b>. In the dialogs that opens
deselect the build target <b>all</b> and select instead <b>build_mapsources</b>.</p>
<p>Each sub-package of <tt>mobac.mapsources.mappacks</tt> will be
compiled and packed to an map package. The created map packages are
saved into the <tt>mapsources</tt> directory. Therefore our example map
pack will be packed into the file <tt>mapsources/mp-mymappack.jar</tt></p>
<h2><a name="ImportantPackages">Source code overview - important packages</a></h2>
<h3><a href="src/main/java/mobac/gui">mobac.gui</a></h3>
<p>This package contains the implementation of all dialogs/windows.
In the sub-packages you can find the related implementations of used
graphical components - e.g. <tt><a
href="src/main/java/mobac/gui/mapview/PreviewMap.java">mobac.gui.mapview.PreviewMap</a></tt>
- the component that draws the movable map background used by Mobile
Atlas Creator.</p>
<h3><a href="src/main/java/mobac/mapsources">mobac.mapsources</a></h3>
<p>Holds the infrastructure and the implementation of all map
sources available within Mobile Atlas Creator. For implementing own map
sources that uses an online map you should derive your map source from
the abstract base class <a
href="src/main/java/mobac/mapsources/AbstractHttpMapSource.java"><tt>mobac.mapsources.AbstractHttpMapSource</tt></a>.
Map sources should be compiled and packed to a map pack so that they can
be automatically detected and loaded while MOBAC is starting-up. For
details on that topic please read section <a href="#CustomMapPack">Developing
a custom map pack</a>.</p>
<h3><a href="src/main/java/mobac/program/atlascreators">mobac.program.atlascreators</a></h3>
<p>Holds the implementations of all atlas creators (atlas output
formats) provided by Mobile Atlas Creator. Each class in the package
implements exactly one atlas output format. Of special interest is the
abstract class <a
href="src/main/java/mobac/program/atlascreators/AtlasCreator.java">AtlasCreator</a>
which is the super class every atlas creator is derived of. The list of
available formats is maintained in the enumeration <a
href="src/main/java/mobac/program/model/AtlasOutputFormat.java"><tt>mobac.program.model.AtlasOutputFormat</tt></a>.
</p>
<h3><a href="src/main/java/mobac/tools">mobac.tools</a></h3>
<p>This package contains additional stand-alone tools that are not
shipped with the Mobile Atlas Creator binary release. For example the <a
href="src/main/java/mobac/tools/MapSourcesTester.java"><tt>mobac.tools.MapSourcesTester</tt></a>
downloads one tile from each map source for verifying that the map
source is functional.</p>
<h2><a name="Participation">Participation</a></h2>
<p>If you are familiar with the programming language Java and you
want to contribute or participate in the development process of Mobile
Atlas Creator feel free to contact one of the other developers of
<a href="https://sourceforge.net/projects/mobac/">Mobile Atlas Creator</a>.</p>
</body>
</html>

1521
README.html Normal file

File diff suppressed because it is too large Load Diff

733
README.md
View File

@ -1,729 +1,18 @@
# Mobile Atlas Creator UNLOCKED
# mobac-unlocked
I modified MOBAC to do some things:
* Increased tile limit to 1 million (should be more than enough for 99% of applications)
* Added the default open street map server (doesn't work)
* Included SQLite driver by default
* Removed some broken mapsources
*MOBAC with an increased tile limit and questionable map sources.*
Right now, this is MOBAC version 1.9.16.
I modified MOBAC to do some special things:
# Original Readme
- Increased tile limit to 2 million.
- Added a few "questionable" map sources.
Welcome to Mobile Atlas Creator read-me file for end users.
## Original README
Before January 2010 this project was known as "TrekBuddy Atlas Creator".
[README.html](https://git.evulid.cc/cyberes/mobac-unlocked/src/branch/master/README.html)
Mobile Atlas Creator is an open source project hosted on SourceForge.net:
[http://mobac.sf.net](http://mobac.sf.net)
## Build
## Table of contents
* [License](#License)
* [Description](#Description)
* [Requirements](#Requirements)
* [Java Advanced Imaging" (JAI)](#JAI)
* [Installation](#Installation)
* [Application start](#Start)
* [The different atlas formats](#AtlasFormats)
* [AFTrack (OSZ)](#AFTrackOSZ)
* [AlpineQuestMap (AQM)](#AlpineQuestMap)
* [AndNav](#AndNav)
* [Big Planet Tracks](#BigPlanet)
* [CacheWolf](#CacheWolf)
* [Garmin Custom maps](#GarminCustom)
* [Glopus](#Glopus)
* [Glopus Map File / AFTrack (GMF)](#GMF)
* [Google Earth Overlay (KMZ)](#KMZ)
* [Magellan RMP](#Magellan)
* [MAPLORER](#MAPLORER)
* [Maverick](#Maverick)
* [MGMaps](#MGMaps)
* [Mobile Trail Explorer (MTE)](#MTE)
* [NaviComputer](#NaviComputer)
* [nfComPass](#nfComPass)
* [OruxMaps](#OruxMaps)
* [OSMAND](#OSMAND)
* [Osmdroid](#Osmdroid)
* [OSMTracker](#OSMTracker)
* [OziExplorer / large PNG image](#Ozi)
* [PathAway](#PathAway)
* [RMaps](#RMaps)
* [[Nokia] Sports Tracker](#SportsTracker)
* [TomTom Raster](#TomTomRaster)
* [Touratech QV](#TTQV)
* [TrekBuddy](#TrekBuddy)
* [TwoNav (RMAP)](#TwoNav)
* [Viewranger](#Viewranger)
* [Enhancement requests](#Enhancement)
* [Problems, Bugs & Errors](#Bugs)
* [Known problems and limitations](#Limitations)
* [Details for advanced users](#AdvancedUsers)
* [Specifying directory configuration](#DirectoryConfig)
* [Moving the tile store directory](#TileStoreDir)
* [Starting external tools from within MOBAC](#ExternalTools)
* [Custom map sources](#CustomMapSource)
* [Simple custom map sources](#SimpleCustomMapSource)
* [Custom WMS map sources](#CustomWMSMapSource)
* [Custom multi-layer map sources](#CustomMultiLayerMapSource)
* [Custom CloudMade map sources](#CloudMadeMapSource)
* [Custom BeanShell map sources](#BeanShellMapSource)
* [Custom MapPack](#CustomMapPack)
* [Custom atlas as map source / locally generated tiles](#FileBased)
* * *
## <a name="License">License</a>
Mobile Atlas Creator is under GNU General Public License Version 2 (GPL). For details on the GPL see the license file [gpl.txt](gpl.txt).
The source code is available on the [SourceForge.net](http://sourceforge.net/projects/mobac/files/) for download and in the [project's source code Subversion repository](http://sourceforge.net/p/mobac/code/).
## <a name="Description">Description</a>
Mobile Atlas Creator creates atlases for several applications. For example [TrekBuddy](http://www.trekbuddy.net) and [Mobile Trail Explorer (MTE)](http://code.google.com/p/mobile-trail-explorer/), the Android applications [AndNav](http://www.andnav.org/), [Maverick](http://www.codesector.com/maverick.php), [Big Planet Tracks](http://code.google.com/p/big-planet-tracks/), [RMaps](http://robertdeveloper.blogspot.com/search/label/rmaps.release), [OruxMaps](http://www.oruxmaps.com/), the Pocket PC application [Glopus](http://www.glopus.de/) and the commercial Windows application [OziExplorer](http://www.oziexplorer.com/). The map image created for OziExplorer can also be used with any PNG capable image viewer (map image in one large PNG file).
## <a name="Requirements">Requirements</a>
This application requires that a Java Runtime Environment Version 6 Update 14 (v1.6.0_14) or higher is installed on the computer.
If you have the choice between different Java Runtimes you should prefer the Java Runtime provided by Sun/Oracle. Especially the OpenJDK has some bugs regarding MOBAC and tends to crash on certain situations.
### <a name="JAI">Java Advanced Imaging (optional)</a>
For reducing the color depth of downloaded tiles the library files ( <tt>jai_core.jar</tt> and <tt>jai_codec.jar</tt> ) of the "Java Advanced Imaging" (JAI) have to be present on the system respectively in the same directory as Mobile_Atlas_Creator.jar. Ready to use binary builds of the Java Advanced Imaging library can be obtained at [http://download.java.net/media/jai/builds/release/1_1_3/jai-1_1_3-lib.zip](http://download.java.net/media/jai/builds/release/1_1_3/jai-1_1_3-lib.zip)
## <a name="Installation">Installation</a>
Copy or move the unzipped files to a folder where you would like to have Mobile Atlas Creator installed. On computers running Windows please make sure **not to install MOBAC into <tt>Program Files</tt> sub-directory!**
## <a name="Start">Application start</a>
### Windows
The application is started by executing the <tt>Mobile Atlas Creator.exe</tt> . During the first application start all necessary files and folders are automatically created by the application.
### Linux and OSX
You can start MOBAC by executing the start-up script <tt>start.sh</tt> . Before starting MOBAC the first time it may be necessary to set the executable bit for <tt>start.sh</tt> e.g. by executing the following command:
<pre>chmod u+x start.sh</pre>
During the first application start all necessary files and folders are automatically created by the application.
* * *
## <a name="AtlasFormats">The different atlas formats</a>
### <a name="AFTrackOSZ">AFTrack OSZ</a>
For creating atlases compatible with AFTrack (Symbian S60) you have to select **AFTrack (OSZ)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
OSZ is a ZIP-archive. Within this zip archive a (large) number of tiles with the calibrated folder structure (coordinates) are stored. OSZ only works if each tile has got a resolution of 256x256 Pixels. So be sure to uncheck **Recreate/adjust map tiles (CPU intensive)**.
The output format is one file for each layer in the corresponding folder.
#### <a name="AFTrackOSZRestriction">Restrictions</a>
Depending on the device free memory the file maybe not work. So more then 80000 tiles should not be used.
### <a name="AlpineQuestMap">AlpineQuestMap (AQM)</a>
Sorry no further details are available for this atlas format.
### <a name="AndNav">Creating and using atlases with AndNav</a>
For creating atlases compatible with AndNav you have to select **AndNav atlas format** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
As atlases for AndNav do not support all features provided by Mobile Atlas Creator the following settings are ignored when creating atlases for AndNav:
* Change height or width of the map tiles
* Name of all layers and maps
* Structure of the atlas (which maps belongs to which layer)
### <a name="BigPlanet">Creating and using atlases with Big Planet Tracks</a>
For creating offline atlases compatible with [Big Planet Tracks](http://code.google.com/p/big-planet-tracks/) (Android application) you have to select **Big Planet Tracks SQLite** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
The atlas format BigPlanet SQLite does not support all features provided by Mobile Atlas Creator the following settings can not be used or are ignored when creating atlases using this output format:
* Recreate/adjust map tiles with custom tile size (height and
* Name of all layers and maps
* Structure of the atlas (which maps belongs to which layer)
* Atlases created after another are merged into one Database named <tt>[Atlasname] atlas.sqlitedb</tt> which is located in the atlas output directory.
### <a name="CacheWolf">Creating atlases for CacheWolf</a>
For creating atlases compatible with [CacheWolf](http://www.cachewolf.de) you have to select **CacheWolf WFL** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
#### Custom tile processing settings enabled
Maps that have custom tile processing options set are saved as tiled images with one WFL calibration file for each tile. All processing options such as image format and tile size can be used.
#### Custom tile processing settings disabled
In this mode automatic tiling is disabled and the same [restrictions](#OziRestriction) and the [warning](#OziWarning) as for the OziExplorer output format apply.
The output format of an "atlas" for CacheWolf is one subdirectory per layer and within this subdirectory one <tt>PNG</tt> image and one <tt>WFL</tt> file per defined map.
### <a name="GarminCustom">Creating Garmin Custom maps</a>
For creating atlases of Creating Garmin Custom maps you have to select **Garmin Custom Map (KMZ)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
Details about the Garmin Custom Map format can be found in the [Garmin Forums](https://forums.garmin.com/forumdisplay.php?f=205)
Using this atlas output format the following features are ignored when creating atlases:
* Recreate/adjust map tiles (custom tile size and image format)
The output format of an "atlas" for Garmin Custom maps is one <tt>KMZ</tt> file per layer containing all maps (max 100) as seperate <tt>JPG</tt> image files. The JPEG compression rate can be specified for each map/image using image format selector in the custom tile processing section. The Garmin Custom Map format defines a maximum image size of 1024x1024 pixels. If a map is larger it will be automatically scaled down to fit into this size. You can prevent scaling when setting the max map size in the settings dialog to 1024.
### <a name="Glopus">Creating atlases for Glopus</a>
For creating atlases compatible with Glopus you have to select **Glopus (PNG & KAL)** or **Glopus Map File (GMF)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
#### Glopus (PNG & KAL)
Using this atlas output format the same [restrictions](#OziRestriction) and the [warning](#OziWarning) as for the OziExplorer output format apply.
The output format of an "atlas" for Glopus is one subdirectory per layer and within this subdirectory one <tt>PNG</tt> image and one <tt>KAL</tt> file per defined map.
#### Glopus Map File (GMF)
Within this file a (large) number of tiles with its calibrated coordinates are stored. Glopus works best if each tile has a resolution of 1024x1024 pixels. So check **Recreate/adjust map tiles (CPU intensive)**. Width and height should be set to **1024**.
The output format is one file for each layer in the corresponding folder.
### <a name="GMF">Glopus Map File (GMF) / AFTrack</a>
For creating atlases compatible with AFTrack (Symbian S60) you have to select **Glopus Map File (GMF)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
Within this file a (large) number of tiles with its calibrated coordinates are stored. AFTrack works best if each tile has got a resolution of 256x256 Pixels. So uncheck **Recreate/adjust map tiles (CPU intensive)**.
The output format is one file for each layer in the corresponding folder.
#### <a name="AFTrackRestriction">Restrictions</a>
AFTrack can handle a maximum of 4096 tiles - so be sure not to select more.
### <a name="KMZ">Google Earth Overlay (KMZ)</a>
For creating Google Earth Overlays you have to select **Google Earth Overlay (KMZ)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
Using this atlas output format the following features are ignored when creating atlases:
* Recreate/adjust map tiles (custom tile size and image format)
#### Warning
The Google Earth Overlay atlas format uses JPG images. The image size depends on the selected maximum map size (see settings dialog). The theoretical maximum map size for this atlas format is 25000\. However it is **strongly recommended not to set the maximum map size higher than 10000** (this will result in a image with uncompressed size about 286 MB).
### <a name="Magellan">Creating Magellan RMP atlases</a>
For creating atlases of Creating Garmin Custom Maps you have to select **Magellan (RMP)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
Using this atlas output format the following features are ignored when creating atlases:
* Recreate/adjust map tiles (custom tile size and image format)
Additionally some other limitations may apply, based on which device and firmware version you are using. Mobile Atlas Creator does not chek those limitations - therefore it may work or not if you are using:
* An atlas with more than 5 maps.
* Maps with a zoom level higher than 15.
The output format of an "atlas" for Magellan is one <tt>RMP</tt> file in the atlas directory. You can directly load this file in Magellan VantagePoint or transfer it onto your device.
### <a name="MAPLORER">Creating atlases for MAPLORER</a>
For creating atlases compatible with [MAPLORER](http://maplorer.com) you have to select the **Maplorer atlas format** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**). You have to choose **JPG image format** under **Layer settings/tile format** (PNG is not supported by Maplorer).
There are no specific limits on tile sizes and/or numbers; good results for hiking/biking can be obtained using zoom level 15, custom tile size of 1024x1024 (check **Recreate/adjust map tiles (CPU intensive)** under **Layer settings**. For good performance, avoid using too big or too many tiles (the maximum number of columns in Maplorer is currently 26 ('A' to 'Z'), but it is preferable to use less).
After defining the maps and layers (select region and click **Add selection** under **Atlas Content)** for the atlas, click the button Create Atlas. Once atlas download and creation has completed, all necessary files belonging to the atlas can be found in the directory <tt>atlases\[atlas name]_[current date and time]</tt> .
To install the atlas on your device, simply connect it to your PC and copy the content of the respective atlas subdirectory (i.e. all .jpg and .pos files generated) to the Maplorer directory (the one which contains maplorer.exe) on your device. Starting Maplorer on the device will automatically read all tiles and create the index map. Detailed instructions on making maps for Maplorer can be found at [http://maplorer.com](http://maplorer.com)
### <a name="Maverick">Creating and using atlases with Maverick</a>
For creating atlases compatible with Maverick you have to select **Maverick atlas format** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
As atlases for Maverick do not support all features provided by Mobile Atlas Creator the following settings are ignored when creating atlases for AndNav:
* Recreate/adjust map tiles (custom tile size and image format)
* Name of all layers and maps
* Structure of the atlas (which maps belongs to which layer)
For further information how to use offline atlases with Maverick please see [Maverick Online Help on Setting up offline maps](http://help.codesector.com/MapsCache).
### <a name="MGMaps">Creating and using atlases with MGMaps</a>
For creating atlases compatible with MGMaps you have to select **MGMaps** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**). Select a name for the maps, this is important as you will use it to view the maps in MGMaps.
#### How to copy the maps to your device
1. Create a folder named <tt>MGMapsCache</tt> in the root of you device or memorycard
2. Copy the created folders into this MGMapsCache folder so the directory structure looks like:
<pre>MGMapsCache
MGMapsCache\cache.conf
MGMapsCache\macos_10
MGMapsCache\macos_11
MGMapsCache\macos_12
MGMapsCache\macos_10\59_53.mgm
MGMapsCache\macos_11\150_106.mgm
MGMapsCache\macos_11\150_107.mgm
MGMapsCache\macos_11\151_106.mgm
MGMapsCache\macos_11\151_107.mgm
MGMapsCache\macos_12\365_213.mgm
MGMapsCache\macos_12\365_214.mgm
MGMapsCache\macos_12\366_213.mgm
MGMapsCache\macos_12\366_214.mgm
</pre>
#### How to set up MGMaps to use the maps
1. Select Settings/Map/Stored Maps, Click on the two boxes labelled Stored Maps and Offline Mode. The first box enables the use of stored map mode. The second box prohibits the use of the mobile phones Internet connect to download live maps. You can leave this unchecked if you want. stored maps folder: now tell MGMaps where you have stored the map tile files. in my case SDCard/MGMapsCache.
2. Select Settings/Map/Map types, select options/add custom map,in map type name enter the name of the map you created using MAC in my case macos, map type url you can leave blank, select ok/options/save MGMaps will then apply the settings and display your created map.
#### Warning
Avoid using names native to MGMaps such as google, each name used must be defined as a custom map so the directory structure below must have macos,macroad and macsat defined as custom map types.
<pre>MGMapsCache MGMapsCache\cache.conf MGMapsCache\macos_10
MGMapsCache\macos_11 MGMapsCache\macroad_11 MGMapsCache\macsat_11
MGMapsCache\macos_12 MGMapsCache\macroad_12 MGMapsCache\macsat_12
</pre>
### <a name="MTE">Creating and using atlases with Mobile Trail Explorer (MTE)</a>
For creating atlases compatible with Mobile Trail Explorer you have to select **Mobile Trail Explorer Cache** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
If a map source uses an image format different to PNG the tiles will be automatically converted to the PNG format.
The output is one <tt>MTEFileCache</tt> file per atlas which contains all maps. An existing cache file can not be updated. If you want to add maps to an existing <tt>MTEFileCache</tt> please use the atlas format **Mobile Trail Explorer** which creates a file structure identical to JTileDownloader and then process the maps using [MTE CacheCreator](http://code.google.com/p/mobile-trail-explorer/wiki/CacheCreator).
As atlases for Mobile Trail Explorer does not support all features provided by Mobile Atlas Creator the following settings are ignored when creating atlases for Mobile Trail Explorer:
* Recreate/adjust map tiles (custom tile size and image format)
* Name of all layers and maps
* Structure of the atlas (which maps belongs to which layer)
### <a name="NaviComputer">Creating atlases for NaviComputer</a>
For creating atlases, compatible with NaviComputer, you have to select **NaviComputer (NMAP)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
After defining the maps and layers for the atlas to be created, start atlas download and creation via the button **Create Atlas**. Once download and creation has completed, the generated file with the extension nmap can be found in the MOBAC output directory. This *.nmap-file is the required input file for NaviComputer.
### <a name="nfComPass">Creating atlases for nfComPass</a>
For creating atlases, compatible with [nfComPass](http://www.navifriends.com/phpbbForum/viewtopic.php?f=3&t=17004), you have to click **Atlas -> New Atlas**, select **nfComPass** and give your Atlas a name.
By default atlases with a tilesize of 64x64 are created (recommended). For different tile sizes check **Recreate/adjust map tiles (CPU intensive)** under Layer settings. Set Tileformat can not be changed - it is always png. Maybe you must tryout, what is the best tilesize for your device. Choose your layer and zoomlevels and click **Add selection**. Then click **Create atlas**. Once download and creation has completed, the generated folders can be found in the MOBAC output directory. You must copy the data from the <tt>nfComPass.dat</tt> to your nfComPass.dat and fill in the path to your mapdirectory. After that, copy the folder(s) to your device. If it is possible, you should not copy the files with Active Sync to your device.
### <a name="OruxMaps">Creating OruxMaps atlases</a>
For creating atlases compatible with [OruxMaps](http://www.oruxmaps.com) as format you have to select **OruxMaps** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
Using this atlas output format the following features are ignored when creating atlases:
* Layer settings, custom tile size. OruxMaps always uses 512x512 tile size. You can select the tile format (PNG or JPEG). If you do not select any, default value is JPEG - quality 90.
The output format of an "atlas" for OruxMaps is one or more map directories in the atlas directory. You have to copy those maps onto your device (default directory: /oruxmaps/mapfiles/).
### <a name="OSMAND">Creating atlases for OSMAND</a>
For creating atlases compatible with OSMAND you have to select **OSMAND tile storage** or **OSMAND SQlite** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
As atlases for OSMAND do not support all features provided by Mobile Atlas Creator the following settings are ignored when creating atlases for OSMAND:
* Change height or width of the map tiles
* Name of all layers and maps
* Structure of the atlas (which maps belongs to which layer)
### <a name="Osmdroid">Creating atlases for Osmdroid</a>
For creating atlases compatible with Osmdroid you have to select either **Osmdroid ZIP**, **Osmdroid SQLite** or **Osmdroid GEMF** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
The mentioned three formats are "single file" atlases. One of the other possible atlas formats might also be acceptable for Osmdroid. Also, there is other software that is able to deal with GEMF archives.
As atlases for Osmdroid do not support all features provided by Mobile Atlas Creator the following settings are ignored when creating atlases for Osmdroid:
* Change height or width of the map tiles
* Name of all layers and maps
* Structure of the atlas (which maps belongs to which layer)
### <a name="OSMTracker">Creating atlases for OSMTracker</a>
For creating atlases compatible with OSMTracker you have to select **OSMTracker tile storage** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
As atlases for OSMTracker do not support all features provided by Mobile Atlas Creator the following settings are ignored when creating atlases for OSMTracker:
* Change height or width of the map tiles
* Name of all layers and maps
* Structure of the atlas (which maps belongs to which layer)
### <a name="Ozi">Creating and using atlases with OziExplorer / large PNG image export</a>
For creating atlases compatible with OziExplorer you have to select **OziExplorer (PNG & MAP)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
#### <a name="OziRestriction">Restrictions</a>
As OziExplorer does not support tiled maps some features are ignored when creating atlases in this format:
* Image output format is fix: 24bit PNG
* Recreate/adjust map tiles custom tile is ignored
The output format of an "atlas" for OziExplorer is one subdirectory per layer and within this subdirectory one <tt>PNG</tt> image and one <tt>MAP</tt> file per defined map. For opening a map in OziExplorer select the menu **File****Load from File****Load from MAP file**, browse to the layer directory of the created atlas and select the MAP file.
If you are only interested in the map image you can safely delete the created map file.
#### <a name="OziWarning">Warning</a>
Mobile Atlas Creator uses a highly sophisticated and optimized algorithm for creating the PNG files for OziExplorer use. This algorithm allows to create very large maps images at low memory usage. OziExplorer and most image viewers do not use such sophisticated algorithms which can lead to the situation that you can create very large map images - but OziExplorer and other image viewers are not able to open the image.
### <a name="PathAway">Creating atlases for PathAway</a>
For creating atlases compatible with PathAway you have to select **PathAway tile cache** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
As atlases for PathAway do not support all features provided by Mobile Atlas Creator the following restrictions apply when creating atlases for PathAway:
* The maximum zoom level is 16 - higher zoom levels are not possible with this atlas format
* Tile width and width can not be changed (settings will be ignored)
* Name of all layers and maps is ignored
* Structure of the atlas is ignored (which maps belongs to which layer)
### <a name="RMaps">Creating and using atlases with RMaps</a>
For creating offline atlases compatible with [RMaps](http://robertdeveloper.blogspot.com/search/label/rmaps) (Android application) you have to select **RMaps SQLite** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
The atlas format RMaps does not support all features provided by Mobile Atlas Creator the following settings can not be used or are ignored when creating atlases using this output format:
* Recreate/adjust map tiles with custom tile size (height and width have to be 256)
* Name of all layers and maps
* Structure of the atlas (which maps belongs to which layer)
* Atlases created after another are merged into one Database named <tt>[AtlasName] atlas.sqlitedb</tt> which is located in the atlas output directory.
### <a name="SportsTracker">[Nokia] Sports Tracker</a>
For creating atlases compatible with [Sports Tracker(ST)](http://www.sports-tracker.com) you have to select **Sports Tracker** (NOT GPS Sportstracker) as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
Do not select **Recreate/adjust map tiles**.
Maximum Zoomlevel of Sports Tracker is 17, default is 13.
Copy the created atlas (the whole folder) into the following folder of youre phone (depending of the Sports Tracker version):
* Sports Tracker 1.76: <tt>E:\system\data\Maps\Street\</tt>
* Sports Tracker 2.x: <tt>E:\system\data\Maps\Street\</tt>
* Sports Tracker 3.x: <tt>E:\system\data\STMaps\Street\</tt>
For changing the zoom level inside Storts Tracker press 5 to zoom in and 0 to zoom out.
### <a name="TTQV">Creating and using atlases with Touratech QV / large PNG image export</a>
For creating atlases compatible with Touratech QV you have to select **Touratech QV** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
#### <a name="TTQVRestriction">Restrictions</a>
As Touratech QV does not support tiled maps some features are ignored when creating atlases in this format:
* Image output format is fix: 24bit PNG
* Recreate/adjust map tiles custom tile is ignored
The output format of an "atlas" for Touratech QV is one subdirectory per layer and within this subdirectory one <tt>PNG</tt> image and one <tt>CAL</tt> file per defined map.
If you are only interested in the map image you can safely delete the created cal file.
#### <a name="TTQVWarning">Warning</a>
Mobile Atlas Creator uses a highly sophisticated and optimized algorithm for creating the PNG files for Touratech QV use. This algorithm allows to create very large maps images at low memory usage. Touratech QV and most image viewers do not use such sophisticated algorithms which can lead to the situation that you can create very large map images - but Touratech QV and other image viewers are not able to open the image.
### <a name="TomTomRaster">Creating atlases using TomTom Raster format</a>
TBD
### <a name="TrekBuddy">Creating and using atlases with TrekBuddy</a>
For creating atlases compatible with TrekBuddy you have to select **TrekBuddy tared atlas** or **TrekBuddy untared atlas** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
After defining the maps and layers for the atlas to be created start atlas download and creation via the button **Create Atlas**. Once atlas download and creation has completed all necessary files belonging to the atlas can be found in the directory <tt>atlases\[atlas name]_[current date and time]</tt> .
The atlas itself consists of the atlas startup file <tt>cr.tar</tt> (tar format) or <tt>cr.tba</tt> (regular/untared format) and the subdirectories containing the different maps of the atlas. For using the atlas with TrekBuddy copy the whole directory onto your J2ME device. Then use the **Load Atlas** function of TrekBuddy and open <tt>cr.tar</tt> / <tt>cr.tba</tt> (in the atlas root directory).
### <a name="TwoNav">Creating and using atlases with TwoNav & CompeGPS Land/Air</a>
To create atlases compatible with TwoNav software you have to select **TwoNav (RMAP)** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**). Atlases created for TwoNav are stored in a format called rmap. It's a binary format that holds the same map data stored at different resolutions - in order to make zooming in and out on low performance mobile devices fast and efficient. However, this causes some restrictions which have to be taken into account:
* Each map within a layer has to have the same geographical bounds.
* There only can be one map in a layer with a given zoom level
If there are several layers in one atlas, each layer will be stored as a separate rmap file.
The easiest way to create a correct atlas content is: first select the appropriate grid zoom (combobox next to the zoom slider), then pick zoom levels from the selected grid zoom up to the zoom level of the desired most detailed level, and finally add a selection to the Atlas content by clicking on the "Add selection" button.
Rmap format also requires no gaps in a zoom level range from the maximum to the minimum selected zoom level. If there are missing zoom levels, they will be created internally by shrinking the existing downloaded tiles. If the missing zoom levels contain a lot of tiles, this operation could take a while.
Finally copy the <tt>layer.rmap</tt> file from the <tt>atlases\[atlas name]_[current date and time]</tt> folder to your TwoNav <tt>maps</tt> folder.
As TwoNav does not support all available features provided my MOBAC, some features can not be used when creating atlases in this format:
* Custom tile height and width (is ignored for TwoNav RMP atlases)
* Custom tile format: Only JPEG formats are allowed
### <a name="Viewranger">Creating and using atlases with Viewranger</a>
For creating atlases compatible with [Viewranger(VR)](http://www.viewranger.com/) you have to select **Viewranger** as format in atlas format selection dialog that appears when starting a new atlas (menu **Atlas** entry **New Atlas**).
Maximum Zoomlevel of Viewranger is 18, minimum is 3.
After creating youre atlas the folder structure looks like:
* <tt>Mobile Atlas Creator 1.9\atlases\VR_2012-03-28_154944\OSM\13\4308</tt>
* <tt>Mobile Atlas Creator 1.9\atlases\VR_2012-03-28_154944\OSM\14\43</tt>
* <tt>Mobile Atlas Creator 1.9\atlases\VR_2012-03-28_154944\google\13\4308</tt>
* <tt>Mobile Atlas Creator 1.9\atlases\VR_2012-03-28_154944\google\14\43</tt>
Now we have to [Create a Folder Structure on the Device:](http://support.viewranger.com/wikihelp/index.php/Map_cache_structure)
If you youre VR Folder is on E: it is on Symbian located in <tt>E:/ViewRanger/MapCache/_PAlbTN/</tt>
In this folder create following Subfolders, if not already present:
84,85,87,88,89,129
e.g. <tt>/ViewRanger/MapCache/_PAlbTN/84</tt>
Copy the content of "OSM" into 84, "google" into 85 and so on.
Now it looks like: <tt>E:/ViewRanger/MapCache/_PAlbTN/13/4308/2687</tt> , 2687 is a tile
VR has different Online Mapsources which are assigned to the Numbers as shown:
* <tt>OSM->84</tt>
* <tt>Opencyclemap->85</tt>
* <tt>OSM Direct->87</tt>
* <tt>OSM Midnigth->88</tt>
* <tt>OSM Fresh->89</tt>
* <tt>Open Piste Map->129</tt>
Of course you can fill the Tilecache with different Maps.
I use the Open Piste Map eg. as "OSM Public Transport"
## <a name="Enhancement">Enhancement requests</a>
If you are missing the map provider of your choice or have other enhancement ideas for Mobile Atlas Creator feel free to open an [Feature Request Ticket](http://sourceforge.net/tracker/?group_id=238075&atid=1105497) at SourceForge.
If have a new online map which is not available in Mobile Atlas Creator there my be change to add it. Before opening a Feature Request please take a look into the [list of map sources known to incompatible with Mobile Atlas Creator](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/misc/Incompatible%20maps.txt).
## <a name="Bugs">Problems, Bugs & Errors</a>
In case of unexpected errors while executing Mobile Atlas Creator you may get presented a exception dialog containing detailed information about the problem. In such a case please create a new [ticket in the Bug Tracker](http://sourceforge.net/tracker/?group_id=238075&atid=1105494) at SourceForge. Please add the detailed exception information and a detailed description of your last performed actions.
### The default error log
By default Mobile Atlas Creator records all errors of the current session into it's error log file <tt>Mobile Atlas Creator.log</tt> . This log file is located on Windows system in the directory <tt>%APPDATA%\Mobile Atlas Creator\</tt> and on Linux/Unix/OSX system in the directory <tt>~/.mobac/</tt>
### Activate the advanced logging system
If the recorded errors in the error log do not indicate a problem you can activate the overall message logging mechanism of Mobile Atlas Creator:
Download the file [log4j.xml](http://mobac.sourceforge.net/log4j.xml) and save it in the directory where the jar file of Mobile Atlas Creator is installed to.
The next start Mobile Atlas Creator will create a log file in the current directory (on Windows this is usually the directory where the JAR file is located on Linux usually the profile directory). Please note that the log file is erased on each program start. If you think you have found a bug please file it in the [bug tracker at SourceForge](http://sourceforge.net/tracker/?group_id=238075&atid=1105494).
## <a name="Limitations">Known problems and limitations</a>
### New map sources
Mobile Atlas Creator is limited to map sources that provide their maps if form of map tiles. Each of that map tiles has to be of size 256x256 pixels. Additionally the map source has to use the spherical Mercator projection and the number of tiles forming the world on each zoom level has to be one of the following values: 2<sup>0</sup>, 2<sup>1</sup>, 2<sup>2</sup> ... 2<sup>21</sup>, 2<sup>22</sup>.
For more details see OpenStreetMap Wiki: [Slippy map tilenames](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames), [Mercator](http://wiki.openstreetmap.org/wiki/Mercator), [Height and width of a map](http://wiki.openstreetmap.org/wiki/Height_and_width_of_a_map) and [Zoom levels](http://wiki.openstreetmap.org/wiki/Zoom_levels)
### Java Bugs
Due to bugs in Java you should not do the following:
* Install Mobile Atlas Creator into a directory which path contains an "!" (exclamation mark) because of this [Sun Java bug](http://bugs.sun.com/view_bug.do?bug_id=4523159)
* Do not use OpenJDK if you want to work with GPX tracks in Mobile Atlas Creator
* On Windows without a system proxy set (see connection settings of IE) it is strongly recommended **not to use** the following proxy setting:_Use standard Java proxy settings_
## <a name="AdvancedUsers">Details for advanced users</a>
### <a name="DirectoryConfig">Specifying directory configuration</a>
The following steps are necessary if MOBAC is installed to to a directory that is not writable for reguar users:
For changing the directory configuration pattern for all users of a MOBAC installation save [this file](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/directories.ini.template) into the same directory where <tt>Mobile_Atlas_Creator.jar</tt> has been installed into and change it's name to <tt>directories.ini</tt> . For more details read the comments in this configuration file.
### <a name="TileStoreDir">Moving the tile store directory</a>
Usually the tile store directory where Mobile Atlas Creator saves all downloaded images in is automatically determined.
In case you want to select a different directory perform the following steps:
1. Make sure you have closed MOBAC
2. Open <tt>settings.xml</tt> in an text editor
3. Inside of the tag <tt><settings></tt> search for the tag <tt><directories></tt>. Inside this tag create a new tag named <tt><tileStoreDirectory></tt>
4. Set the path name to the value of this tag (Windows users should replace backslashes with a slashes)
5. (optional) Copy or move the content of the old tile store directory into the new tile store directory.
#### Example
<pre><settings>
<directories>
<tileStoreDirectory>E:/tiles</tileStoreDirectory>
</directories>
...
</settings></pre>
This specified the windows directory <tt>E:\tiles</tt> as new tile store directory. The previously used tile store will not be used anymore.
Deleting the <tt><tileStoreDirectory></tt> tag restores the old behavior (automatically tile store directory selection).
### <a name="ExternalTools">Starting external tools from within MOBAC</a>
External tools like scripts or other executable programs can be started from the **Tools** menu from within MOBAC. This menu is only visible if external programs have been configured. The advantage of starting a program from within MOBAC is that certain information about selected map source, selected region ... can be transmitted as parameters to the executed program.
This allows you for example to create your own maps (render tiles) with external tools like [OSMFILTER](http://wiki.openstreetmap.org/wiki/Osmfilter), [OSMCONVERT](http://wiki.openstreetmap.org/wiki/Osmconvert), [MAPERITIVE](http://maperitive.net/)...
For defining an external program, create an xml file for each external program to be called. The content of the xml file has to be like one of the following examples. The file-name of the xml is not relevant - it only has to end with <tt>.xml</tt>
#### test.xml
Demonstrates how to execute an Windows batch file.
<pre><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExternalTool>
<name>Name shown in tools menu</name>
<command>cmd.exe /c start .\tools\mybatch.cmd</command>
<parameters>MIN_LON MIN_LAT MAX_LON MAX_LAT MIN_ZOOM MAX_ZOOM MAPSOURCE_NAME MAPSOURCE_DISPLAYNAME NAME_EDITBOX </parameters>
<debug>true</debug>
</ExternalTool>
</pre>
[Annotated sample file download](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/tools/test.xml)
#### test-exe.xml
Demonstrates how to execute an regular windows program.
<pre><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExternalTool>
<name>Name shown in tools menu</name>
<command>C:\sample-path\program.exe</command>
<parameters>MIN_LON MIN_LAT MAX_LON MAX_LAT MIN_ZOOM MAX_ZOOM MAPSOURCE_NAME MAPSOURCE_DISPLAYNAME NAME_EDITBOX </parameters>
<debug>true</debug>
</ExternalTool>
</pre>
The most interesting section is the content of **<parameters>**. It contains a space separated list of parameters the specified command will be executed with. The following values can be used:
* <tt>MAX_LAT</tt> - Maximum latitude (upper border) off the selected area
* <tt>MIN_LAT</tt> - Minimum latitude (lower border) off the selected area
* <tt>MAX_LON</tt> - Maximum longitude (right border) off the selected area
* <tt>MIN_LON</tt> - Minimum longitude (left border) off the selected area
* <tt>MIN_ZOOM</tt> - minimum zoom of selected zoom levels check-boxes
* <tt>MAX_ZOOM</tt> - maximum zoom of selected zoom levels check-boxes
* <tt>MAPSOURCE_NAME</tt> - Currently select map source internal name (used in atlas profile xml file)
* <tt>MAPSOURCE_DISPLAYNAME</tt> - Currently select map source display name (as shown in the GUI)
* <tt>NAME_EDITBOX</tt> - content of the edit box "Name" in the side panel "Atlas Content"
## <a name="CustomMapSource">Custom map sources</a>
### <a name="SimpleCustomMapSource">Simple custom map sources</a>
Custom map sources which uses a similar URL scheme as Google/OpenStreetMap can be added by saving for each custom map source the definition in form of an xml file in the <tt>mapsources</tt> directory.
The following section shows is an example how the xml file has to be formatted. It defines an additional map source named "Custom OSM Mapnik" which shows map tiles identical to the predefined map source "OpenStreetMap Mapnik".
<a name="MapSourceNameUnique"></a>**Note:**The name specified in there has to be unique among all available map sources within MOBAC. The list of all available map sources can be obtained via command **Show all map source names** in the menu **Debug**.
<pre><?xml version="1.0" encoding="UTF-8"?>
<customMapSource>
<name>Custom OSM Mapnik</name>
<minZoom>0</minZoom>
<maxZoom>18</maxZoom>
<tileType>png</tileType>
<tileUpdate>None</tileUpdate>
<url>http://tile.openstreetmap.org/{$z}/{$x}/{$y}.png</url>
<backgroundColor>#000000</backgroundColor>
</customMapSource>
</pre>
The most important part of this definition is the url. It is a template containing specific placeholders which are encapsulated by curly brace:
* **{$z}** for the zoom level - number range: [_minZoom_ .. _maxZoom_]
* **{$x}** for the x tile coordinate - number range: [0..2<sup>_zoom level_</sup> ]
* **{$y}** for the y tile coordinate - number range: [0..2<sup>_zoom level_</sup> ]
Note: If the url contains the ampersand character **&** you have to encode it as **&amp;**. Otherwise it not be valid XML and therefore can not bo loaded by MOBAC.
Example file for download: [Example custom map source.xml](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/mapsources/Example%20custom%20map%20source.xml)
### <a name="CustomWMSMapSource">Custom WMS map sources</a>
Similar a WMS map source can be defined. Currently only <tt>EPSG:4326</tt> as coordinatesystem is supported.
<pre><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customWmsMapSource>
<name>TerraServer WMS</name>
<minZoom>12</minZoom>
<maxZoom>18</maxZoom>
<tileType>JPG</tileType>
<version>1.1.1</version>
<layers>DRG</layers>
<url>http://terraserver-usa.com/ogcmap6.ashx?</url>
<coordinatesystem>EPSG:4326</coordinatesystem>
<aditionalparameters>&amp;EXCEPTIONS=BLANK&amp;Styles=</aditionalparameters>
<backgroundColor>#000000</backgroundColor>
</customWmsMapSource></pre>
Example file (with comments) for download: [Example custom WMS map source.xml](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/mapsources/Example%20custom%20WMS%20map%20source.xml)
### <a name="CustomMultiLayerMapSource">Custom multi-layer map sources</a>
The same way as [custom map sources](#CustomMapSource) map sources which consist of two or more layers can be defined as well. Note that all except the background map source layer (first in the list) must have transparent parts - otherwise layers in the list before will not be visible.
<pre><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customMultiLayerMapSource>
<name>Custom OSM Mapnik with Hills (Ger)</name>
<tileType>PNG</tileType>
<layers>
<customMapSource>
<name>Custom OSM Mapnik</name>
<minZoom>0</minZoom>
<maxZoom>18</maxZoom>
<tileType>PNG</tileType>
<tileUpdate>None</tileUpdate>
<url>http://tile.openstreetmap.org/{$z}/{$x}/{$y}.png</url>
<backgroundColor>#000000</backgroundColor>
</customMapSource>
<customMapSource>
<name>Custom transparent hillshade</name>
<minZoom>0</minZoom>
<maxZoom>18</maxZoom>
<tileType>PNG</tileType>
<tileUpdate>None</tileUpdate>
<url>http://www.wanderreitkarte.de/hills/{$z}/{$x}/{$y}.png</url>
</customMapSource>
</layers>
</customMultiLayerMapSource>
</pre>
Example file for download: [Example custom multi-layer map source.xml](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/mapsources/Example%20custom%20multi-layer%20map%20source.xml)
### <a name="CloudMadeMapSource">Custom CloudMade map sources</a>
The [CloudMade map service](http://maps.cloudmade.com/) offers a large number of OpenStreetMap based maps with different styles. Each style is accessible through it's <tt>styleID</tt> . Custom CloudMade maps can be added to MOBAC via a simple XML file containing a map name used by MOBAC and a styleID:
<pre><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cloudMade>
<displayName>CloudMade blackout</displayName>
<styleID>1960</styleID>
</cloudMade></pre>
Example file for download: [Example CloudMade1960.xml](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/mapsources/Example%20CloudMade1960.xml)
### <a name="BeanShellMapSource">Custom BeanShell map sources</a>
BeanShell map sources as the can be developed using [MapEvaluator](http://sourceforge.net/apps/mediawiki/mobac/index.php?title=MapEvaluator) can be used by MOBAC. To do so place the saved BeanShell code file (file extension <tt>.bsh</tt> ) in the <tt>mapsources</tt> directory. It will be loaded on next start-up of MOBAC.
It is recommended to add a line defining the map source name ([must be unique](#MapSourceNameUnique)).
<pre>name = "Your map source name here";</pre>
Example file for download: [Example beanshell map source.bsh](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/mapsources/Example%20beanshell%20map%20source.bsh)
### <a name="CustomMapPack">Custom Map Pack</a>
Developing a custom map pack requires at least basic Java skills. Therefore the description on how to develop a custom map pack is only part of the source code release of MOBAC. You can get the source code of MOBAC by using the latest <tt>src</tt> release available in the [files section at Sourceforge](http://sourceforge.net/projects/mobac/files/Mobile%20Atlas%20Creator/) or you can get it directly from the [Subversion code repository](http://sourceforge.net/p/mobac/code/) using the latest <tt>trunk</tt> version.
### <a name="FileBased">Custom atlas as map source / locally generated tiles</a>
Existing atlases or locally rendered tiles can be directly integrated into MOBAC as custom map source without having to set-up a local web-server.
At the moment the formats used by OSMTracker, AndNav, Maverick and OSMAND are supported. For adding such an atlas as map source download the [Example custom tile files source.xml](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/mapsources/Example%20custom%20tile%20files%20source.xml) file, adapt the <tt><sourceFolder></tt> entry and place it in the <tt>mapsources</tt> directory.
Tiles can also be packed into one or more zip files and directly used by MOBAC. For details please see the [Example custom tile zip source.xml](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/mapsources/Example%20custom%20tile%20zip%20source.xml).
**Note: When working with large ZIP files (more than 4 GB) it is required to use Java 7.**
SQLite based atlas formats can also be used directly by MOBAC. For details please see the [Example custom tile SQLite source.xml](http://svn.code.sf.net/p/mobac/code/tags/MOBAC%201.9/v1.9.16%20final/mapsources/Example%20custom%20tile%20SQLite%20source.xml)
```shell
bash gradlew dist
```

22
ReleaseNotes.txt Normal file
View File

@ -0,0 +1,22 @@
*******************************************************************************
* M O B I L E A T L A S C R E A T O R *
*******************************************************************************
* R E L E A S E N O T E S *
*******************************************************************************
Upgrading from version prior to 1.7:
Starting with MOBAC v1.7 the tile store format has changed. MOBAC now uses a
database (BerkelyDB) based tile store instead of saving each image files
separately in the file system.
Existing tile stores are NOT CONVERTED into the new database format because
the files in the file system are missing relevant information. Existing old
tile stores are ignored.
Therefore it is recommended to install MOBAC into a clean directory.
Existing atlas profiles (tac-profile*.xml) created with versions prior to v1.7
can usually can be reused by copying them into the current directory of MOBAC.
Upon next start of MOBAC they will be automatically renamed and will be
available from the atlas profile selector.

23
TestTileServer.properties Normal file
View File

@ -0,0 +1,23 @@
# TCP port on localhost to use
TestHttpServer.port = 80
# Allows to simulate not correct working HTTP servers
# Error rate in percent of HTTP 404 responses
TestHttpServer.errorRate = 0
TestHttpServer.errorOnSpecificUrls = true
TestHttpServer.delay = 100
# Generates for each request a PNG file containing the
# tile data x,y zoom and the tile url
TestHttpServer.generatePNGperRequest = false
# 0 = MOBAC Logo
# 1 = Gradient blue/white
# 2 = Blue cross
TestHttpServer.staticImage = 2
# NO_COMPRESSION = 0
# BEST_SPEED = 1
# BEST_COMPRESSION = 9;
TestHttpServer.generatedPNGcompression = 6

150
build.gradle Normal file
View File

@ -0,0 +1,150 @@
import java.nio.file.Files
import java.nio.file.StandardCopyOption
import java.security.MessageDigest
plugins {
id 'distribution'
id 'at.bxm.svntools' version '3.1'
id 'org.gradle.crypto.checksum' version '1.4.0'
id 'com.diffplug.spotless' version '6.21.0'
}
group 'mobac.sourceforge.io'
version '2.3.3'
println("SVN revision $svntools.info.revisionNumber")
allprojects {
repositories {
mavenCentral()
maven {
// required for javax.media:jai-core:1.1.3 and com.sun.media:jai-codec:1.1.3
url "https://repository.jboss.org/maven2"
}
// maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
ext {
svnRevision = "$svntools.info.revisionNumber"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.incremental = true
options.fork = true
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
task distArchive(type: Zip, dependsOn: ['mobac:createExe', 'mappacks:openstreetmap:jar', "mapevaluator:jar"]) {
from("mobac/build/libs") {
include "*.jar"
into "/"
}
from("mobac/build/launch4j") {
include "*.exe"
into "/"
}
from(".") {
include "CHANGELOG.txt"
include "ReleaseNotes.txt"
include "gpl.txt"
include "README.html"
include "start.sh"
include "world.map"
into "/"
}
from(project(':mappacks').subprojects.collect { it.tasks.withType(Jar) }) {
into "/mapsources/"
}
from("mapevaluator/build/libs") {
include "MapEvaluator.jar"
into "/"
}
archiveFileName = "Mobile Atlas Creator ${project.version}.zip"
destinationDirectory = new File(".")
}
task distSrcArchive(type: Zip) {
from("/keys") {
include "keystore.txt"
include "*.cer"
into "/keys"
}
from("/mobac") {
exclude "**/build/**"
into "/mobac"
}
from("/mapevaluator") {
exclude "**/build/**"
into "/mapevaluator"
}
from("/mappacks") {
exclude "**/build/**"
into "/mappacks"
}
from("/") {
include "logback.xml"
include "gpl.txt"
include "README.html"
include "README-DEV.html"
include "CHANGELOG.txt"
include "start.sh"
include "world.map"
include "gradle/**"
include "gradle*"
include "settings.gradle"
include "gradle*"
include "build.gradle"
}
archiveFileName = "Mobile Atlas Creator ${project.version} src.zip"
destinationDirectory = new File(".")
}
task dist {
dependsOn(distArchive, distSrcArchive)
}
/**
* Generate MD5 file for map packs online update. This task is irreelvant for regular MOBAC users/developers
*/
task mappacksMd5 {
var mapPackDir = "${project.projectDir}/mappacks"
var writer = new StringWriter()
var updDir = project.file('mapsources-updates').toPath()
delete updDir
Files.createDirectories(updDir)
fileTree("$mapPackDir").matching {
include "**/build/libs/mp-*.jar"
}.each {
// do some operations
var p = it.toPath()
var dest = updDir.resolve(it.getName())
Files.copy(p, dest, StandardCopyOption.REPLACE_EXISTING)
println(dest)
var bytes = Files.readAllBytes(dest)
var md5 = MessageDigest.getInstance("MD5").digest(bytes).encodeHex().toString()
writer.append(String.format("%s %s\n", md5, it.name))
}
println(writer.toString())
Files.writeString(updDir.resolve("mappacks-md5.txt"), writer.toString())
}
spotless {
java {
target fileTree(rootDir).matching {
include '**/*.java'
}
removeUnusedImports()
eclipse()
lineEndings(com.diffplug.spotless.LineEnding.WINDOWS)
encoding("UTF-8")
trimTrailingWhitespace()
endWithNewline()
}
}

376
build.xml
View File

@ -1,376 +0,0 @@
<project default="all"
name="Compile and build java classes plus jar archives">
<property file="src/main/resources/mobac/mobac.properties" />
<property name="rev.prop.file" value="src/main/resources/mobac/mobac-rev.properties" />
<property name="jar.name" value="Mobile_Atlas_Creator_UNLOCKED.jar" />
<property name="zip.name" value="Mobile Atlas Creator UNLOCKED ${mobac.version}.zip" />
<property name="zip_src.name" value="Mobile Atlas Creator UNLOCKED ${mobac.version} src.zip" />
<property name="main.class" value="mobac.StartMOBAC" />
<property name="rtlibraryjar.non_osx" value="${java.home}/lib/rt.jar" />
<property name="rtlibraryjar.osx" value="${java.home}/../Classes/classes.jar" />
<available property="rtlibraryjar.osx.present" file="${rtlibraryjar.osx}" />
<tstamp>
<format property="build.date" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<property name="je-version" value="3.3.93" />
<property name="sqlite-version" value="3.34.0" />
<!-- Java target version -->
<property name="java-target" value="1.6" />
<path id="maincp">
<fileset dir="lib" includes="log*.jar" />
<fileset dir="lib" includes="jai*.jar" />
<fileset dir="lib" includes="bsh-2.0b4.jar" />
<fileset dir="lib" includes="Tidy.jar" />
<fileset dir="lib" includes="javapng-2.0.jar" />
<fileset dir="lib" includes="itextpdf-5.1.0.jar" />
<fileset dir="lib" includes="commons-codec-1.4.jar" />
<fileset dir="lib" includes="commons-io-2.0.jar" />
<fileset dir="lib" includes="commons-lang3-3.1.jar" />
<fileset dir="lib" includes="je-${je-version}.jar" />
</path>
<target name="all"
depends="clean_build,svnversion,build,build_mapsources,sign_mapsources,create_jar,shrink,create_release,create_release_src" />
<target name="update_mapsources" depends="build_mapsources,sign_mapsources" />
<target name="clean_workspace"
description="Deletes the work directories ozi, atlases, atlasestared">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="atlases" includes="**/*" />
<fileset dir="build" includes="**/*" />
<fileset dir="tilestore" includes="**/*" />
</delete>
</target>
<target name="clean_build">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="build" includes="**/*" />
</delete>
</target>
<target name="delete_build" description="Deleted the entire build folder">
<delete failonerror="yes" dir="build" />
</target>
<target name="build">
<mkdir dir="build/mobac" />
<!-- Compile the starter class for Java 1.5 (shows an verbose -->
<!-- error if the JRE requirements are not met -->
<javac srcdir="src/main/java" destdir="build/mobac" target="1.5"
source="1.5" debug="true" includeantruntime="false" encoding="UTF-8">
<classpath refid="maincp" />
<include name="mobac/StartMOBAC.java" />
</javac>
<!-- Compile the other classes for Java 1.6 -->
<javac srcdir="src/main/java" destdir="build/mobac" target="${java-target}"
source="${java-target}" debug="true" includeantruntime="false"
encoding="UTF-8">
<classpath refid="maincp" />
<exclude name="mobac/StartMOBAC.java" />
<exclude name="mobac/mapsources/mappacks/**" />
<include name="mobac/**" />
</javac>
<copy todir="build/mobac" overwrite="true">
<fileset dir="src/main/resources" excludes="**/mapsources.properties" />
</copy>
</target>
<target name="build_mapsources" depends="clean_build,build,svnversion"
description="Build all map packs and generate the new mappacks-md5.txt">
<property name="mappack.srcbasedir" value="src/main/java/mobac/mapsources/mappacks" />
<property file="keys/keystore.properties" />
<taskdef name="for" classname="net.sf.antcontrib.logic.ForTask">
<classpath>
<pathelement location="lib/ant-contrib-for.jar" />
</classpath>
</taskdef>
<delete dir="mapsources" includes="mp-*.jar" />
<dirset id="mappacks" dir="${mappack.srcbasedir}/" includes="*" />
<pathconvert pathsep=";" property="mappacklist" refid="mappacks">
<mapper type="flatten" />
</pathconvert>
<mkdir dir="mapsources" />
<echo file="mapsources/mappacks-md5.txt" append="false" message="" />
<for list="${mappacklist}" param="mappack" delimiter=";">
<sequential>
<echo message="@{mappack}" />
<mkdir dir="build/mp-@{mappack}" />
<uptodate property="@{mappack}.newer" targetfile="mapsources/mp-@{mappack}.jar">
<srcfiles dir="src/main/java/mobac/mapsources/mappacks/@{mappack}" />
</uptodate>
<echo message="No changes in map pack detected: @{mappack}" />
<javac srcdir="src/main/java" destdir="build/mp-@{mappack}"
defaultexcludes="true" debug="true" target="${java-target}" source="${java-target}"
includeantruntime="false" encoding="UTF-8">
<include name="mobac/mapsources/mappacks/@{mappack}/**.java" />
<classpath>
<path refid="maincp" />
<path path="build/mobac" />
</classpath>
</javac>
<delete file="mapsources/mp-@{mappack}.jar" failonerror="false" />
<fileset dir="build/mp-@{mappack}" defaultexcludes="true"
id="fileset-@{mappack}">
<include name="mobac/mapsources/mappacks/@{mappack}/**.class" />
</fileset>
<jar destfile="mapsources/mp-@{mappack}.jar">
<manifest>
<attribute name="MapPackVersion" value="${mobac.mappackversion}" />
<attribute name="MapPackName" value="@{mappack}" />
<attribute name="MapPackBuild-Date" value="${build.date}" />
<attribute name="MapPackRevision" value="${mobac.revision.new}" />
</manifest>
<fileset refid="fileset-@{mappack}" />
<zipfileset dir="${mappack.srcbasedir}/@{mappack}/"
includes="mapsources.list" fullpath="META-INF/services/mobac.program.interfaces.MapSource" />
</jar>
<checksum algorithm="MD5" totalproperty="MD5-@{mappack}">
<fileset refid="fileset-@{mappack}" />
</checksum>
<echo file="mapsources/mappacks-md5.txt" append="true"
message="${MD5-@{mappack}} mp-@{mappack}.jar&#13;&#10;" />
</sequential>
</for>
</target>
<target name="check_keystore"
description="Checks if the key store for signing the map packs is present">
<available file="keys/keystore.jks" property="keystore.present" />
</target>
<!-- This task is only executed if a java key store is present in the keys
directory -->
<target name="sign_mapsources" depends="build_mapsources,check_keystore"
if="keystore.present">
<!-- The required key stores are not available in SVN and releases! -->
<echo message="Signing map packs using password: ${keystore.password}" />
<for list="${mappacklist}" param="mappack" delimiter=";">
<sequential>
<signjar keystore="keys/keystore.jks" storepass="${keystore.password}"
alias="MapPack" jar="mapsources/mp-@{mappack}.jar" verbose="false" />
</sequential>
</for>
</target>
<target name="create_jar">
<delete file="${jar.name}" />
<jar destfile="${jar.name}" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="${main.class}" />
<attribute name="Class-Path"
value="./ sqlite-jdbc-${sqlite-version}.jar sqlite.jar jai_core.jar jai_codec.jar lib/jai_core.jar lib/jai_codec.jar jai_*.jar lib/jai_*.jar" />
</manifest>
<zipfileset src="lib/log4j-1.2.15.jar" includes="org/apache/log4j/**" />
<zipfileset src="lib/je-${je-version}.jar" />
<zipfileset src="lib/bsh-2.0b4.jar" includes="**/*.class" />
<zipfileset src="lib/commons-codec-1.4.jar" includes="**/*.class" />
<zipfileset src="lib/commons-io-2.0.jar" includes="**/*.class" />
<zipfileset src="lib/commons-lang3-3.1.jar" includes="**/*.class" />
<zipfileset src="lib/javapng-2.0.jar" includes="**/*.class" />
<zipfileset src="lib/Tidy.jar" includes="org/w3c/tidy/**" />
<zipfileset src="lib/itextpdf-5.1.0.jar" includes="com/**" />
<fileset dir="build/mobac">
<exclude name="**/unittest/**" />
<exclude name="mobac/mapsources/mapapcks/**" />
<exclude name="**/*.java" />
</fileset>
</jar>
</target>
<target name="shrink_libraryjars" unless="rtlibraryjar.osx.present">
<property name="rtlibraryjar" value="${rtlibraryjar.non_osx}" />
</target>
<target name="shrink_libraryjars_osx" if="rtlibraryjar.osx.present">
<property name="rtlibraryjar" value="${rtlibraryjar.osx}" />
</target>
<target name="shrink"
depends="create_jar,shrink_libraryjars,shrink_libraryjars_osx"
description="Removes unused classes from compiled jar">
<taskdef resource="proguard/ant/task.properties" classpath="lib/proguard-ant-7.0.0.jar:lib/proguard-base-7.0.0.jar:lib/proguard-core-7.0.0.jar" />
<proguard>
-libraryjars "${rtlibraryjar}"
-injars
"${jar.name}"
-outjars
build/temp.jar
-keepattributes *Annotation*
-keep class ${main.class} {
public static void main(java.lang.String[]); }
-keep class
mobac.program.* { public *; }
-keep class mobac.program.interfaces.* {
public *; }
-keep class mobac.program.model.package-info
-keep class
mobac.program.model.* { public *; }
-keep class mobac.program.jaxb.* {
public *; }
-keep class mobac.program.interfaces.* { public *; }
-keep
class mobac.program.download.UserAgent { public *; }
-keep class
mobac.exceptions.* { public *; }
-keep class
mobac.program.tilestore.berkeleydb.* { *; }
-keep class
mobac.program.tilestore.TileStoreEntry { public *; }
-keep class
mobac.program.atlascreators.AtlasCreator { public *; }
-keep class
mobac.utilities.beanshell.* { public *; }
-keep class
mobac.utilities.tar.TarIndex { public *; }
-keep class
mobac.utilities.tar.TarIndexedArchive { public *; }
-keep class
mobac.data.gpx.gpx11.* { public *; }
-keep class
mobac.mapsources.MapSourceTools { public *; }
-keep class
mobac.mapsources.MapSourceUrlUpdater { public *; }
-keep class
mobac.mapsources.custom.* { *; }
-keep class org.apache.log4j.Layout {
public *; }
-keep class org.apache.log4j.Level { public *; }
-keep
class org.apache.commons.lang3.StringEscapeUtils { public *; }
-keep
class org.apache.log4j.Category { public *; }
-keep class
org.apache.log4j.Priority { public *; }
-keep class
org.apache.log4j.spi.LoggingEvent { public *; }
-keep class
org.apache.log4j.spi.ThrowableInformation { public *; }
-keep class
org.apache.log4j.spi.LocationInfo { public *; }
-keep class
org.apache.log4j.PatternLayout { public *; }
-keep class
org.apache.log4j.Appender { public *; }
-keep class
org.apache.log4j.FileAppender { public *; }
-keep class
com.sixlegs.png.PngImage { public *; }
-keep class bsh.This { public
*; }
-keep class bsh.XThis { public *; }
-keep class
com.sleepycat.persist.PrimaryIndex { public *; }
-keepclassmembers
enum * {
public static **[] values();
public static **
valueOf(java.lang.String);
}
-keepclassmembers class *
implements
java.io.Serializable {
static final long serialVersionUID;
private void
writeObject(java.io.ObjectOutputStream);
private void
readObject(java.io.ObjectInputStream);
java.lang.Object
writeReplace();
java.lang.Object readResolve();
}
-keepclassmembers
class * implements
com.sleepycat.persist.evolve.Conversion {
boolean
equals(java.lang.Object);
}
-dontnote java.**
-dontnote javax.**
-dontnote com.sun.**
-dontnote sun.**
-dontwarn
-dontoptimize
-dontobfuscate
</proguard>
<move file="build/temp.jar" tofile="${jar.name}" overwrite="true" />
</target>
<target name="svnversion"
description="Updates the revision information in src/mobac/mobac.properties"
depends="svnversion_svn">
</target>
<target name="svnversion_svn">
<delete file="${rev.prop.file}" />
<exec executable="svnversion" outputproperty="mobac.revision.new"
searchpath="true" failifexecutionfails="false" />
<property name="mobac.revision.new" value="exported" />
<condition property="mobac.revision.exported">
<equals arg1="${mobac.revision.new}" arg2="exported" />
</condition>
<echo message="MOBAC revision: ${mobac.revision.new}" />
<antcall target="svnversion_write_property_file" />
</target>
<target name="svnversion_write_property_file" unless="mobac.revision.exported">
<propertyfile file="${rev.prop.file}">
<entry key="mobac.revision" value="${mobac.revision.new}" />
</propertyfile>
</target>
<target name="create_release"
description="Packs all necessary files for the binary release into one zip archive">
<zip destfile="${zip.name}" update="false">
<fileset dir="./">
<include name="${jar.name}" />
<include name="gpl.txt" />
<include name="start.jar" />
<include name="README.HTM" />
<include name="ReleaseNotes.txt" />
<include name="CHANGELOG.txt" />
<include name="start.*" />
<include name="Mobile Atlas Creator.exe" />
<include name="mapsources/mp-*.jar" />
<include name="sqlite-jdbc-3.34.0.jar" />
</fileset>
<fileset dir="./misc">
<include name="mobac.icns" />
</fileset>
<fileset dir="lib" includes="sqlite-jdbc-${sqlite-version}.jar" />
</zip>
</target>
<target name="create_release_src"
description="Packs all necessary files for the source code release into one zip archive">
<zip destfile="${zip_src.name}" update="false">
<fileset dir="./">
<include name="src/**" />
<exclude name="src/mobac/tools/**" />
<include name="log4j.xml" />
<include name="build.xml" />
<include name="gpl.txt" />
<include name="start.jar" />
<include name="README.HTM" />
<include name="README-DEV.HTM" />
<include name="CHANGELOG.txt" />
<include name="start.sh" />
<include name=".classpath" />
<include name=".project" />
<include name="Mobile Atlas Creator.exe" />
<include name="misc/launch4j.xml" />
<include name="misc/mobac.ico" />
<include name="lib/*.jar" />
<include name="sqlite-jdbc-3.34.0.jar" />
</fileset>
</zip>
</target>
</project>

View File

@ -0,0 +1,36 @@
#######################################################################
# MOBAC system wide directory configuration #
# for a Linux/Unix distribution compliant with #
# XDG Base Directory Specification v0.7 #
# http://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html #
#######################################################################
# #
# Required environment variables: #
# $XDG_CONFIG_HOME - usually $HOME/.config #
# $XDG_CACHE_HOME - usually $HOME/.cache #
# #
#######################################################################
# #
# Rename this file to "directories.ini" and place it in the same #
# directory as the file Mobile-Atlas_Creator.jar #
# #
#######################################################################
# Directory where to save settings.xml and search for log4j.xml
mobac.usersettingsdir=${XDG_CONFIG_HOME}/mobac
# Directory where to save and load atlas profiles
mobac.atlasprofilesdir=${XDG_CONFIG_HOME}/mobac
# Directory where to search "map packs", custom maps and beanShell map sources
# Updated map packs are also saved into this directory overwriting old ones
mobac.mapsourcesdir=${XDG_CONFIG_HOME}/mobac/mapsources
# Directory where to create the cache databases of downloaded tiles
mobac.tilestoredir=${XDG_CACHE_HOME}/mobac/tilestore
# Directory where to save config files for executing external tools from within MOBAC
mobac.toolsdir=${XDG_CACHE_HOME}/mobac/tools
# Directory where to create the temporary download container
# mobac.tmpdir=${TMP}/mobac

45
directories.ini.template Normal file
View File

@ -0,0 +1,45 @@
################################################
# MOBAC system wide directory configuration
################################################
#
# For activating this configuration file rename it to "directories.ini"
# (remove the .template extension) and place it in the same directory as
# the file Mobile_Atlas_Creator.jar
#
# You can use any available system variable - but you have to write it in Java notation
#
# Therefore the tmp directory is available on all platforms via "${TMP}"
#
# Besides the default system variables MOBAC defines two own variables:
#
# ${home}
# user home directory, e.g. /home/username/ on Linux or C:\Users\username\ on Win Vista/7
#
# ${mobac-prog}
# directory where MOBAC (or to be detailed Mobile_Atlas_Creator.jar) has been installed into
#
# Notes:
# On Windows you have to use slashes "/" instead of back-slashes "\" e.g. C:/temp/mobac
# Absolute pathes are also valid
#Uncomment one of the following lines starting with "mobac." for redefining the directory
# Directory where to save settings.xml and search for log4j.xml
#mobac.usersettingsdir=${home}/.mobac
mobac.usersettingsdir=D:/MOBAC
# Directory where to save and load atlas profiles
#mobac.atlasprofilesdir=${home}/.mobac
# Directory where to search "map packs", custom maps and beanShell map sources
# Updated map packs are also saved into this directory overwriting old ones
#mobac.mapsourcesdir=${mobac-prog}/mapsources
# Directory where to create the cache databases of downloaded tiles
mobac.tilestoredir=D:/MOBAC/tilestore
# Directory where to save config files for executing external tools from within MOBAC
#mobac.toolsdir=${mobac-prog}/tools
# Directory where to create the temporary download container
mobac.tmpdir=D:/MOBAC/Temp

2
gradle.properties Normal file
View File

@ -0,0 +1,2 @@
org.gradle.parallel=true
org.gradle.warning.mode=all

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

249
gradlew vendored Normal file
View File

@ -0,0 +1,249 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

92
gradlew.bat vendored Normal file
View File

@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

BIN
keys/MapPack.cer Normal file

Binary file not shown.

2
keys/keystore.txt Normal file
View File

@ -0,0 +1,2 @@
keytool -genkey -keyalg RSA -alias MapPack -validity 7300 -dname "CN=MOBAC MapPack Signer 2015" -keystore keystore.jks
keytool -exportcert -keystore keystore.jks -alias MapPack -file MapPack.cer

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

22
mapevaluator/build.gradle Normal file
View File

@ -0,0 +1,22 @@
plugins {
id 'java'
}
dependencies {
implementation project(':mobac')
implementation project(':mappacks:openstreetmap')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnitPlatform()
}
jar{
archiveFileName = "MapEvaluator.jar"
manifest {
attributes "Main-Class": "mobac.StartMapEvaluator"
attributes "Class-Path": "Mobile_Atlas_Creator.jar"
attributes 'Add-Exports': 'java.base/sun.net.www.protocol.http java.base/sun.net.www.protocol.https'
}
}

View File

@ -0,0 +1,35 @@
package mobac;
import mobac.gui.MapEvaluator;
import mobac.mapsources.DefaultMapSourcesManager;
import mobac.program.DirectoryManager;
import mobac.program.ProgramInfo;
import mobac.program.model.Settings;
import mobac.program.tilestore.TileStore;
import mobac.utilities.GUIExceptionHandler;
public class StartMapEvaluator {
public static void main(String[] args) {
StartMOBAC.setLookAndFeel();
ProgramInfo.PROG_NAME = "MOBAC Map Evaluator";
ProgramInfo.PROG_NAME_SHORT = null;
GUIExceptionHandler.registerForCurrentThread();
GUIExceptionHandler.installToolkitEventQueueProxy();
ProgramInfo.initialize();
// Logging.configureConsoleLogging(Level.TRACE, Logging.ADVANCED_LAYOUT);
DirectoryManager.initialize();
// MapEvaluatorMapSourcesManager.initialitze();
DefaultMapSourcesManager.initialize();
try {
if (Settings.FILE.isFile()) {
Settings.load();
}
} catch (Exception e) {
// Load settings.xml only if it exists
}
TileStore.initialize();
new MapEvaluator().setVisible(true);
}
}

View File

@ -0,0 +1,327 @@
package mobac.gui;
import bsh.EvalError;
import mobac.gui.actions.HelpAction;
import mobac.gui.components.LineNumberedPaper;
import mobac.gui.mapview.LogPreviewMap;
import mobac.mapsources.MapEvaluatorBeanShellHttpMapSource;
import mobac.mapsources.MapSourcesManager;
import mobac.mapsources.custom.BeanShellHttpMapSource;
import mobac.mapsources.loader.CustomMapSourceLoader;
import mobac.program.DirectoryManager;
import mobac.program.ProgramInfo;
import mobac.program.interfaces.HttpMapSource;
import mobac.program.interfaces.MapSource;
import mobac.program.model.EastNorthCoordinate;
import mobac.tools.MapSourceCapabilityDetector;
import mobac.tools.MapSourceCapabilityGUI;
import mobac.utilities.GUIExceptionHandler;
import mobac.utilities.Utilities;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
public class MapEvaluator extends JFrame {
private static MapEvaluator INSTANCE;
private final LogPreviewMap previewMap;
private final JSplitPane splitPane;
private final LineNumberedPaper mapSourceEditor;
private final CustomMapSourceLoader xmlLoader;
private final MapSource defaultOsmMapSource;
protected final Logger log;
private File chooserDir;
private File loadedFile;
public MapEvaluator() throws HeadlessException {
super(ProgramInfo.getCompleteTitle());
log = LoggerFactory.getLogger(this.getClass());
addWindowListener(new MEWindowAdapter());
setMinimumSize(new Dimension(300, 300));
setLayout(new BorderLayout());
setDefaultCloseOperation(EXIT_ON_CLOSE);
previewMap = new LogPreviewMap();
// previewMap.setMapMarkerVisible(true);
// previewMap.addMapMarker(new ReferenceMapMarker(Color.RED, 1, 2));
defaultOsmMapSource = MapSourcesManager.getInstance().getDefaultMapSource();
chooserDir = DirectoryManager.mapSourcesDir;
xmlLoader = new CustomMapSourceLoader(null, null);
mapSourceEditor = new LineNumberedPaper(3, 60);
try {
String code = Utilities.loadTextResource("bsh/default.bsh");
mapSourceEditor.setText(code);
} catch (IOException e) {
log.error("", e);
}
JPanel bottomPanel = new JPanel(new BorderLayout());
JToolBar toolBar = new JToolBar("Toolbar");
addButtons(toolBar);
bottomPanel.setMinimumSize(new Dimension(200, 100));
JScrollPane editorScrollPane = new JScrollPane(mapSourceEditor);
bottomPanel.add(toolBar, BorderLayout.NORTH);
bottomPanel.add(editorScrollPane, BorderLayout.CENTER);
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, previewMap, bottomPanel);
add(splitPane, BorderLayout.CENTER);
setSize(800, 600);
setExtendedState(JFrame.MAXIMIZED_BOTH);
INSTANCE = this;
}
public static void log(String msg) {
INSTANCE.previewMap.addLog(msg);
}
private void addButtons(JToolBar toolBar) {
JButton button = null;
button = new JButton("Load Template", Utilities.loadResourceImageIcon("new-icon.png"));
button.setToolTipText("Reset custom code editor to one of several templates");
button.addActionListener((event) -> loadTemplate());
toolBar.add(button);
button = new JButton("Load", Utilities.loadResourceImageIcon("open-icon.png"));
button.setToolTipText("Load custom map source from file");
button.addActionListener((event) -> loadMapSource());
toolBar.add(button);
button = new JButton("Save", Utilities.loadResourceImageIcon("save-icon.png"));
button.setToolTipText("Save custom map source to file");
button.addActionListener((event) -> saveMapSource());
toolBar.add(button);
button = new JButton("Execute code", Utilities.loadResourceImageIcon("check-icon.png"));
button.setToolTipText("Switch to custom map source (as defined by the custom code)");
button.addActionListener((event) -> executeCode());
toolBar.add(button);
button = new JButton("OSM", Utilities.loadResourceImageIcon("osm-icon.png"));
button.setToolTipText("Switch back to predefined OpenStreetMap mapsource");
button.addActionListener((event) -> previewMap.setMapSource(defaultOsmMapSource));
toolBar.add(button);
button = new JButton("Toggle tile info", Utilities.loadResourceImageIcon("info-icon.png"));
button.setToolTipText("Show/hide tile info");
button.addActionListener((event) -> previewMap.setTileGridVisible(!previewMap.isTileGridVisible()));
toolBar.add(button);
button = new JButton("Test Capabilities", Utilities.loadResourceImageIcon("capabilities-icon.png"));
button.setToolTipText("<html>Test the tile-update capabilities for the current map<br>"
+ "using the current center of the map as test point</html>");
button.addActionListener((event) -> testCapabilities());
toolBar.add(button);
// button = new JButton("Log");
// button.setToolTipText("Show Log");
// button.addActionListener((event) -> showLog());
// toolBar.add(button);
button = new JButton("Help", Utilities.loadResourceImageIcon("help-icon.png"));
button.setToolTipText("Show help dialog");
button.addActionListener(new HelpAction());
toolBar.add(button);
}
private void showLog() {
}
private void loadTemplate() {
try {
String[] options = {"Empty", "OpenStreetMap Mapnik"};
int a = JOptionPane.showOptionDialog(MapEvaluator.this, "Please select an template", "Select template", 0,
JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
String code = "";
switch (a) {
case (0) :
code = Utilities.loadTextResource("bsh/empty.bsh");
break;
case (1) :
code = Utilities.loadTextResource("bsh/osm.bsh");
break;
}
mapSourceEditor.setText(code);
} catch (IOException e) {
log.error("", e);
}
}
private void loadMapSource() {
try {
final JFileChooser fc = getMapSourceFileChooser(false);
int returnVal = fc.showOpenDialog(MapEvaluator.this);
if (returnVal != JFileChooser.APPROVE_OPTION) {
return;
}
chooserDir = fc.getSelectedFile().getParentFile();
List<String> lines = Files.readAllLines(fc.getSelectedFile().toPath(), StandardCharsets.UTF_8);
StringWriter sw = new StringWriter();
for (String s : lines) {
sw.write(s);
sw.write("\n");
}
mapSourceEditor.setText(sw.toString());
loadedFile = fc.getSelectedFile();
} catch (IOException e) {
log.error("", e);
JOptionPane.showMessageDialog(MapEvaluator.this, "Error reading code from file:\n" + e.getMessage(),
"Loading failed", JOptionPane.ERROR_MESSAGE);
}
}
private void saveMapSource() {
final JFileChooser fc = getMapSourceFileChooser(true);
int returnVal = fc.showOpenDialog(MapEvaluator.this);
if (returnVal != JFileChooser.APPROVE_OPTION) {
return;
}
chooserDir = fc.getSelectedFile().getParentFile();
try (BufferedWriter bw = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(fc.getSelectedFile()), StandardCharsets.UTF_8))) {
bw.write(mapSourceEditor.getText());
} catch (IOException e) {
log.error("", e);
JOptionPane.showMessageDialog(MapEvaluator.this, "Error writing code to disk:\n" + e.getMessage(),
"Saving failed", JOptionPane.ERROR_MESSAGE);
}
}
private JFileChooser getMapSourceFileChooser(boolean save) {
final JFileChooser fc = new JFileChooser();
if (save) {
fc.setDialogTitle("Save custom map source");
fc.setDialogType(JFileChooser.SAVE_DIALOG);
fc.setSelectedFile(loadedFile);
} else {
fc.setDialogTitle("Load custom map source");
fc.setDialogType(JFileChooser.OPEN_DIALOG);
}
fc.setCurrentDirectory(chooserDir);
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
FileNameExtensionFilter defaultFilter = new FileNameExtensionFilter("MOBAC custom map source", "bsh", "xml");
fc.addChoosableFileFilter(defaultFilter);
fc.addChoosableFileFilter(new FileNameExtensionFilter("Beanshell map source", "bsh"));
fc.addChoosableFileFilter(new FileNameExtensionFilter("Custom XML map source", "xml"));
fc.setFileFilter(defaultFilter);
return fc;
}
private void testCapabilities() {
final MapSource mapSource = previewMap.getMapSource();
final EastNorthCoordinate coordinate = previewMap.getCenterCoordinate();
final List<MapSourceCapabilityDetector> result = new ArrayList<>();
Runnable r = () -> {
MapSourceCapabilityGUI gui = null;
try {
gui = new MapSourceCapabilityGUI(result);
gui.setWorkerThread(Thread.currentThread());
gui.setVisible(true);
for (int zoom = mapSource.getMinZoom(); zoom < mapSource.getMaxZoom(); zoom++) {
MapSourceCapabilityDetector mstd = new MapSourceCapabilityDetector((HttpMapSource) mapSource,
coordinate, zoom);
if (!gui.isVisible()) {
return;
}
mstd.testMapSource();
result.add(mstd);
gui.refresh();
Utilities.checkForInterruption();
}
gui.toFront();
} catch (InterruptedException e) {
} finally {
gui.workerFinished();
}
};
new Thread(r).start();
}
private void executeCode() {
String code = mapSourceEditor.getText().trim();
if (code.startsWith("<?xml")) {
executeXMLCode(code);
} else {
executeBeanShellCode(code);
}
}
private void executeXMLCode(String code) {
try (InputStream in = new ByteArrayInputStream(code.getBytes(StandardCharsets.UTF_8))) {
MapSource mapSource = xmlLoader.loadCustomMapSource(in);
previewMap.setMapSource(mapSource, true);
previewMap.refreshMap();
} catch (Exception e) {
log.error(e.getMessage(), e);
JOptionPane.showMessageDialog(this, "Error in custom code: \n" + e.getMessage(), "Error in custom code",
JOptionPane.ERROR_MESSAGE);
}
}
private void executeBeanShellCode(String code) {
try {
BeanShellHttpMapSource testMapSource = new MapEvaluatorBeanShellHttpMapSource(code);
if (testMapSource.testCode()) {
previewMap.setMapSource(testMapSource);
return;
}
JOptionPane.showMessageDialog(this, "Error in custom code: result is null", "Error in custom code",
JOptionPane.ERROR_MESSAGE);
} catch (EvalError e) {
log.error("", e);
JOptionPane.showMessageDialog(this, "Error in custom code: \n" + e.getMessage(), "Error in custom code",
JOptionPane.ERROR_MESSAGE);
} catch (Exception e) {
Throwable cause = e.getCause();
if (cause instanceof EvalError) {
log.error("", cause);
JOptionPane.showMessageDialog(this, "Error in custom code: \n" + cause.getMessage(),
"Error in custom code", JOptionPane.ERROR_MESSAGE);
} else {
GUIExceptionHandler.processException(e);
}
}
}
private class MEWindowAdapter extends WindowAdapter {
@Override
public void windowOpened(WindowEvent e) {
splitPane.setDividerLocation(0.8);
previewMap.setEnabled(true);
}
}
}

View File

@ -0,0 +1,91 @@
package mobac.gui.actions;
import mobac.utilities.beanshell.Tools;
import mobac.utilities.beanshell.Tools.MethodDescription;
import org.apache.axis2.description.java2wsdl.bytecode.ParamReader;
import javax.swing.JOptionPane;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.StringWriter;
import java.lang.reflect.Method;
public class HelpAction implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
StringWriter sw = new StringWriter();
sw.append("<html>");
sw.append("<h2>Available tools function:</h2>");
Method[] methods = Tools.class.getMethods();
ParamReader pr = null;
try {
pr = new ParamReader(Tools.class);
} catch (IOException e1) {
e1.printStackTrace();
}
for (Method m : methods) {
if (!Tools.class.equals(m.getDeclaringClass())) {
continue;
}
// sw.append("<h4>" + m.getName() + "</h4>");
sw.append("<hr>");
sw.append("<pre>");
sw.append(getClassName(m.getReturnType()) + " Tools." + m.getName() + "(");
Class<?>[] params = m.getParameterTypes();
String[] names = pr.getParameterNames(m);
int last = params.length - 1;
for (int i = 0; i < params.length; i++) {
sw.append(getClassName(params[i]));
if (names != null) {
sw.append(" " + names[i]);
}
if (i != last) {
sw.append(", ");
}
}
sw.append(")</pre>");
MethodDescription md = m.getAnnotation(Tools.MethodDescription.class);
if (md != null) {
sw.append(md.value() + "<br>");
}
}
sw.append("<hr>");
sw.append("</html>");
JOptionPane.showMessageDialog(null, sw.toString(), "Help", JOptionPane.PLAIN_MESSAGE);
}
private String getClassName(Class<?> clazz) {
if (clazz.isArray()) {
String name = clazz.getName();
switch (name.charAt(1)) {
case 'B' :
return "byte[]";
case 'C' :
return "char[]";
case 'D' :
return "double[]";
case 'F' :
return "float[]";
case 'I' :
return "int[]";
case 'J' :
return "long[]";
case 'L' :
return "Object";
case 'S' :
return "short[]";
case 'Z' :
return "boolean[]";
default :
return "unknown[]";
}
} else {
return clazz.getSimpleName();
}
}
}

View File

@ -0,0 +1,252 @@
package mobac.gui.components;
import javax.swing.JTextArea;
import javax.swing.border.AbstractBorder;
import java.awt.Component;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
/**
* Draws line numbers next to each line, in the same font as the text.
* Currently, this can only be used with a <tt>JTextArea</tt> , since it relies
* on the <tt>getRows()</tt> and <tt>getLineCount()</tt> methods. A possible
* extension, create an interface to return this rows/linecount.
*
* @created January 29, 2002
* @see http://www.esus.com/docs/GetQuestionPage.jsp?uid=1326
*/
public class LineNumberedBorder extends AbstractBorder {
/**
* The line numbers should be drawn on the left side of the component.
*/
public static int LEFT_SIDE = -2;
/**
* The line numbers should be drawn on the right side of the component.
*/
public static int RIGHT_SIDE = -1;
/**
* The line number should be right justified.
*/
public static int RIGHT_JUSTIFY = 0;
/**
* The line number should be left justified.
*/
public static int LEFT_JUSTIFY = 1;
/**
* Indicates the justification of the text of the line number.
*/
private int lineNumberJustification = RIGHT_JUSTIFY;
/**
* Indicates the location of the line numbers, w.r.t. the component.
*/
private int location = LEFT_SIDE;
public LineNumberedBorder(int location, int justify) {
setLocation(location);
setLineNumberJustification(justify);
}
public Insets getBorderInsets(Component c) {
return getBorderInsets(c, new Insets(0, 0, 0, 0));
}
/**
* Create the string for the line number. NOTE: The <tt>length</tt> param does
* not include the <em>optional</em> space added after the line number.
*
* @param lineNumber
* to stringize
* @param length
* the length desired of the string
* @param addSpace
* Description of the Parameter
* @return the line number for drawing
*/
private static String padLabel(int lineNumber, int length, boolean addSpace) {
StringBuffer buffer = new StringBuffer();
buffer.append(lineNumber);
for (int count = (length - buffer.length()); count > 0; count--) {
buffer.insert(0, ' ');
}
if (addSpace) {
buffer.append(' ');
}
return buffer.toString();
}
public int getLineNumberJustification() {
return lineNumberJustification;
}
public void setLineNumberJustification(int justify) {
if (justify == RIGHT_JUSTIFY || justify == LEFT_JUSTIFY) {
lineNumberJustification = justify;
}
}
public int getLocation() {
return location;
}
public void setLocation(int loc) {
if (loc == RIGHT_SIDE || loc == LEFT_SIDE) {
location = loc;
}
}
/**
* This modifies the insets, by adding space for the line number on the left.
* Should be modified to add space on the right, depending upon Locale.
*
* @param c
* Description of the Parameter
* @param insets
* Description of the Parameter
* @return The borderInsets value
*/
public Insets getBorderInsets(Component c, Insets insets) {
// if c is not a JTextArea...nothing is done...
if (c instanceof JTextArea) {
int width = lineNumberWidth((JTextArea) c);
if (location == LEFT_SIDE) {
insets.left = width;
} else {
insets.right = width;
}
}
return insets;
}
//
// NOTE: This method is called every time the cursor blinks...
// so...optimize (later and if possible) for speed...
//
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
java.awt.Rectangle clip = g.getClipBounds();
FontMetrics fm = g.getFontMetrics();
int fontHeight = fm.getHeight();
// starting location at the "top" of the page...
// y is the starting baseline for the font...
// should "font leading" be applied?
int ybaseline = y + fm.getAscent();
//
// now determine if it is the "top" of the page...or somewhere else
//
int startingLineNumber = (clip.y / fontHeight) + 1;
//
// use any one of the following if's:
//
// if (startingLineNumber != 1)
if (ybaseline < clip.y) {
//
// not within the clip rectangle...move it...
// determine how many fontHeight's there are between
// y and clip.y...then add that many fontHeights
//
ybaseline = y + startingLineNumber * fontHeight - (fontHeight - fm.getAscent());
}
//
// options:
// . write the number rows in the document (current)
// . write the number of existing lines in the document (to do)
// see getLineCount()
//
// determine which the "drawing" should end...
// add fontHeight: make sure...part of the line number is drawn
//
// could also do this by determining what the last line
// number to draw.
// then the "while" loop whould change accordingly.
//
// int yend = y + clip.height + fontHeight;
// int yend = ybaseline + height + fontHeight; // original
int yend = ybaseline + height;
if (yend > (y + height)) {
yend = y + height;
}
JTextArea jta = (JTextArea) c;
int lineWidth = lineNumberWidth(jta);
// base x position of the line number
int lnxstart = x;
if (location == LEFT_SIDE) {
// x (LEFT) or (x + lineWidth) (RIGHT)
// (depends upon justification)
if (lineNumberJustification == LEFT_JUSTIFY) {
lnxstart = x;
} else {
// RIGHT JUSTIFY
lnxstart = x + lineWidth;
}
} else {
// RIGHT SIDE
// (y + width) - lineWidth (LEFT) or (y + width) (RIGHT)
// (depends upon justification)
if (lineNumberJustification == LEFT_JUSTIFY) {
lnxstart = (y + width) - lineWidth;
} else {
// RIGHT JUSTIFY
lnxstart = (y + width);
}
}
g.setColor(c.getForeground());
//
// loop until out of the "visible" region...
//
int length = ("" + Math.max(jta.getRows(), jta.getLineCount() + 1)).length();
while (ybaseline < yend) {
//
// options:
// . left justify the line numbers
// . right justify the line numbers
//
if (lineNumberJustification == LEFT_JUSTIFY) {
g.drawString(startingLineNumber + " ", lnxstart, ybaseline);
} else {
// right justify
String label = padLabel(startingLineNumber, length, true);
g.drawString(label, lnxstart - fm.stringWidth(label), ybaseline);
}
ybaseline += fontHeight;
startingLineNumber++;
}
}
// paintComponent
/**
* Returns the width, in pixels, of the maximum line number, plus a trailing
* space.
*
* @param textArea
* Description of the Parameter
* @return Description of the Return Value
*/
private int lineNumberWidth(JTextArea textArea) {
//
// note: should this be changed to use all nines for the lineCount?
// for example, if the number of rows is 111...999 could be wider
// (in pixels) in a proportionally spaced font...
//
int lineCount = Math.max(textArea.getRows(), textArea.getLineCount() + 1);
return textArea.getFontMetrics(textArea.getFont()).stringWidth(lineCount + " ");
}
}

View File

@ -0,0 +1,198 @@
package mobac.gui.components;
import javax.swing.JTextArea;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
/**
* Draws line numbers next to each line, in the same font as the text. Based
* upon the comment in {@link #getInsets(Insets) getInsets} maybe the "line
* numbering" could be a border?
*
* @see http://www.esus.com/docs/GetQuestionPage.jsp?uid=1326
*/
public class LineNumberedPaper extends JTextArea {
/**
* The line number should be right justified.
*/
public static int RIGHT_JUSTIFY = 0;
/**
* The line number should be left justified.
*/
public static int LEFT_JUSTIFY = 1;
/**
* Indicates the justification of the text of the line number.
*/
private int lineNumberJustification = RIGHT_JUSTIFY;
public LineNumberedPaper(int rows, int cols) {
super(rows, cols);
setOpaque(false);
// if this is NOT opaque...then painting is a problem...
// basically...this draws the line numbers...
// but...super.paintComponent()...erases the background...and the
// line numbers...what to do?
//
// "workaround": paint the background in this class...
}
public Insets getInsets() {
return getInsets(new Insets(0, 0, 0, 0));
}
/**
* This modifies the insets, by adding space for the line number on the left.
* Should be modified to add space on the right, depending upon Locale.
*/
public Insets getInsets(Insets insets) {
insets = super.getInsets(insets);
insets.left += lineNumberWidth();
return insets;
}
public int getLineNumberJustification() {
return lineNumberJustification;
}
public void setLineNumberJustification(int justify) {
if (justify == RIGHT_JUSTIFY || justify == LEFT_JUSTIFY) {
lineNumberJustification = justify;
}
}
/**
* Returns the width, in pixels, of the maximum line number, plus a trailing
* space.
*/
private int lineNumberWidth() {
//
// note: should this be changed to use all nines for the lineCount?
// for example, if the number of rows is 111...999 could be wider
// (in pixels) in a proportionally spaced font...
//
int lineCount = Math.max(getRows(), getLineCount() + 1);
return getFontMetrics(getFont()).stringWidth(lineCount + " ");
}
//
// NOTE: This method is called every time the cursor blinks...
// so...optimize (later and if possible) for speed...
//
public void paintComponent(Graphics g) {
Insets insets = getInsets();
Rectangle clip = g.getClipBounds();
g.setColor(getBackground()); // see note in constructor about this...
g.fillRect(clip.x, clip.y, clip.width, clip.height);
// do the line numbers need redrawn?
if (clip.x < insets.left) {
FontMetrics fm = g.getFontMetrics();
int fontHeight = fm.getHeight();
// starting location at the "top" of the page...
// y is the starting baseline for the font...
// should "font leading" be applied?
int y = fm.getAscent() + insets.top;
//
// now determine if it is the "top" of the page...or somewhere else
//
int startingLineNumber = ((clip.y + insets.top) / fontHeight) + 1;
//
// use any one of the following if's:
//
// if (startingLineNumber != 1)
if (y < clip.y) {
//
// not within the clip rectangle...move it...
// determine how many fontHeight's there are between
// y and clip.y...then add that many fontHeights
//
y = startingLineNumber * fontHeight - (fontHeight - fm.getAscent());
}
//
// options:
// . write the number rows in the document (current)
// . write the number of existing lines in the document (to do)
// see getLineCount()
//
// determine which the "drawing" should end...
// add fontHeight: make sure...part of the line number is drawn
//
// could also do this by determining what the last line
// number to draw.
// then the "while" loop whould change accordingly.
//
int yend = y + clip.height + fontHeight;
// base x position of the line number
int lnxstart = insets.left;
if (lineNumberJustification == LEFT_JUSTIFY) {
// actual starting location of the string of a left
// justified string...it's constant...
// the right justified string "moves"...
lnxstart -= lineNumberWidth();
}
g.setColor(getForeground());
//
// loop until out of the "visible" region...
//
int length = ("" + Math.max(getRows(), getLineCount() + 1)).length();
while (y < yend) {
//
// options:
// . left justify the line numbers (current)
// . right justify the line number (to do)
//
if (lineNumberJustification == LEFT_JUSTIFY) {
g.drawString(startingLineNumber + " ", lnxstart, y);
} else { // right justify
String label = padLabel(startingLineNumber, length, true);
g.drawString(label, insets.left - fm.stringWidth(label), y);
}
y += fontHeight;
startingLineNumber++;
}
} // draw line numbers?
super.paintComponent(g);
} // paintComponent
/**
* Create the string for the line number. NOTE: The <tt>length</tt> param does
* not include the <em>optional</em> space added after the line number.
*
* @param lineNumber
* to stringize
* @param length
* the length desired of the string
* @param length
* the length desired of the string
*
* @return the line number for drawing
*/
private String padLabel(int lineNumber, int length, boolean addSpace) {
StringBuffer buffer = new StringBuffer();
buffer.append(lineNumber);
for (int count = (length - buffer.length()); count > 0; count--) {
buffer.insert(0, ' ');
}
if (addSpace) {
buffer.append(' ');
}
return buffer.toString();
}
}

View File

@ -0,0 +1,206 @@
package mobac.gui.mapview;
import mobac.gui.mapview.layer.MapGridLayer;
import mobac.program.interfaces.HttpMapSource;
import mobac.program.interfaces.MapSourceListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.net.URL;
import java.util.LinkedList;
import java.util.NoSuchElementException;
import java.util.TimerTask;
public class LogPreviewMap extends PreviewMap {
private static final Logger LOG = LoggerFactory.getLogger(LogPreviewMap.class);
private final LinkedList<LogEntry> logLines = new LinkedList<>();
private final Font logFont = new Font("Sans Serif", Font.BOLD, 14);
private final Font tileInfoFont = new Font("Sans Serif", Font.BOLD, 12);
// private Timer timer = new Timer();
public LogPreviewMap() {
super();
usePlaceHolderTiles = false;
setZoomContolsVisible(true);
setTileGridVisible(true);
setTileGridVisible(true);
// timer.schedule(new LogRemoverTimerTask(), 0, 500);
jobDispatcher.addMapSourceListener(new MapSourceListener() {
@Override
public void tileDownloadStarted(String tileUrl) {
addLog("Downloading " + tileUrl);
}
@Override
public void tileDownloaded(int size) {
}
@Override
public void tileLoadedFromCache(int size) {
}
});
}
@Override
public void setTileGridVisible(boolean tileGridVisible) {
if (isTileGridVisible() == tileGridVisible) {
return;
}
if (tileGridVisible) {
mapGridLayer = new MapGridInfoLayer();
addMapTileLayers(mapGridLayer);
} else {
removeMapTileLayers(mapGridLayer);
mapGridLayer = null;
}
repaint();
}
@Override
protected void paintComponent(Graphics graphics) {
super.paintComponent(graphics);
int y = 18;
graphics.setFont(logFont);
graphics.setColor(Color.RED);
synchronized (logLines) {
for (LogEntry entry : logLines) {
graphics.drawString(entry.msg, 50, y);
y += 20;
}
}
}
public void addLog(String msg) {
LOG.debug(msg);
LogEntry entry = new LogEntry();
entry.msg = msg;
synchronized (logLines) {
logLines.addFirst(entry);
if (logLines.size() > 10) {
logLines.removeLast();
}
}
}
public static class LogEntry {
final long time = System.currentTimeMillis();
String msg;
}
public class LogRemoverTimerTask extends TimerTask {
@Override
public void run() {
long minTime = System.currentTimeMillis() - 4000;
boolean dirty = false;
try {
synchronized (logLines) {
while (true) {
LogEntry e = logLines.getLast();
if (e.time < minTime) {
logLines.removeLast();
dirty = true;
} else {
break;
}
}
}
} catch (NoSuchElementException e) {
}
if (dirty) {
repaint();
}
}
}
public class MapGridInfoLayer extends MapGridLayer {
public void paintTile(Graphics g, int gx, int gy, int tilex, int tiley, int zoom) {
if (tilex < 0 || tiley < 0) {
return;
}
int max = mapSource.getMapSpace().getMaxPixels(zoom);
int tileSize = mapSource.getMapSpace().getTileSize();
if (tilex * tileSize >= max || tiley * tileSize >= max) {
return;
}
g.setColor(Color.BLACK);
g.drawRect(gx, gy, tileSize, tileSize);
g.setFont(tileInfoFont);
g.setColor(Color.BLUE);
drawStringBG(g, "zoom=" + zoom, gx + 4, gy += 14);
drawStringBG(g, "x=" + tilex, gx + 4, gy += 16);
drawStringBG(g, "y=" + tiley, gx + 4, gy += 16);
String tileUrl = null;
try {
if (mapSource instanceof HttpMapSource) {
tileUrl = ((HttpMapSource) mapSource).getTileUrl(zoom, tilex, tiley);
}
if (tileUrl != null) {
URL url = new URL(tileUrl);
drawUrl(g, "host=" + url.getHost(), gx + 4, gy += 16, tileSize);
drawUrl(g, url.getPath(), gx + 4, gy += 16, tileSize);
String strQuery = url.getQuery();
if (strQuery != null && strQuery.length() > 0) {
drawUrl(g, "?" + strQuery, gx + 4, gy += 16, tileSize);
}
}
} catch (Exception e) {
}
}
}
private void drawUrl(Graphics g, String s, int x, int y, int width) {
FontMetrics fm = g.getFontMetrics();
int lineHeight = fm.getHeight();
int ascent = fm.getAscent();
int curX = x;
int curY = y;
width -= 15;
int beginIndex = 0;
for (int i = 0; i < s.length(); i++) {
String sub = s.substring(beginIndex, i);
int textWidth = fm.stringWidth(sub);
if (textWidth >= width) {
g.setColor(Color.WHITE);
g.fillRect(curX - 2, curY - ascent, textWidth + 2, lineHeight);
g.setColor(Color.BLUE);
g.drawString(sub, curX, curY);
curY += lineHeight;
beginIndex = i;
sub = null;
}
}
if (beginIndex != s.length()) {
String sub = s.substring(beginIndex);
g.setColor(Color.WHITE);
int textWidth = fm.stringWidth(sub);
g.fillRect(curX - 2, curY - ascent, textWidth + 2, lineHeight);
g.setColor(Color.BLUE);
g.drawString(sub, curX, curY);
}
}
protected void drawStringBG(Graphics g, String s, int curX, int curY) {
FontMetrics fm = g.getFontMetrics();
int lineHeight = fm.getHeight();
int ascent = fm.getAscent();
g.setColor(Color.WHITE);
int textWidth = fm.stringWidth(s);
g.fillRect(curX - 2, curY - ascent, textWidth + 2, lineHeight);
g.setColor(Color.BLUE);
g.drawString(s, curX, curY);
}
}

View File

@ -0,0 +1,46 @@
package mobac.gui.mapview;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Stroke;
public class ReferenceMapMarker {
protected static Stroke CIRCLE_STROKE = new BasicStroke(5.0f);
protected static Stroke LINE_STROKE = new BasicStroke(1.0f);
private final Color circleColor;
private final double lat;
private final double lon;
public ReferenceMapMarker(Color circleColor, double lat, double lon) {
this.circleColor = circleColor;
this.lat = lat;
this.lon = lon;
}
public void paint(Graphics2D g, Point position) {
int size_h = 10;
int size = size_h * 2 + 1;
g.setStroke(LINE_STROKE);
g.setColor(Color.BLACK);
g.drawLine(position.x, position.y - size_h, position.x, position.y + size_h);
g.drawLine(position.x - size_h, position.y, position.x + size_h, position.y);
g.setColor(circleColor);
g.setStroke(CIRCLE_STROKE);
g.drawOval(position.x - size_h, position.y - size_h, size, size);
}
// @Override
public double getLat() {
return lat;
}
// @Override
public double getLon() {
return lon;
}
}

View File

@ -0,0 +1,301 @@
/*******************************************************************************
* Copyright (c) MOBAC developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
******************************************************************************/
package mobac.tools;
import mobac.program.interfaces.HttpMapSource;
import mobac.program.interfaces.HttpMapSource.TileUpdate;
import mobac.program.interfaces.MapSpace;
import mobac.program.model.EastNorthCoordinate;
import mobac.program.model.Settings;
import mobac.program.model.TileImageType;
import mobac.utilities.Utilities;
import mobac.utilities.imageio.ImageFormatDetector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.List;
import java.util.Map;
public class MapSourceCapabilityDetector {
public static final Logger log = LoggerFactory.getLogger(MapSourceCapabilityDetector.class);
private final HttpMapSource mapSource;
private final EastNorthCoordinate coordinate;
private final int zoom;
private URL url;
private HttpURLConnection c;
private boolean success = false;
private Exception error = null;
private boolean eTagPresent = false;
private boolean expirationTimePresent = false;
private boolean lastModifiedTimePresent = false;
private boolean ifNoneMatchSupported = false;
private boolean ifModifiedSinceSupported = false;
private String contentType = "?";
static final byte[] HEX_CHAR_TABLE = {(byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5',
(byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e',
(byte) 'f'};
public MapSourceCapabilityDetector(Class<? extends HttpMapSource> mapSourceClass, EastNorthCoordinate coordinate,
int zoom)
throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
this(mapSourceClass.getConstructor().newInstance(), coordinate, zoom);
}
public static String getHexString(byte[] raw) throws UnsupportedEncodingException {
byte[] hex = new byte[2 * raw.length];
int index = 0;
for (byte b : raw) {
int v = b & 0xFF;
hex[index++] = HEX_CHAR_TABLE[v >>> 4];
hex[index++] = HEX_CHAR_TABLE[v & 0xF];
}
return new String(hex, StandardCharsets.US_ASCII);
}
public MapSourceCapabilityDetector(HttpMapSource mapSource, EastNorthCoordinate coordinate, int zoom) {
this.mapSource = mapSource;
if (mapSource == null) {
throw new NullPointerException("MapSource not set");
}
this.coordinate = coordinate;
this.zoom = zoom;
}
private void testIfNoneMatch(byte[] content) throws Exception {
String eTag = c.getHeaderField("ETag");
MessageDigest md5 = MessageDigest.getInstance("MD5");
byte[] digest = md5.digest(content);
String hexDigest = getHexString(digest);
// log.debug("content MD5 : {}", hexDigest);
if (hexDigest.equals(eTag)) {
log.debug("eTag content : md5 hex string");
}
String quotedHexDigest = "\"" + hexDigest + "\"";
if (quotedHexDigest.equals(eTag)) {
log.debug("eTag content : quoted md5 hex string");
}
HttpURLConnection c2 = (HttpURLConnection) url.openConnection();
c2.addRequestProperty("If-None-Match", eTag);
c2.connect();
int code = c2.getResponseCode();
boolean supported = (code == 304);
ifNoneMatchSupported = supported;
// System.out.print("If-None-Match response: ");
// log.debug(b2s(supported) + " - " + code + " (" +
// c2.getResponseMessage() + ")");
c2.disconnect();
}
protected void printHeaders() {
log.trace("\nHeaders:");
for (Map.Entry<String, List<String>> entry : c.getHeaderFields().entrySet()) {
String key = entry.getKey();
for (String elem : entry.getValue()) {
if (key != null) {
log.debug(key + " = ");
}
log.debug(elem);
}
}
}
@Override
public String toString() {
StringWriter sw = new StringWriter();
sw.append("Mapsource.........: " + mapSource.getName() + "\n");
sw.append("Current TileUpdate: " + mapSource.getTileUpdate() + "\n");
sw.append("If-None-Match.....: " + b2s(ifNoneMatchSupported) + "\n");
sw.append("ETag..............: " + b2s(eTagPresent) + "\n");
sw.append("If-Modified-Since.: " + b2s(ifModifiedSinceSupported) + "\n");
sw.append("LastModified......: " + b2s(lastModifiedTimePresent) + "\n");
sw.append("Expires...........: " + b2s(expirationTimePresent) + "\n");
return sw.toString();
}
public boolean isSuccess() {
return success;
}
public Exception getError() {
return error;
}
public int getZoom() {
return zoom;
}
public boolean iseTagPresent() {
return eTagPresent;
}
public boolean isExpirationTimePresent() {
return expirationTimePresent;
}
public boolean isLastModifiedTimePresent() {
return lastModifiedTimePresent;
}
public boolean isIfModifiedSinceSupported() {
return ifModifiedSinceSupported;
}
public boolean isIfNoneMatchSupported() {
return ifNoneMatchSupported;
}
public String getContentType() {
return contentType;
}
public TileUpdate getRecommendedTileUpdate() {
if (ifNoneMatchSupported) {
return TileUpdate.IfNoneMatch;
}
if (ifModifiedSinceSupported) {
return TileUpdate.IfModifiedSince;
}
if (eTagPresent) {
return TileUpdate.ETag;
}
if (lastModifiedTimePresent) {
return TileUpdate.LastModified;
}
return TileUpdate.None;
}
private static String b2s(boolean b) {
if (b) {
return "supported";
} else {
return "-";
}
}
private void testIfModified() throws IOException {
HttpURLConnection c2 = (HttpURLConnection) url.openConnection();
c2.setIfModifiedSince(System.currentTimeMillis() + 1000); // future date
c2.connect();
int code = c2.getResponseCode();
boolean supported = (code == 304);
ifModifiedSinceSupported = supported;
// System.out.print("If-Modified-Since : ");
// log.debug(b2s(supported) + " - " + code + " (" +
// c2.getResponseMessage() + ")");
}
public void testMapSource() {
try {
log.debug("Testing {}", mapSource);
MapSpace mapSpace = mapSource.getMapSpace();
int tilex = mapSpace.cLonToX(coordinate.lon, zoom) / mapSpace.getTileSize();
int tiley = mapSpace.cLatToY(coordinate.lat, zoom) / mapSpace.getTileSize();
c = mapSource.getTileUrlConnection(zoom, tilex, tiley);
url = c.getURL();
log.trace("Sample url: {}", c.getURL());
log.trace("Connecting...");
c.setReadTimeout(10000);
Settings settings = Settings.getInstance();
c.addRequestProperty("User-agent", settings.getUserAgent());
c.setRequestProperty("Accept", settings.getHttpAccept());
c.connect();
log.debug("Connection established - response HTTP {}", c.getResponseCode());
if (c.getResponseCode() != 200) {
return;
}
// printHeaders();
byte[] content = Utilities.getInputBytes(c.getInputStream());
TileImageType detectedContentType = ImageFormatDetector.getImageType(content);
contentType = c.getContentType();
contentType = contentType.substring(6);
if ("png".equals(contentType)) {
contentType = "png";
} else if ("jpeg".equals(contentType) || "jpg".equals(contentType)) {
contentType = "jpg";
} else {
contentType = "unknown: " + c.getContentType();
}
if (contentType.equals(detectedContentType.getFileExt())) {
contentType += " (verified)";
} else {
contentType += " (unverified)";
}
log.debug("Image format : " + contentType);
String eTag = c.getHeaderField("ETag");
Utilities.checkForInterruption();
eTagPresent = (eTag != null);
if (eTagPresent) {
// log.debug("eTag : " + eTag);
testIfNoneMatch(content);
}
// else log.debug("eTag : -");
// long date = c.getDate();
// if (date == 0)
// log.debug("Date time : -");
// else
// log.debug("Date time : " + new Date(date));
long exp = c.getExpiration();
expirationTimePresent = (c.getHeaderField("expires") != null) && (exp != 0);
if (exp == 0) {
// log.debug("Expiration time : -");
} else {
// long diff = (exp - System.currentTimeMillis()) / 1000;
// log.debug("Expiration time : " + new Date(exp)
// + " => "
// + Utilities.formatDurationSeconds(diff));
}
long modified = c.getLastModified();
lastModifiedTimePresent = (c.getHeaderField("last-modified") != null) && (modified != 0);
// if (modified == 0)
// log.debug("Last modified time : not set");
// else
// log.debug("Last modified time : " + new
// Date(modified));
Utilities.checkForInterruption();
testIfModified();
success = true;
} catch (Exception e) {
this.error = e;
log.error("", e);
}
}
}

View File

@ -0,0 +1,171 @@
/*******************************************************************************
* Copyright (c) MOBAC developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
******************************************************************************/
package mobac.tools;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
public class MapSourceCapabilityGUI extends JFrame implements ActionListener {
private static final String[] STATUS = {"failed", "success"};
private final List<MapSourceCapabilityDetector> result;
private final JTable table;
private final JButton button;
private Thread workerThread = null;
public MapSourceCapabilityGUI(List<MapSourceCapabilityDetector> result) throws HeadlessException {
super("Map source capabilities");
setLayout(new BorderLayout());
this.result = result;
table = new JTable(new Model());
table.setDefaultRenderer(Object.class, new Renderer());
table.getColumnModel().getColumn(1).setMaxWidth(100);
button = new JButton("Detection running - abort detection");
button.addActionListener(this);
add(table.getTableHeader(), BorderLayout.NORTH);
add(table, BorderLayout.CENTER);
add(button, BorderLayout.SOUTH);
setSize(800, 500);
Dimension dScreen = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((dScreen.width - getWidth()) / 2, (dScreen.height - getHeight()) / 2);
}
public void refresh() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
table.revalidate();
table.repaint();
}
});
}
@Override
public void actionPerformed(ActionEvent e) {
if (workerThread != null) {
workerThread.interrupt();
} else {
dispose();
}
}
public void workerFinished() {
workerThread = null;
button.setText("Close");
}
public Thread getWorkerThread() {
return workerThread;
}
public void setWorkerThread(Thread workerThread) {
this.workerThread = workerThread;
}
private class Model extends AbstractTableModel {
public int getRowCount() {
return result.size();
}
public Object getValueAt(int rowIndex, int columnIndex) {
MapSourceCapabilityDetector mscd = result.get(rowIndex);
switch (columnIndex) {
case 0 :
return STATUS[mscd.isSuccess() ? 1 : 0];
case 1 :
return mscd.getZoom();
case 2 :
return mscd.getRecommendedTileUpdate();
case 3 :
return mscd.iseTagPresent();
case 4 :
return mscd.isLastModifiedTimePresent();
case 5 :
return mscd.isIfNoneMatchSupported();
case 6 :
return mscd.isIfModifiedSinceSupported();
case 7 :
return mscd.getContentType();
}
return null;
}
public int getColumnCount() {
return 8;
}
public String getColumnName(int column) {
switch (column) {
case 0 :
return "Test";
case 1 :
return "Zoom";
case 2 :
return "tileUpdate recommendation";
case 3 :
return "eTag";
case 4 :
return "LastModified";
case 5 :
return "IfNoneMatch";
case 6 :
return "IfModifiedSince";
case 7 :
return "Content type";
}
return null;
}
}
private static class Renderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
this.setHorizontalAlignment(JLabel.CENTER);
Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if ((column > 2) && (value instanceof Boolean) && ((Boolean) value)) {
c.setBackground(Color.GREEN);
} else {
c.setBackground(Color.WHITE);
}
return c;
}
}
}

View File

@ -0,0 +1,467 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis2.description.java2wsdl.bytecode;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
/**
* This is the class file reader for obtaining the parameter names for declared
* methods in a class. The class must have debugging attributes for us to obtain
* this information.
* <p>
* <p/>
* This does not work for inherited methods. To obtain parameter names for
* inherited methods, you must use a paramReader for the class that originally
* declared the method.
* <p>
* <p/>
* don't get tricky, it's the bare minimum. Instances of this class are not
* threadsafe -- don't share them.
* <p>
*/
public class ClassReader extends ByteArrayInputStream {
// constants values that appear in java class files,
// from jvm spec 2nd ed, section 4.4, pp 103
private static final int CONSTANT_Class = 7;
private static final int CONSTANT_Fieldref = 9;
private static final int CONSTANT_Methodref = 10;
private static final int CONSTANT_InterfaceMethodref = 11;
private static final int CONSTANT_String = 8;
private static final int CONSTANT_Integer = 3;
private static final int CONSTANT_Float = 4;
private static final int CONSTANT_Long = 5;
private static final int CONSTANT_Double = 6;
private static final int CONSTANT_NameAndType = 12;
private static final int CONSTANT_Utf8 = 1;
/*
* java 8 9 10 11 new tokens
* https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html
*/
private static final int CONSTANT_MethodHandle = 15;
private static final int CONSTANT_MethodType = 16;
private static final int CONSTANT_Dynamic = 17;
private static final int CONSTANT_InvokeDynamic = 18;
private static final int CONSTANT_Module = 19;
private static final int CONSTANT_Package = 20;
/* end of ava 8 9 10 11 new tokens */
/**
* the constant pool. constant pool indices in the class file directly index
* into this array. The value stored in this array is the position in the class
* file where that constant begins.
*/
private int[] cpoolIndex;
private Object[] cpool;
private final Map<String, Method> attrMethods;
/**
* Loads the bytecode for a given class, by using the class's defining
* classloader and assuming that for a class named P.C, the bytecodes are in a
* resource named /P/C.class.
*
* @param c
* the class of interest
* @return Returns a byte array containing the bytecode
* @throws IOException
*/
protected static byte[] getBytes(Class<?> c) throws IOException {
InputStream fin = c.getResourceAsStream('/' + c.getName().replace('.', '/') + ".class");
if (fin == null) {
throw new IOException("Unable to load bytecode for class " + c.getName());
}
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int actual;
do {
actual = fin.read(buf);
if (actual > 0) {
out.write(buf, 0, actual);
}
} while (actual > 0);
return out.toByteArray();
} finally {
fin.close();
}
}
static String classDescriptorToName(String desc) {
return desc.replace('/', '.');
}
protected static Map<String, Method> findAttributeReaders(Class<?> c) {
HashMap<String, Method> map = new HashMap<String, Method>();
Method[] methods = c.getMethods();
for (int i = 0; i < methods.length; i++) {
String name = methods[i].getName();
if (name.startsWith("read") && methods[i].getReturnType() == void.class) {
map.put(name.substring(4), methods[i]);
}
}
return map;
}
protected static String getSignature(Member method, Class<?>[] paramTypes) {
// compute the method descriptor
StringBuffer b = new StringBuffer((method instanceof Method) ? method.getName() : "<init>");
b.append('(');
for (int i = 0; i < paramTypes.length; i++) {
addDescriptor(b, paramTypes[i]);
}
b.append(')');
if (method instanceof Method) {
addDescriptor(b, ((Method) method).getReturnType());
} else if (method instanceof Constructor<?>) {
addDescriptor(b, void.class);
}
return b.toString();
}
private static void addDescriptor(StringBuffer b, Class<?> c) {
if (c.isPrimitive()) {
if (c == void.class) {
b.append('V');
} else if (c == int.class) {
b.append('I');
} else if (c == boolean.class) {
b.append('Z');
} else if (c == byte.class) {
b.append('B');
} else if (c == short.class) {
b.append('S');
} else if (c == long.class) {
b.append('J');
} else if (c == char.class) {
b.append('C');
} else if (c == float.class) {
b.append('F');
} else if (c == double.class) {
b.append('D');
}
} else if (c.isArray()) {
b.append('[');
addDescriptor(b, c.getComponentType());
} else {
b.append('L').append(c.getName().replace('.', '/')).append(';');
}
}
/**
* @return Returns the next unsigned 16 bit value.
*/
protected final int readShort() {
return (read() << 8) | read();
}
/**
* @return Returns the next signed 32 bit value.
*/
protected final int readInt() {
return (read() << 24) | (read() << 16) | (read() << 8) | read();
}
/**
* Skips n bytes in the input stream.
*/
protected void skipFully(int n) throws IOException {
while (n > 0) {
int c = (int) skip(n);
if (c == 0) {
throw new EOFException("Error looking for paramter names in bytecode: unexpected end of file");
}
n -= c;
}
}
protected final Member resolveMethod(int index) throws IOException, ClassNotFoundException, NoSuchMethodException {
int oldPos = pos;
try {
Member m = (Member) cpool[index];
if (m == null) {
pos = cpoolIndex[index];
Class<?> owner = resolveClass(readShort());
NameAndType nt = resolveNameAndType(readShort());
String signature = nt.name + nt.type;
if (nt.name.equals("<init>")) {
Constructor<?>[] ctors = owner.getConstructors();
for (int i = 0; i < ctors.length; i++) {
String sig = getSignature(ctors[i], ctors[i].getParameterTypes());
if (sig.equals(signature)) {
cpool[index] = m = ctors[i];
return m;
}
}
} else {
Method[] methods = owner.getDeclaredMethods();
for (int i = 0; i < methods.length; i++) {
String sig = getSignature(methods[i], methods[i].getParameterTypes());
if (sig.equals(signature)) {
cpool[index] = m = methods[i];
return m;
}
}
}
throw new NoSuchMethodException(signature);
}
return m;
} finally {
pos = oldPos;
}
}
protected final Field resolveField(int i) throws IOException, ClassNotFoundException, NoSuchFieldException {
int oldPos = pos;
try {
Field f = (Field) cpool[i];
if (f == null) {
pos = cpoolIndex[i];
Class<?> owner = resolveClass(readShort());
NameAndType nt = resolveNameAndType(readShort());
cpool[i] = f = owner.getDeclaredField(nt.name);
}
return f;
} finally {
pos = oldPos;
}
}
private static class NameAndType {
String name;
String type;
public NameAndType(String name, String type) {
this.name = name;
this.type = type;
}
}
protected final NameAndType resolveNameAndType(int i) throws IOException {
int oldPos = pos;
try {
NameAndType nt = (NameAndType) cpool[i];
if (nt == null) {
pos = cpoolIndex[i];
String name = resolveUtf8(readShort());
String type = resolveUtf8(readShort());
cpool[i] = nt = new NameAndType(name, type);
}
return nt;
} finally {
pos = oldPos;
}
}
protected final Class<?> resolveClass(int i) throws IOException, ClassNotFoundException {
int oldPos = pos;
try {
Class<?> c = (Class<?>) cpool[i];
if (c == null) {
pos = cpoolIndex[i];
String name = resolveUtf8(readShort());
cpool[i] = c = Class.forName(classDescriptorToName(name));
}
return c;
} finally {
pos = oldPos;
}
}
protected ClassReader(byte[] buf, Map<String, Method> attrMethods) {
super(buf);
this.attrMethods = attrMethods;
}
protected final void readCpool() throws IOException {
int count = readShort(); // cpool count
cpoolIndex = new int[count];
cpool = new Object[count];
for (int i = 1; i < count; i++) {
int c = read();
cpoolIndex[i] = super.pos;
switch (c) { // constant pool tag
case CONSTANT_Fieldref :
case CONSTANT_Methodref :
case CONSTANT_InterfaceMethodref :
case CONSTANT_NameAndType :
readShort(); // class index or (12) name index
// fall through
case CONSTANT_Class :
case CONSTANT_String :
readShort(); // string index or class index
break;
case CONSTANT_Long :
case CONSTANT_Double :
readInt(); // hi-value
// see jvm spec section 4.4.5 - double and long cpool
// entries occupy two "slots" in the cpool table.
i++;
// fall through
case CONSTANT_Integer :
case CONSTANT_Float :
readInt(); // value
break;
case CONSTANT_Utf8 :
int len = readShort();
skipFully(len);
break;
case CONSTANT_MethodHandle :
read(); // reference kind
readShort(); // reference index
break;
case CONSTANT_MethodType :
readShort(); // descriptor index
break;
case CONSTANT_Dynamic :
readShort(); // bootstrap method attr index
readShort(); // name and type index
break;
case CONSTANT_InvokeDynamic :
readShort(); // bootstrap method attr index
readShort(); // name and type index
break;
default :
// corrupt class file
throw new IllegalStateException(
"Error looking for parameter names in bytecode: unexpected bytes in file");
}
}
}
protected final void skipAttributes() throws IOException {
int count = readShort();
for (int i = 0; i < count; i++) {
readShort(); // name index
skipFully(readInt());
}
}
protected final String resolveUtf8(int i) throws IOException {
int oldPos = pos;
try {
String s = (String) cpool[i];
if (s == null) {
pos = cpoolIndex[i];
int len = readShort();
skipFully(len);
cpool[i] = s = new String(buf, pos - len, len, StandardCharsets.UTF_8);
}
return s;
} finally {
pos = oldPos;
}
}
/**
* Reads a code attribute.
*
* @throws IOException
*/
public void readCode() throws IOException {
readShort(); // max stack
readShort(); // max locals
skipFully(readInt()); // code
skipFully(8 * readShort()); // exception table
// read the code attributes (recursive). This is where
// we will find the LocalVariableTable attribute.
readAttributes();
}
/**
* Reads an attributes array. The elements of a class file that can contain
* attributes are: fields, methods, the class itself, and some other types of
* attributes.
*/
protected final void readAttributes() throws IOException {
int count = readShort();
for (int i = 0; i < count; i++) {
int nameIndex = readShort(); // name index
int attrLen = readInt();
int curPos = pos;
String attrName = resolveUtf8(nameIndex);
Method m = attrMethods.get(attrName);
if (m != null) {
try {
m.invoke(this);
} catch (IllegalAccessException e) {
pos = curPos;
skipFully(attrLen);
} catch (InvocationTargetException e) {
try {
throw e.getTargetException();
} catch (Error ex) {
throw ex;
} catch (RuntimeException ex) {
throw ex;
} catch (IOException ex) {
throw ex;
} catch (Throwable ex) {
pos = curPos;
skipFully(attrLen);
}
}
} else {
// don't care what attribute this is
skipFully(attrLen);
}
}
}
}

View File

@ -0,0 +1,224 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis2.description.java2wsdl.bytecode;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Map;
/**
* This is the class file reader for obtaining the parameter names for declared
* methods in a class. The class must have debugging attributes for us to obtain
* this information.
* <p>
* <p/>
* This does not work for inherited methods. To obtain parameter names for
* inherited methods, you must use a paramReader for the class that originally
* declared the method.
* <p>
* <p/>
* don't get tricky, it's the bare minimum. Instances of this class are not
* threadsafe -- don't share them.
* <p>
*/
public class ParamReader extends ClassReader {
private String methodName;
private final Map<String, MethodInfo> methods = new HashMap<>();
private Class<?>[] paramTypes;
/**
* Processes a class file, given it's class. We'll use the defining classloader
* to locate the bytecode.
*
* @param c
* @throws IOException
*/
public ParamReader(Class<?> c) throws IOException {
this(getBytes(c));
}
/**
* Processes the given class bytes directly.
*
* @param b
* @throws IOException
*/
public ParamReader(byte[] b) throws IOException {
super(b, findAttributeReaders(ParamReader.class));
// check the magic number
if (readInt() != 0xCAFEBABE) {
// not a class file!
throw new IOException(
"Error looking for paramter names in bytecode: input does not appear to be a valid class file");
}
readShort(); // minor version
readShort(); // major version
readCpool(); // slurp in the constant pool
readShort(); // access flags
readShort(); // this class name
readShort(); // super class name
int count = readShort(); // ifaces count
for (int i = 0; i < count; i++) {
readShort(); // interface index
}
count = readShort(); // fields count
for (int i = 0; i < count; i++) {
readShort(); // access flags
readShort(); // name index
readShort(); // descriptor index
skipAttributes(); // field attributes
}
count = readShort(); // methods count
for (int i = 0; i < count; i++) {
readShort(); // access flags
int m = readShort(); // name index
String name = resolveUtf8(m);
int d = readShort(); // descriptor index
this.methodName = name + resolveUtf8(d);
readAttributes(); // method attributes
}
}
public void readCode() throws IOException {
readShort(); // max stack
int maxLocals = readShort(); // max locals
MethodInfo info = new MethodInfo(maxLocals);
if (methodName != null) {
methods.put(methodName, info);
}
skipFully(readInt()); // code
skipFully(8 * readShort()); // exception table
// read the code attributes (recursive). This is where
// we will find the LocalVariableTable attribute.
readAttributes();
}
/**
* Returns the names of the declared parameters for the given constructor. If we
* cannot determine the names, return null. The returned array will have one
* name per parameter. The length of the array will be the same as the length of
* the Class[] array returned by Constructor.getParameterTypes().
*
* @param ctor
* @return Returns String[] array of names, one per parameter, or null
*/
public String[] getParameterNames(Constructor<?> ctor) {
paramTypes = ctor.getParameterTypes();
return getParameterNames(ctor, paramTypes);
}
/**
* Returns the names of the declared parameters for the given method. If we
* cannot determine the names, return null. The returned array will have one
* name per parameter. The length of the array will be the same as the length of
* the Class[] array returned by Method.getParameterTypes().
*
* @param method
* @return Returns String[] array of names, one per parameter, or null
*/
public String[] getParameterNames(Method method) {
paramTypes = method.getParameterTypes();
return getParameterNames(method, paramTypes);
}
protected String[] getParameterNames(Member member, Class<?>[] paramTypes) {
// look up the names for this method
MethodInfo info = methods.get(getSignature(member, paramTypes));
// we know all the local variable names, but we only need to return
// the names of the parameters.
if (info != null) {
String[] paramNames = new String[paramTypes.length];
int j = Modifier.isStatic(member.getModifiers()) ? 0 : 1;
boolean found = false; // did we find any non-null names
for (int i = 0; i < paramNames.length; i++) {
if (info.names[j] != null) {
found = true;
paramNames[i] = info.names[j];
}
j++;
if (paramTypes[i] == double.class || paramTypes[i] == long.class) {
// skip a slot for 64bit params
j++;
}
}
if (found) {
return paramNames;
} else {
return null;
}
} else {
return null;
}
}
private static class MethodInfo {
String[] names;
public MethodInfo(int maxLocals) {
names = new String[maxLocals];
}
}
private MethodInfo getMethodInfo() {
MethodInfo info = null;
if (methodName != null) {
info = methods.get(methodName);
}
return info;
}
/**
* This is invoked when a LocalVariableTable attribute is encountered.
*
* @throws IOException
*/
public void readLocalVariableTable() throws IOException {
int len = readShort(); // table length
MethodInfo info = getMethodInfo();
for (int j = 0; j < len; j++) {
readShort(); // start pc
readShort(); // length
int nameIndex = readShort(); // name_index
readShort(); // descriptor_index
int index = readShort(); // local index
if (info != null) {
info.names[index] = resolveUtf8(nameIndex);
}
}
}
}

View File

@ -0,0 +1 @@
mobac.revision.hide=true

View File

@ -0,0 +1,22 @@
/**
OpenStreetMap Example:
Input parameters for this script: "zoom", "x" and "y"
**/
String getTileUrl( int zoom, int x, int y ) {
return "https://tileserver.4umaps.com/" + zoom + "/" + x + "/" + y + ".png";
}
void addHeaders( java.net.HttpURLConnection conn) {
// Optional: set HTTP Referer or Cookies
conn.addRequestProperty("Cookie","test=12345");
conn.addRequestProperty("Referer","http://www.openstreetmap.org");
}
tileType = "png"; // required - image format "png" "jpg" or "gif"
// Default size of each tile is 256x256 pixel
tileSize = 256; // optional
minZoom = 0; // optional
maxZoom = 22; // optional
tileUpdate = TileUpdate.None; // optional - possibilities:
// TileUpdate.IfNoneMatch, TileUpdate.ETag, TileUpdate.IfModifiedSince, TileUpdate.LastModified, TileUpdate.None

View File

@ -0,0 +1,7 @@
String getTileUrl( int zoom, int x, int y ) {
return "";
}
void addHeaders( java.net.HttpURLConnection conn ) {
// conn.addRequestProperty("header-name","vale");
}
tileType = "";

View File

@ -0,0 +1,10 @@
/**
OpenStreetMap Example:
Input parameters for this script: "zoom", "x" and "y"
**/
String getTileUrl( int zoom, int x, int y ) {
baseUrl = "https://tileserver.4umaps.com/"; // maps4u
return baseUrl + zoom + "/" + x + "/" + y + ".png";
}
tileType = "png";
tileUpdate = TileUpdate.IfModifiedSince;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,9 @@
Toolbar Icons by Ruby Software
http://www.iconshut.com/application-icons/1186-toolbar-icons.html
help-icon:
http://commons.wikimedia.org/wiki/File:Torchlight_help_icon.svg
capabilities-icon.png:
Scrap Icons By Deleket Application Icons
http://www.iconshut.com/application-icons/1166-scrap-icons.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

45
mappacks/build.gradle Normal file
View File

@ -0,0 +1,45 @@
plugins {
}
subprojects {
apply plugin: 'java'
apply plugin: 'at.bxm.svntools'
dependencies {
compileOnly project(':mobac')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
jar {
archiveFileName = "mp-${project.name}.jar"
manifest {
attributes "MapPackVersion": "1"
attributes "MapPackName": "${project.name}"
attributes "MapPackBuild-Date": new Date().toString()
attributes "MapPackRevision": "$svntools.info.revisionNumber"
}
doLast {
def keystore = file("${rootProject.projectDir}/keys/keystore.jks")
if (keystore.exists()) {
def keystoreProps = new Properties()
file("${rootProject.projectDir}/keys/keystore.properties").withInputStream { keystoreProps.load(it) }
println("Signing map pack ${project.name}")
ant.signjar(
jar: "build/libs/mp-${project.name}.jar",
destDir: "build/libs/",
alias: "mappack",
storetype: "jks",
keystore: "${rootProject.projectDir}/keys/keystore.jks",
storepass: keystoreProps.getProperty("keystore.password"),
verbose: false,
preservelastmodified: "true"
)
}
}
}
test {
useJUnitPlatform()
}
}

View File

View File

@ -0,0 +1,4 @@
mobac.mapsources.mappacks.openstreetmap.Hikebikemap
#mobac.mapsources.mappacks.openstreetmap.Osm4uMaps
mobac.mapsources.mappacks.openstreetmap.OsmPublicTransport
mobac.mapsources.mappacks.openstreetmap.WanderreitkarteAbo

View File

@ -1,9 +1,14 @@
mobac.mapsources.mappacks.region_america_north.CanadaToporama
mobac.mapsources.mappacks.region_america_north.ChartbundleENRA
mobac.mapsources.mappacks.region_america_north.ChartbundleENRH
mobac.mapsources.mappacks.region_america_north.ChartbundleENRL
mobac.mapsources.mappacks.region_america_north.ChartbundleSEC
mobac.mapsources.mappacks.region_america_north.ChartbundleTAC
mobac.mapsources.mappacks.region_america_north.ChartbundleWAC
mobac.mapsources.mappacks.region_america_north.ChartbundleHC
mobac.mapsources.mappacks.region_america_north.USNationalMapImagery
mobac.mapsources.mappacks.region_america_north.USNationalMapImageryTopo
mobac.mapsources.mappacks.region_america_north.USNationalMapTopo
mobac.mapsources.mappacks.region_america_north.USNationalMapRelief
mobac.mapsources.mappacks.region_america_north.ThunderforestOutdoors
mobac.mapsources.mappacks.region_america_north.ThunderforestLandscape

View File

View File

@ -0,0 +1,3 @@
mobac.mapsources.mappacks.region_europe.IgnBase
mobac.mapsources.mappacks.region_europe.IgnMtmRaster
mobac.mapsources.mappacks.region_europe.IgnPnoa

View File

View File

@ -2,7 +2,4 @@ mobac.mapsources.mappacks.region_europe_east.UmpWawPl
mobac.mapsources.mappacks.region_europe_east.FreemapSlovakia
mobac.mapsources.mappacks.region_europe_east.FreemapSlovakiaCycling
mobac.mapsources.mappacks.region_europe_east.FreemapSlovakiaHiking
mobac.mapsources.mappacks.region_europe_east.MoldovaPointMd
mobac.mapsources.mappacks.region_europe_east.Turaterkep
mobac.mapsources.mappacks.region_europe_east.OSMapaTopo
mobac.mapsources.mappacks.region_europe_east.OSMapaTopoContours
mobac.mapsources.mappacks.region_europe_east.Turaterkep

View File

View File

@ -0,0 +1,5 @@
0ee7558c3f16f4c20595688832111f61 mp-region_oceania.jar
4a9e05897159ab4a7b49fed221d6cdd1 mp-openstreetmap.jar
2e6ca98b3f49a6b9a69d454acceb9696 mp-region_america_north.jar
dbeb826768bb0cfdc0307a6e88016186 mp-region_europe_east.jar
aa39059d9abb94b99d2a2f084d54179f mp-region_europe.jar

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,74 @@
Ireland Map
http://ims0.osiemaps.ie/website/publicviewer/main.aspx?id=&utype=&ecom=S1&user=
Reason: Wrong tile size (512x512)
Mapy.cz
http://www.mapy.cz/
Reason: Incompatible zoom levels
SwissGeo
http://www.swissgeo.ch/surf.php
Reason: Wrong tile size (400x400)
Enrio.se
http://kartor.eniro.se/
Reason: Incompatible zoom levels
OpenSeaMap:
http://www.openseamap.org/
Reason: map is only an overlay to OSM Mapnik
Topo Schweiz
www.gps-tracks.com
Reason: Wrong tile size (200x200)
Topo Deutschland
www.gps-tracks.com
Reason: Wrong tile size (400x400)
Topo Österreich
www.gps-tracks.com
Reason: Wrong tile size (200x200)
Centrum.cz
http://amapy.centrum.cz
Reason: Wrong projection
Mapy.sk
http://mapy.atlas.sk
Reason: Wrong tile size (250x250)
Géoportail
http://www.geoportail.fr/5069711/visu2D/afficher-en-2d.htm
Reason: Incompatible zoom levels
Asplan Viak Internet AS
http://kart.kystverket.no/advanced_default.aspx?lang=eng
Reason: Unsupported projection: "Universal Transverse Mercator" (UTM)
Japanese Topo Maps
http://watchizu.gsi.go.jp/watchizu.html?meshcode=49324455
Reason: Unsupported tile size (300x357)
ICC Catalunya
http://cygnus.icc.cat/mt10m/
http://cygnus.icc.cat/bt5m/
Reason: different projection (Plate Carrée projection based on Latitude / Longitude WGS 84)
Zumi Poland
http://mapy.zumi.pl/
Reson: Tile size 250x250
Hungarian Turistautak.hu
http://www.turistautak.hu/maps.php?id=magyarorszag&image=raster
Reson: Tile size 410x300
Mapa Polski Targeo
http://mapa.targeo.pl/
Reson: Tile size 200x200
NASA World Wind
Reason: Incompatible projection, incompatible tile size (512x512)
Mapplus.ch / Map+
Reason: License problem with swisstopo

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
SaxCount.exe -v=always -n -s -f %1

Binary file not shown.

View File

@ -1,35 +0,0 @@
<launch4jConfig>
<dontWrapJar>true</dontWrapJar>
<headerType>gui</headerType>
<jar>Mobile_Atlas_Creator.jar</jar>
<outfile>..\Mobile Atlas Creator.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<customProcName>false</customProcName>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon>mobac.ico</icon>
<jre>
<path></path>
<minVersion>1.6.0_14</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<maxHeapSize>1024</maxHeapSize>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>-</txtFileVersion>
<fileDescription>Mobile Atlas Creator Windows Launcher</fileDescription>
<copyright>MOBAC developers</copyright>
<productVersion>1.0.0.0</productVersion>
<txtProductVersion>-</txtProductVersion>
<productName>Mobile Atlas Creator</productName>
<companyName></companyName>
<internalName>Mobile Atlas Creator 1024MB max Heap</internalName>
<originalFilename>Mobile Atlas Creator.exe</originalFilename>
</versionInfo>
</launch4jConfig>

BIN
misc/mobac.icns Normal file

Binary file not shown.

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0" creator="GPSBabel - http://www.gpsbabel.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<time>2009-09-04T13:56:32Z</time>
<bounds minlat="49.979487761" minlon="7.591552734" maxlat="52.529485569"
maxlon="13.402633667" />
<rte>
<name>GPX1.1 Route A</name>
<rtept lat="52.514706135" lon="13.349847794">
<name>Route A - P1</name>
</rtept>
<rtept lat="52.516429788" lon="13.377656937">
<name>Route A - P2</name>
</rtept>
<rtept lat="52.509456412" lon="13.376798630">
<name>Route A - P3</name>
</rtept>
<rtept lat="52.506818254" lon="13.368215561">
<name>Route A - P4</name>
</rtept>
<rtept lat="52.507340674" lon="13.390445709">
<name>Route A - P5</name>
</rtept>
<rtept lat="52.519772437" lon="13.402633667">
<name>Route A - P6</name>
</rtept>
<rtept lat="52.529485569" lon="13.378601074">
<name>Route A - P7</name>
</rtept>
</rte>
<rte>
<name>GPX1.1 Route B</name>
<rtept lat="50.134664322" lon="8.657226563">
<name>Route B - P1</name>
</rtept>
<rtept lat="50.457504020" lon="8.662719727">
<name>Route B - P2</name>
</rtept>
<rtept lat="50.369992583" lon="7.591552734">
<name>Route B - P3</name>
</rtept>
<rtept lat="49.979487761" lon="7.882690430">
<name>Route B - P4</name>
</rtept>
<rtept lat="50.131143155" lon="8.591308594">
<name>Route B - P5</name>
</rtept>
</rte>
</gpx>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0" creator="GPSBabel - http://www.gpsbabel.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<time>2009-09-04T13:44:53Z</time>
<bounds minlat="52.506818254" minlon="13.349847794" maxlat="52.529485569"
maxlon="13.402633667" />
<trk>
<name>gpx10 track</name>
<trkseg>
<trkpt lat="52.514706135" lon="13.349847794">
</trkpt>
<trkpt lat="52.516429788" lon="13.377656937">
</trkpt>
<trkpt lat="52.509456412" lon="13.376798630">
</trkpt>
<trkpt lat="52.506818254" lon="13.368215561">
</trkpt>
<trkpt lat="52.507340674" lon="13.390445709">
</trkpt>
<trkpt lat="52.519772437" lon="13.402633667">
</trkpt>
<trkpt lat="52.529485569" lon="13.378601074">
</trkpt>
</trkseg>
</trk>
</gpx>

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0" creator="GPSBabel - http://www.gpsbabel.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<time>2009-09-04T14:03:05Z</time>
<bounds minlat="49.979487761" minlon="7.591552734" maxlat="52.529485569"
maxlon="13.402633667" />
<wpt lat="52.514706135" lon="13.349847794">
<name>Route A - P1</name>
<cmt>Route A - P1</cmt>
<desc>Route A - P1</desc>
</wpt>
<wpt lat="52.516429788" lon="13.377656937">
<name>Route A - P2</name>
<cmt>Route A - P2</cmt>
<desc>Route A - P2</desc>
</wpt>
<wpt lat="52.509456412" lon="13.376798630">
<name>Route A - P3</name>
<cmt>Route A - P3</cmt>
<desc>Route A - P3</desc>
</wpt>
<wpt lat="52.506818254" lon="13.368215561">
<name>Route A - P4</name>
<cmt>Route A - P4</cmt>
<desc>Route A - P4</desc>
</wpt>
<wpt lat="52.507340674" lon="13.390445709">
<name>Route A - P5</name>
<cmt>Route A - P5</cmt>
<desc>Route A - P5</desc>
</wpt>
<wpt lat="52.519772437" lon="13.402633667">
<name>Route A - P6</name>
<cmt>Route A - P6</cmt>
<desc>Route A - P6</desc>
</wpt>
<wpt lat="52.529485569" lon="13.378601074">
<name>Route A - P7</name>
<cmt>Route A - P7</cmt>
<desc>Route A - P7</desc>
</wpt>
<wpt lat="50.134664322" lon="8.657226563">
<name>Route B - P1</name>
<cmt>Route B - P1</cmt>
<desc>Route B - P1</desc>
</wpt>
<wpt lat="50.457504020" lon="8.662719727">
<name>Route B - P2</name>
<cmt>Route B - P2</cmt>
<desc>Route B - P2</desc>
</wpt>
<wpt lat="50.369992583" lon="7.591552734">
<name>Route B - P3</name>
<cmt>Route B - P3</cmt>
<desc>Route B - P3</desc>
</wpt>
<wpt lat="49.979487761" lon="7.882690430">
<name>Route B - P4</name>
<cmt>Route B - P4</cmt>
<desc>Route B - P4</desc>
</wpt>
<wpt lat="50.131143155" lon="8.591308594">
<name>Route B - P5</name>
<cmt>Route B - P5</cmt>
<desc>Route B - P5</desc>
</wpt>
</gpx>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="TrekBuddy Atlas Creator" version="1.1"/>

View File

@ -0,0 +1,37 @@
<?xml version='1.0' encoding='UTF-8'?>
<gpx version="1.1" creator="JOSM GPX export" xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata>
<bounds minlat="52.492644399999996" minlon="13.3371458" maxlat="52.539434" maxlon="13.417931699999999" />
</metadata>
<trk> <trkseg>
<trkpt lat="52.52948556883107" lon="13.37860107421875">
</trkpt>
<trkpt lat="52.539434007449245" lon="13.360412990260565">
</trkpt>
<trkpt lat="52.525558015339115" lon="13.361540500442027">
</trkpt>
<trkpt lat="52.516717278279735" lon="13.337145841150726">
</trkpt>
<trkpt lat="52.51132536162416" lon="13.365932679948731">
</trkpt>
<trkpt lat="52.49416405091459" lon="13.34589312053841">
</trkpt>
<trkpt lat="52.505586599088545" lon="13.37198758897336">
</trkpt>
<trkpt lat="52.49264439531307" lon="13.390294352243597">
</trkpt>
<trkpt lat="52.50734067419732" lon="13.390445709228516">
</trkpt>
<trkpt lat="52.50688060993348" lon="13.41793165937415">
</trkpt>
<trkpt lat="52.5197724373965" lon="13.402633666992188">
</trkpt>
<trkpt lat="52.533255747390804" lon="13.405884628060832">
</trkpt>
<trkpt lat="52.52948556883107" lon="13.37860107421875">
</trkpt>
</trkseg>
</trk>
</gpx>

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="MEDIA-TOURS"
version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<rte>
<name>GPX1.1 Route A</name>
<rtept lat="52.51470613497887" lon=" 13.349847793579102">
<name>Route A - P1</name>
</rtept>
<rtept lat="52.51642978796417" lon=" 13.377656936645508">
<name>Route A - P2</name>
</rtept>
<rtept lat="52.50945641163729" lon=" 13.376798629760742">
<name>Route A - P3</name>
</rtept>
<rtept lat="52.50681825421263" lon=" 13.368215560913086">
<name>Route A - P4</name>
</rtept>
<rtept lat="52.50734067419732" lon=" 13.390445709228516">
<name>Route A - P5</name>
</rtept>
<rtept lat="52.5197724373965" lon=" 13.402633666992188">
<name>Route A - P6</name>
</rtept>
<rtept lat="52.52948556883107" lon=" 13.37860107421875">
<name>Route A - P7</name>
</rtept>
</rte>
<rte>
<name>GPX1.1 Route B</name>
<rtept lat="50.13466432216694" lon=" 8.6572265625">
<name>Route B - P1</name>
</rtept>
<rtept lat="50.45750402042058" lon=" 8.6627197265625">
<name>Route B - P2</name>
</rtept>
<rtept lat="50.36999258287717" lon=" 7.591552734375">
<name>Route B - P3</name>
</rtept>
<rtept lat="49.97948776108648" lon=" 7.8826904296875">
<name>Route B - P4</name>
</rtept>
<rtept lat="50.13114315479007" lon=" 8.59130859375">
<name>Route B - P5</name>
</rtept>
</rte>
</gpx>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="MEDIA-TOURS"
version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<trk>
<name>gpx10 track</name>
<trkseg>
<trkpt lat="52.51470613497887" lon=" 13.349847793579102"></trkpt>
<trkpt lat="52.51642978796417" lon=" 13.377656936645508"></trkpt>
<trkpt lat="52.50945641163729" lon=" 13.376798629760742"></trkpt>
<trkpt lat="52.50681825421263" lon=" 13.368215560913086"></trkpt>
<trkpt lat="52.50734067419732" lon=" 13.390445709228516"></trkpt>
<trkpt lat="52.5197724373965" lon=" 13.402633666992188"></trkpt>
<trkpt lat="52.52948556883107" lon=" 13.37860107421875"></trkpt>
</trkseg>
</trk>
</gpx>

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<gpx
version="1.1"
creator="GPSBabel - http://www.gpsbabel.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/1"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<time>2009-09-04T14:12:46Z</time>
<bounds minlat="49.979487761" minlon="7.591552734" maxlat="52.529485569" maxlon="13.402633667"/>
<wpt lat="52.514706135" lon="13.349847794">
<name>Route A - P1</name>
<cmt>Route A - P1</cmt>
<desc>Route A - P1</desc>
</wpt>
<wpt lat="52.516429788" lon="13.377656937">
<name>Route A - P2</name>
<cmt>Route A - P2</cmt>
<desc>Route A - P2</desc>
</wpt>
<wpt lat="52.509456412" lon="13.376798630">
<name>Route A - P3</name>
<cmt>Route A - P3</cmt>
<desc>Route A - P3</desc>
</wpt>
<wpt lat="52.506818254" lon="13.368215561">
<name>Route A - P4</name>
<cmt>Route A - P4</cmt>
<desc>Route A - P4</desc>
</wpt>
<wpt lat="52.507340674" lon="13.390445709">
<name>Route A - P5</name>
<cmt>Route A - P5</cmt>
<desc>Route A - P5</desc>
</wpt>
<wpt lat="52.519772437" lon="13.402633667">
<name>Route A - P6</name>
<cmt>Route A - P6</cmt>
<desc>Route A - P6</desc>
</wpt>
<wpt lat="52.529485569" lon="13.378601074">
<name>Route A - P7</name>
<cmt>Route A - P7</cmt>
<desc>Route A - P7</desc>
</wpt>
<wpt lat="50.134664322" lon="8.657226563">
<name>Route B - P1</name>
<cmt>Route B - P1</cmt>
<desc>Route B - P1</desc>
</wpt>
<wpt lat="50.457504020" lon="8.662719727">
<name>Route B - P2</name>
<cmt>Route B - P2</cmt>
<desc>Route B - P2</desc>
</wpt>
<wpt lat="50.369992583" lon="7.591552734">
<name>Route B - P3</name>
<cmt>Route B - P3</cmt>
<desc>Route B - P3</desc>
</wpt>
<wpt lat="49.979487761" lon="7.882690430">
<name>Route B - P4</name>
<cmt>Route B - P4</cmt>
<desc>Route B - P4</desc>
</wpt>
<wpt lat="50.131143155" lon="8.591308594">
<name>Route B - P5</name>
<cmt>Route B - P5</cmt>
<desc>Route B - P5</desc>
</wpt>
</gpx>

Some files were not shown because too many files have changed in this diff Show More