[Tool] mtmapprune [mtmapprune] Prune your map.sqlite fast!

sofar
Developer
 
Posts: 1642
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

[Tool] mtmapprune [mtmapprune] Prune your map.sqlite fast!

by sofar » Mon Oct 02, 2017 20:17

Project website: https://github.com/minetest-tools/mtmapprune
License: LGPL-2.1+ MIT
Binaries: Linux X86_64: https://github.com/minetest-tools/mtmapprune/releases
Latest version: https://github.com/minetest-tools/mtmap ... x86_64.zip
Windows builds are available for some releases. Check the github releases to see which ones are.

Prunes your map.sqlite and deletes blocks outside a specified range.

Usage:

Code: Select all
mtmapprune map.sqlite max_x [max_y [max_z [min_x min_y min_z]]]

If omitted, `max_y` and `max_z` default to the value of the `max_x` limit. The `min_*` limits will default to the negative values of the `max_*` limits. The limits are node positions, not "block positions".

Example: to prune all nodes with x and z > 1000, and x and z < -1000 and y > 200, and y < 200, use:

mtmapprune map.sqlite 1000 200


mtmapprune works really fast by marking all the blocks outside the reserve region as deleted, and then vacuuming the sqlite db. This makes sqlite do all the work and removes all the empty unused space from your sqlite db file.
 

sofar
Developer
 
Posts: 1642
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Tool] mtmapprune [mtmapprune] Prune your map.sqlite fas

by sofar » Mon Jan 01, 2018 06:13

v2 adds full support of pruning to any arbitrary (xyz)-(xyz) box coordinate set, while maintaining backwards compatibility with the way that v1 uses the parameters. So if you now have a box that's in all negative coordinates, or doesn't include the origin (0,0,0), it still works.
 

User avatar
Fixer
Member
 
Posts: 844
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer
 

twoelk
Member
 
Posts: 1232
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

Re: [Tool] mtmapprune [mtmapprune] Prune your map.sqlite fas

by twoelk » Thu Feb 08, 2018 22:36

ooh,
please expand this to a mt-map-database manupilating tool.
stuff like deleting certain nodes, moving map parts around or even merging maps would be cool
 

sofar
Developer
 
Posts: 1642
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar
 

sofar
Developer
 
Posts: 1642
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Tool] mtmapprune [mtmapprune] Prune your map.sqlite fas

by sofar » Fri Feb 09, 2018 00:34

twoelk wrote:ooh,
please expand this to a mt-map-database manupilating tool.
stuff like deleting certain nodes, moving map parts around or even merging maps would be cool


Deleting specific nodes? Probably not, since this code avoids entirely looking at the content. However, moving blocks around would actually be possible. Not sure if I want to go there, though, but it's certainly possible to do just that.
 

User avatar
Fixer
Member
 
Posts: 844
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer

Re: [Tool] mtmapprune [mtmapprune] Prune your map.sqlite fas

by Fixer » Fri Feb 09, 2018 13:57

>mtmapprune-v3-x86_64.zip

This one is for linux, ELF file.
 

sofar
Developer
 
Posts: 1642
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Tool] mtmapprune [mtmapprune] Prune your map.sqlite fas

by sofar » Fri Feb 09, 2018 18:05

Fixerol wrote:>mtmapprune-v3-x86_64.zip

This one is for linux, ELF file.


whoops, fixed link for ya.
 

User avatar
Fixer
Member
 
Posts: 844
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer

Re: [Tool] mtmapprune [mtmapprune] Prune your map.sqlite fas

by Fixer » Sat Feb 10, 2018 22:37

Gives me error at launch when trying to prune:
Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Win7sp1
 

sofar
Developer
 
Posts: 1642
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Tool] mtmapprune [mtmapprune] Prune your map.sqlite fas

by sofar » Sun Feb 11, 2018 00:56

Fixerol wrote:Gives me error at launch when trying to prune:
Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Win7sp1


Looks like the latest version fixes that issue as well.
 


Return to Minetest-related projects



Who is online

Users browsing this forum: No registered users and 2 guests