Description: Tectonicus Changed Tile Extractor (TCTE) is a batch file written to be used with the Tectonicus map render program to minimise wasted bandwidth when uploading your completed renders.
Background:
Tectonicus has the capacity to use a cache when rendering so as to avoid having to re-render unchanged tiles on subsequent runs of the program which use the same parameters. It outputs a list of the changed tiles to a text file changed.txt which can be used by subsequent tools / programs to upload only the changed tiles to a separate web hosting server/directory. Alternatively users can use the likes of rsync to upload only changed files without referencing changed.txt.
For those not experienced in using the likes of rsync etc and/or may be dealing with a remote host with limited capacity / security access to setup a syncing solution, TCTE can assist.
TCTE will create a local copy of all the changed tiles and other necessary files to end up with a discrete directory structure and contents which can then be uploaded/moved to your host without needlessly transferring megabytes of unchanged tiles - saving you time and bandwidth.
The code should be sufficiently commented to allow those with minimal batch file experience to understand what it's doing.
Requirements: Tectonicus map render program by OrangyTang versions 2.x (or for later 1.x versions use TCTE vers 1.2)
Windows XP/Vista/7/Server 2008 (32 or 64 bit) - only tested by the author on Win7 64 bit however
No earlier Windows versions are likely to work / are supported.
A bash based version for Tectonicus 1.x renders (see further down the thread) has been made by micomico which may assist Linux or Mac users. I'm personally not able to assist with any problems with it, although others in the thread may be able to do so.
Usage:
Run Tectonicus as normal (the batch file doesn't link to or run Tectonicus itself)
This batch file must be placed into the directory where Tectonicus has placed the *.html and changed.txt files.
This may be something like D:\tectonicusmap\tcte2.bat
(it must not be a root directory on the drive e.g. C:\tcte2.bat or D:\tcte2.bat)
The batch file itself can be safely renamed to something else so long as it retains the .bat extension
Double click / execute the batch file to run it
The batch file creates the copies of the files for later uploading in a TCTE_upload directory in the parent directory
e.g. D:\tectonicusmap\TCTE_upload\
Known Bugs/Limitations:
[Fixed] Currently doesn't work when the directory path contains spaces.
[FYI] Folder output changed with Tectonicus 1.37 (and now 2.00), meaning on the first run of v1.37 (or 2.00) all tiles will be "changed". TCTE can't do anything about this. (link)
[Limitation] Assumes your cache directory is called "cache" and resides in the same directory where your MapX directories appear. If you have customised this in Tectonicus then you need to set the 'cachedir' variable at row 49/53 in the batch file.
Bug Reports/Comments:
Feel free to post any bugs / comments in this thread. I make no promises on future updates however. The batch file was written for my own use and works for that purpose. I've noted others had similar needs so have posted it here in case they find it of use.
Changelog:
v1.0 2 May 2011 Original release
v1.1 19 May 2011 Updated to work with paths that contain spaces
v1.2 19 May 2011 Updated to add variable to hold the cache directory %cachedir%
v2.0 20 June 2011 Updated to work for version 2.00 of Tectonicus
Add css and xml files and Compass image to be copied over in addition to the existing
html, js, txt (I'm in the habit of copying the Tectonicus xml config file over for reference)
v2.1 20 June 2011 Fix bug causing new Views directories to be deleted, and copy over their contents
v2.2 21 June 2011 Updated for Tectonicus version 2.01 which includes "views" in the changed.txt file
Derivative Works:
It's just a batch file, however it is my original work apart from a small section derived from a forum post as noted in the code comments. You may not post it elsewhere without my explicit permission unless you've made significantfunctional changes. If you do make significant functional changes and post your derivative work elsewhere please have the courtesy to leave attributions within the code.
Also, please do not link to this thread via advertising redirects - it's just rude.
Disclaimer:
You use this batch file at your own risk, there is no warranty given and no recourse for any loss caused by it's use. It contains sections of code that delete files and directories, and as such you should not attempt to edit the code unless you know what you are doing or you could inadvertently delete critical portions of your system/data.
The author of Tectonicus (OrangyTang) has no relationship to or responsibility for the creation of this batch file and should not be contacted for any problems experienced.
Thanks to:
OrangyTang for creating and updating such a wonderful rendering program - Tectonicus
All the users on the Tectonicus forum thread who have helped myself or others in using the program.
Download Link (use right click - save as): version 2.2 - for Tectonicus v2.01 or later version 1.2 - for Tectonicus v1.x
Current versions of the code:
Version 2.2
Tectonicus Changed Tile Extractor (TCTE)
by Thermal Ions
Version 2.2 - 21 June 2011
For use with Tectonicus map render program (version 2) when using cache and remote server
Will create a copy of only the changed tiles as defined in the changed.txt file
along with other required files for subsequent packaging/upload to a remote server
thus minimising bandwidth required for incremental map changes
Only tested on Windows 7 64 bit system but should work on XP/Vista/7/Server 2008 32/64 bit systems
Does not work on earlier versions of windows - update already will you.
Does not work on Linux / Mac - I don't have either so will not be porting to them.
It's just a batch file, however it is my original work apart from a small section noted below
You may not post it elsewhere without my explicit permission unless you've made significant functional
changes. If you do make significant functional changes and post your derivative work elsewhere please
have the courtesy to leave attributions within the code.
Also, please do not link to the forum thread or download via advertising redirects - it's just rude.
Strip base directory section adapted from code posted at http://answers.yahoo.com/question/index?qid=20090325111419AAGv5Kz
The author of Tectonicus (OrangyTang) has no relationship to or responsibility for the creation
of this batch file and should not be contacted for any problems experienced.
Usage:
This batch file must be placed into the directory where tectonicus has placed the *.html and changed.txt files
This may be something like D:\tectonicusmap\tcte2.bat
(it must not be a root directory on the drive e.g. C:\tcte2.bat or D:\tcte2.bat)
The batch file itself can be safely renamed to something else so long as it retains the .bat extension
Double click / execute the batch file to run and create copies of the files for upload
The batch file creates the output for upload in the parent directory
e.g. D:\tectonicusmap\TCTE_upload\
You use this batch file at your own risk, no warranty given, no recourse for any loss .... blah blah blah
It should be safe to use in most cases, but bear in mind it does contain code to remove directory trees
so particularly if you start editing the code it could wipe critical aspects of your system.
Current version and discussion can be found on the forum thread: http://www.minecraftforum.net/topic/300582-tooltectonicus-changed-tile-extractor-tcte-v11/
v1.0 2 May 2011 Original release
v1.1 19 May 2011 Updated to work with paths that contain spaces
v1.2 19 May 2011 Updated to add variable to hold the cache directory %cachedir%
v2.0 20 June 2011 Updated to work for version 2.00 of Tectonicus
Add css and xml files and Compass image to be copied over in addition to the existing
html, js, txt (I'm in the habit of copying the Tectonicus xml config file over for reference)
v2.1 20 June 2011 Fix bug causing new Views directories to be deleted, and copy over their contents
v2.2 21 June 2011 Updated for Tectonicus version 2.01 which includes "views" in the changed.txt file
@echo off
Setting variables - Users can set their cache directory name (don't include the path)
if they've changed it from the Tectonicus default of 'cache', as well as setting
the TCTE output directory (changes_name). Don't change the variables after those two.
setlocal EnableDelayedExpansion
set cachedir=cache
set changes_name=tcte_upload
set tec_output_dir=%CD%
set changes_dir=%tec_output_dir%\..\%changes_name%\
set strip=%tec_output_dir%\
echo Tectonicus Changed Tile Extractor (TCTE)
echo by Thermal Ions
echo Version 2.2 - 21 June 2011
echo.
echo http://www.minecraftforum.net/topic/300582-tooltectonicus-changed-tile-extractor-tcte-v11/
echo.
echo You use this batch file at your own risk, no warranty given,
echo no recourse for any loss.
echo.
set /p cont= Are you sure you wish to continue (y/n)?
echo.
if "%cont%"=="y" goto test1
if "%cont%"=="Y" goto test1
echo "y" or "Y" was not entered
echo Processing Aborted
goto end
:test1
Test for presence of the required changed.txt file
if exist changed.txt goto test2
echo ERROR
echo -----
echo The required changed.txt file does not exist.
echo This could mean that the batch file has been placed into the incorrect directory
echo or Tectonicus was possibly run without using cache enabled.
echo.
goto end
:test2
if exist "%changes_dir%" goto outputexists
goto process
:outputexists
echo WARNING - Target output directory \%changes_name%\ already exists
echo If you continue all existing contents will be lost
set /p cont2= Do you wish to continue (y/n)?
if "%cont2%"=="y" goto removeoutput
if "%cont2%"=="Y" goto removeoutput
echo.
echo "y" or "Y" was not entered
echo Processing Aborted
goto end
:removeoutput
Remove existing output directory
echo.
echo Removing existing output directory
rd /S /Q "%changes_dir%"
:process
Strip base tectonicus output directory from filenames in changed.txt and output to tcte_changed.txt
required to enable formatting of the copy statements further down
echo Creating tcte_changed.txt for use by batch file
if exist tcte_changed.txt del tcte_changed.txt
rem echo > tcte_changed.txt
for /f "tokens=* delims= " %%a in (changed.txt) do (
set str=%%a
set str=!str:%strip%=!
echo !str! >> tcte_changed.txt
)
Replicating required directory structure in upload directory (excludes the cache subdirectory)
echo Replicating required upload directory structure
if exist tcte_exclusion.txt del tcte_exclusion.txt
echo %cachedir% > tcte_exclusion.txt
xcopy /T /EXCLUDE:tcte_exclusion.txt "%tec_output_dir%\*" "%changes_dir%"
Copy tiles specified in tcte_changed.txt into the relative upload directories
echo Copying changed tiles to relative upload directories
for /f %%a in ('type tcte_changed.txt') do (copy %%a "%changes_dir%\%%a" > NUL)
Copy Images directory contents into upload\Images directory
Many of these files will not have changed however Tectonicus does not output a record of what has changed.
Considering these are tiny files with little impact upon the upload bandwidth no attempt has been made to
identify changes via other methods.
echo Copying Images directory and Views Directories
copy "%tec_output_dir%\Images\*.*" "%changes_dir%\Images" > NUL
Copy html, js, txt, css and xml files and compass image to the upload directories
This will include the *.txt files generated by the batch file however these should have little impact on the upload bandwidth.
If future versions of Tectonicus add additional filetypes that need uploading
then additional copy lines can be added below using the same format
echo Copying html, js, txt, css, xml and Compass image files to the upload directory
xcopy /E /Y /EXCLUDE:tcte_exclusion.txt "%tec_output_dir%\*.html" "%changes_dir%" > NUL
xcopy /E /Y /EXCLUDE:tcte_exclusion.txt "%tec_output_dir%\*.js" "%changes_dir%" > NUL
xcopy /E /Y /EXCLUDE:tcte_exclusion.txt "%tec_output_dir%\*.txt" "%changes_dir%" > NUL
xcopy /E /Y /EXCLUDE:tcte_exclusion.txt "%tec_output_dir%\*.css" "%changes_dir%" > NUL
xcopy /E /Y /EXCLUDE:tcte_exclusion.txt "%tec_output_dir%\*.xml" "%changes_dir%" > NUL
xcopy /E /Y /EXCLUDE:tcte_exclusion.txt "%tec_output_dir%\Compass.*" "%changes_dir%" > NUL
Processing Completed
echo.
echo Processing Completed
echo.
echo You can now upload the \%changes_name%\ and subdirectories to your server
echo or alternatively compress it into a zip file, upload to your server
echo and uncompress there.
echo.
:end
pause
Version 1.2
Tectonicus Changed Tile Extractor (TCTE)
by Thermal Ions
Version 1.2 - 19 May 2011
For use with Tectonicus map render program when using cache and remote server
Will create a copy of only the changed tiles as defined in the changed.txt file
along with other required files for subsequent packaging/upload to a remote server
thus minimising bandwidth required for incremental map changes
Only tested on Windows 7 64 bit system but should work on XP/Vista/7 32/64 bit systems
Does not work on earlier versions of windows - update already will you.
Does not work on Linux / Mac - I don't have either so will not be porting to them.
It's just a batch file, however it is my original work apart from a small section noted below
You may not post it elsewhere without my explicit permission unless you've made significant functional
changes. If you do make significant functional changes and post your derivative work elsewhere please
have the courtesy to leave attributions within the code.
Also, please do not link to the forum thread or download via advertising redirects.
Strip base directory section adapted from code posted at http://answers.yahoo.com/question/index?qid=20090325111419AAGv5Kz
The author of Tectonicus (OrangyTang) has no relationship to or responsibility for the creation
of this batch file and should not be contacted for any problems experienced.
Usage:
This batch file must be placed into the directory where tectonicus has placed the *.html and changed.txt files
This may be something like D:\tectonicusmap\tcte.bat
(it must not be a root directory on the drive e.g. C:\tcte.bat or D:\tcte.bat)
The batch file itself can be safely renamed to something else so long as it retains the .bat extension
Double click / execute the batch file to run and create copies of the files for upload
The batch file creates the output for upload in the parent directory
e.g. D:\tectonicusmap\TCTE_upload\
You use this batch file at your own risk, no warranty given, no recourse for any loss .... blah blah blah
It should be safe to use in most cases, but bear in mind it does contain code to remove directory trees
so particularly if you start editing the code it could wipe critical aspects of your system.
Current version and discussion can be found on the forum thread: http://www.minecraftforum.net/topic/300582-tooltectonicus-changed-tile-extractor-tcte-v11/
v1.0 2 May 2011 Original release
v1.1 19 May 2011 Updated to work with paths that contain spaces
v1.2 19 May 2011 Updated to add variable to hold the cache directory %cachedir%
@echo off
Setting variables - Users can set their cache directory name (don't include the path)
if they've changed it from the Tectonicus default of 'cache', as well as setting
the TCTE output directory (changes_name). Don't change the variables after those two.
setlocal EnableDelayedExpansion
set cachedir=cache
set changes_name=tcte_upload
set tec_output_dir=%CD%
set changes_dir=%tec_output_dir%\..\%changes_name%\
set strip=%tec_output_dir%\
echo Tectonicus Changed Tile Extractor (TCTE)
echo by Thermal Ions
echo Version 1.2 - 19 May 2011
echo.
echo http://www.minecraftforum.net/topic/300582-tooltectonicus-changed-tile-extractor-tcte-v11/
echo.
echo You use this batch file at your own risk, no warranty given,
echo no recourse for any loss.
echo.
set /p cont= Are you sure you wish to continue (y/n)?
echo.
if "%cont%"=="y" goto test1
if "%cont%"=="Y" goto test1
echo "y" or "Y" was not entered
echo Processing Aborted
goto end
:test1
Test for presence of the required changed.txt file
if exist changed.txt goto test2
echo ERROR
echo -----
echo The required changed.txt file does not exist.
echo This could mean that the batch file has been placed into the incorrect directory
echo or Tectonicus was possibly run without using cache enabled.
echo.
goto end
:test2
if exist "%changes_dir%" goto outputexists
goto process
:outputexists
echo WARNING - Target output directory \%changes_name%\ already exists
echo If you continue all existing contents will be lost
set /p cont2= Do you wish to continue (y/n)?
if "%cont2%"=="y" goto removeoutput
if "%cont2%"=="Y" goto removeoutput
echo.
echo "y" or "Y" was not entered
echo Processing Aborted
goto end
:removeoutput
Remove existing output directory
echo.
echo Removing existing output directory
rd /S /Q "%changes_dir%"
:process
Strip base tectonicus output directory from filenames in changed.txt and output to tcte_changed.txt
required to enable formatting of the copy statements further down
echo Creating tcte_changed.txt for use by batch file
if exist tcte_changed.txt del tcte_changed.txt
rem echo > tcte_changed.txt
for /f "tokens=* delims= " %%a in (changed.txt) do (
set str=%%a
set str=!str:%strip%=!
echo !str! >> tcte_changed.txt
)
Replicating required directory structure in upload directory (excludes the cache subdirectory)
echo Replicating required upload directory structure
if exist tcte_exclusion.txt del tcte_exclusion.txt
echo %cachedir% > tcte_exclusion.txt
xcopy /T /EXCLUDE:tcte_exclusion.txt "%tec_output_dir%\*" "%changes_dir%"
Copy tiles specified in tcte_changed.txt into the relative upload directories
echo Copying changed tiles to relative upload directories
for /f %%a in ('type tcte_changed.txt') do (copy %%a "%changes_dir%\%%a" > NUL)
Copy Images directory contents into upload\Images directory
Many of these files will not have changed however Tectonicus does not output a record of what has changed.
Considering these are tiny files with little impact upon the upload bandwidth no attempt has been made to
identify changes via other methods.
echo Copying Images directory
copy "%tec_output_dir%\Images\*.*" "%changes_dir%\Images" > NUL
Copy html, js and txt files to the upload directory
This will include the *.txt files generated by the batch file however these should have little impact on the upload bandwidth.
If future versions of Tectonicus add additional filetypes in the same directory that need uploading
then additional copy lines can be added below using the same format
echo Copying html, js and txt files to the upload directory
copy "%tec_output_dir%\*.html" "%changes_dir%" > NUL
copy "%tec_output_dir%\*.js" "%changes_dir%" > NUL
copy "%tec_output_dir%\*.txt" "%changes_dir%" > NUL
Processing Completed
echo.
echo Processing Completed
echo.
echo You can now upload the \%changes_name%\ and subdirectories to your server
echo or alternatively compress it into a zip file, upload to your server
echo and uncompress there.
echo.
:end
pause
I tested it out but i can't seem to find the \tcte_upload\ folder.
Creating tcte_changed.txt for use by batch file
Replicating required upload directory structure
Invalid number of parameters
Copying changed tiles to relative upload directories
Copying Images directory
Copying html, js and txt files to the upload directory
Processing Completed
You can now upload the \tcte_upload\ and subdirectories to your server
or alternatively compress it into a zip file, upload to your server
and uncompress there.
Press any key to continue . . .
Is the Invalid number of parameters the cause of the problem?
I suspect it's having problems with the xcopy command for some reason. Could you please:
[*:ysxjanu6]advise what version of windows you are using (XP/Vista/7) and if it's 32 or 64 bit (if you hold down the windows key and press pause/break it should indicate on the window that opens)
[*:ysxjanu6]try running this test version which includes some added console output and will also create a file tcte_bugtrack.txt file
[*:ysxjanu6]post the output from the test version along with a copy of the contents of the tcte_bugtrack.txt (it contains a list of the directories it can see which it's trying to replicate)
It should still error as I've not changed the xcopy command, but hopefully it'll provide a bit more info to go on to diagnose.
Rollback Post to RevisionRollBack
Cheers.....Thermal Ions Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Hehe, was just working on a Python version of this, but I guess bash is a better alternative for multiplatform support. It was fun writing it, anyway :smile.gif:
Rollback Post to RevisionRollBack
mcmapDZ: Simple, lightning-fast interactive web maps.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
Tectonicus Changed Tile Extractor (TCTE)
by Thermal Ions
Version 1.0 - 2 May 2011
You use this batch file at your own risk, no warranty given,
no recourse for any loss.
Are you sure you wish to continue (y/n)?y
Creating tcte_changed.txt for use by batch file
Replicating required upload directory structure
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer>if exist tcte_
exclusion.txt del tcte_exclusion.txt
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer>echo off
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer>if exist tcte_
exclusion.txt type tcte_exclusion.txt
cache
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer>xcopy /f /t /e
xclude:tcte_exclusion.txt C:\Documents and Settings\Jimi\Desktop\Tectonicus\Mine
craftServer\* C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer\
..\tcte_upload\
Invalid number of parameters
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer>echo off
Copying changed tiles to relative upload directories
Copying Images directory
Copying html, js and txt files to the upload directory
Processing Completed
You can now upload the \tcte_upload\ and subdirectories to your server
or alternatively compress it into a zip file, upload to your server
and uncompress there.
Press any key to continue . . .
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer\..
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer\..\tcte_upload\
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer\..
C:\Documents and Settings\Jimi\Desktop\Tectonicus\MinecraftServer\..\tcte_upload\
Ah, problem identified. It's not dealing properly with spaces in the path name. I'll test a fix here - probably as simple as include quotes, but I'll double check now that I know how to replicate the issue.
Rollback Post to RevisionRollBack
Cheers.....Thermal Ions Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Tested on Tectonicus 1.37 and it works, HOWEVER as there are now multiple directories below \ZoomX\ the first time you run Tectonicus after upgrading it will render ALL tiles as changed. As a result TCTE will correctly see them all as changed, and as such won't provide any savings the first time. Subsequent runs of Tectonicus 1.37 will once again return you to true processing of only changed tiles and TCTE will thus be able to save you some upload bandwidth.
Rollback Post to RevisionRollBack
Cheers.....Thermal Ions Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Released version 2.0 to support the new Tectonicus 2.x versions which offer multiple world and layers.
Changes:
v2.0 20 June 2011 Updated to work for version 2.00 of Tectonicus
Add css and xml files and Compass image to be copied over in addition to the existing
html, js, txt (I'm in the habit of copying the Tectonicus xml config file over for reference)
See the first post for download links and/or the code.
Rollback Post to RevisionRollBack
Cheers.....Thermal Ions Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Updated to version 2.2 to support Tectonicus 2.01 which now also reports changed view images in the changes.txt file for easier processing by TCTE or other post processing third party tools.
Rollback Post to RevisionRollBack
Cheers.....Thermal Ions Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Updated to version 2.2 to support Tectonicus 2.01 which now also reports changed view images in the changes.txt file for easier processing by TCTE or other post processing third party tools.
Just so I understand this correctly... (Sorry, it's 5:30AM here)
I run Tectonicus first,
then run this batch file. The batch fill will dump only the new files into a separate folder, which is all I need to upload in order to update my online map?
I'm happy to report that the bash version of this script (available here) can be made compatible with both major Tectonicus versions, by simply adding a letter to the original script.
Here are the changes:
--- tcte.sh.orig 2011-07-18 17:38:48.141778775 +0100
+++ tcte.sh 2011-07-18 17:36:37.610562670 +0100
@@ -104,7 +104,7 @@
# Replicating required directory structure in upload directory (excludes the cache and the upload directories)
echo "Replicating required upload directory structure"
cd "$CHANGES_DIR"
-(cd "$TEC_OUTPUT_DIR"; find -type d ! -name . -a ! -path "./cache*" -a ! -path "./$CHANGES_NAME*" -print0) | xargs -0 mkdir
+(cd "$TEC_OUTPUT_DIR"; find -type d ! -name . -a ! -ipath "./cache*" -a ! -path "./$CHANGES_NAME*" -print0) | xargs -0 mkdir
cd "$TEC_OUTPUT_DIR"
# Copy tiles specified in tcte_changed.txt into the relative upload directories
You got it. That's exactly what this script does.
Outstanding. Gonna give this a go. My map is just over 1 gig at this point, and everytime I upload to my website it takes forever.... My ISP is gonna send someone to break my legs...
Tectonicus Changed Tile Extractor (TCTE) is a batch file written to be used with the Tectonicus map render program to minimise wasted bandwidth when uploading your completed renders.
Background:
Tectonicus has the capacity to use a cache when rendering so as to avoid having to re-render unchanged tiles on subsequent runs of the program which use the same parameters. It outputs a list of the changed tiles to a text file changed.txt which can be used by subsequent tools / programs to upload only the changed tiles to a separate web hosting server/directory. Alternatively users can use the likes of rsync to upload only changed files without referencing changed.txt.
For those not experienced in using the likes of rsync etc and/or may be dealing with a remote host with limited capacity / security access to setup a syncing solution, TCTE can assist.
TCTE will create a local copy of all the changed tiles and other necessary files to end up with a discrete directory structure and contents which can then be uploaded/moved to your host without needlessly transferring megabytes of unchanged tiles - saving you time and bandwidth.
The code should be sufficiently commented to allow those with minimal batch file experience to understand what it's doing.
Requirements:
Tectonicus map render program by OrangyTang versions 2.x (or for later 1.x versions use TCTE vers 1.2)
Windows XP/Vista/7/Server 2008 (32 or 64 bit) - only tested by the author on Win7 64 bit however
No earlier Windows versions are likely to work / are supported.
A bash based version for Tectonicus 1.x renders (see further down the thread) has been made by micomico which may assist Linux or Mac users. I'm personally not able to assist with any problems with it, although others in the thread may be able to do so.
Usage:
Run Tectonicus as normal (the batch file doesn't link to or run Tectonicus itself)
This batch file must be placed into the directory where Tectonicus has placed the *.html and changed.txt files.
This may be something like D:\tectonicusmap\tcte2.bat
(it must not be a root directory on the drive e.g. C:\tcte2.bat or D:\tcte2.bat)
The batch file itself can be safely renamed to something else so long as it retains the .bat extension
Double click / execute the batch file to run it
The batch file creates the copies of the files for later uploading in a TCTE_upload directory in the parent directory
e.g. D:\tectonicusmap\TCTE_upload\
Known Bugs/Limitations:
[Fixed] Currently doesn't work when the directory path contains spaces.
[FYI] Folder output changed with Tectonicus 1.37 (and now 2.00), meaning on the first run of v1.37 (or 2.00) all tiles will be "changed". TCTE can't do anything about this. (link)
[Limitation] Assumes your cache directory is called "cache" and resides in the same directory where your MapX directories appear. If you have customised this in Tectonicus then you need to set the 'cachedir' variable at row 49/53 in the batch file.
Bug Reports/Comments:
Feel free to post any bugs / comments in this thread. I make no promises on future updates however. The batch file was written for my own use and works for that purpose. I've noted others had similar needs so have posted it here in case they find it of use.
Changelog:
Derivative Works:
It's just a batch file, however it is my original work apart from a small section derived from a forum post as noted in the code comments. You may not post it elsewhere without my explicit permission unless you've made significant functional changes. If you do make significant functional changes and post your derivative work elsewhere please have the courtesy to leave attributions within the code.
Also, please do not link to this thread via advertising redirects - it's just rude.
Disclaimer:
You use this batch file at your own risk, there is no warranty given and no recourse for any loss caused by it's use. It contains sections of code that delete files and directories, and as such you should not attempt to edit the code unless you know what you are doing or you could inadvertently delete critical portions of your system/data.
The author of Tectonicus (OrangyTang) has no relationship to or responsibility for the creation of this batch file and should not be contacted for any problems experienced.
Thanks to:
OrangyTang for creating and updating such a wonderful rendering program - Tectonicus
All the users on the Tectonicus forum thread who have helped myself or others in using the program.
Download Link (use right click - save as):
version 2.2 - for Tectonicus v2.01 or later
version 1.2 - for Tectonicus v1.x
Current versions of the code:
Version 2.2
Version 1.2
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Is the Invalid number of parameters the cause of the problem?
[*:ysxjanu6]advise what version of windows you are using (XP/Vista/7) and if it's 32 or 64 bit (if you hold down the windows key and press pause/break it should indicate on the window that opens)
[*:ysxjanu6]try running this test version which includes some added console output and will also create a file tcte_bugtrack.txt file
[*:ysxjanu6]post the output from the test version along with a copy of the contents of the tcte_bugtrack.txt (it contains a list of the directories it can see which it's trying to replicate)
It should still error as I've not changed the xcopy command, but hopefully it'll provide a bit more info to go on to diagnose.
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Ah, problem identified. It's not dealing properly with spaces in the path name. I'll test a fix here - probably as simple as include quotes, but I'll double check now that I know how to replicate the issue.
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Sorry for the delay. Had some RL issues crop up.
Windows version should now be working where your path contains spaces. Just redownload from the link (or copy the updated code).
EDIT: Saw mention of changed folder output with version 1.37 of Tectonicus, so just be aware I haven't tested it on that version yet.
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Changes:
See the first post for download links and/or the code.
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Tectonicus Changed Tile Extractor - minimise the files you upload to your map server (now supports Tectonicus v2.x)
Just so I understand this correctly... (Sorry, it's 5:30AM here)
I run Tectonicus first,
then run this batch file. The batch fill will dump only the new files into a separate folder, which is all I need to upload in order to update my online map?
Outstanding. Gonna give this a go. My map is just over 1 gig at this point, and everytime I upload to my website it takes forever.... My ISP is gonna send someone to break my legs...