damaltor
Members-
Posts
22 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by damaltor
-
Well, there was a big archive of data floating around the interwebz shrtly after kerbalmaps.com was down. i have that. also, i made a small script which scraped kerbalmaps.com and tried to download all json and jpg files, which gaines another few 100MB of data. thats all i have. as far a s i know, i have all image files, for all planets, for sat picture, slope, height and biome. i have only the json files for one or two zoom layers though, which is why the info box in the lower left works only for kerbin in very few zoom levels. the information in this box is provided by the json files. as long as i dont have them, i cannot add them to the temporary maps, obviously. i did not find a second source for them (but to be honest i did not do a deep search for a source, either). if the json files in your data are more complete, i would be happy to put them together.
-
I decoded it a bit more. if you see this text and this image side by side, (this is biome data btw), you can see that the map is visible pretty good in the text. obviously, the "&" character is water, and the " " (space) character is ice caps, and the "(" character is deserts. (The text is only the TOP HALF of the image file, not the entire image!) The biome json file starts with the following: { "keys": [ "8", "3", "7", "2", "1", "0", "4", "5" ], "data": { "0": "Water", "1": "Grasslands", "2": "Highlands", "3": "Shores", "4": "Mountains", "5": "Deserts", "7": "Tundra", "8": "Ice Caps" }, "grid": [ (...grid follows) so my guess is the following: as the first 32 ascii chars are control sequences, they are not used inside the json files. the space character, 0x20, is the first valid char. so for the ice caps part of the map there is a space character, which is the FIRST valid character. in the "keys" section, the first number is "8", which translates with the "data" section to Ice Caps. The second valid character is !, which equals 0x21. the second number in the keys section is "3", which translates to shores, and as you can see in the text map there are lots of ! between land and water. This does not work out for water '&' or desert '(' and all of the other characters though - this might be for the reason that the caracter " (0x22) is skipped because it is needed inside the json files to begin and end the strings. that means: & (0x26) is the 6th valid character (not the 7th, because " is skipped), the 6th key is 0, and 0 is water. for the deserts: ( (0x28) is the character for deserts, ( is the 8th valid character, the 8th key is 5, and 5 equals deserts. Also, the slopes data does not have a data field because it needs no text translation - in the keys there are all needed informations: if you scroll back up the the post about the slope data, you can see that the dark-blue part on the ice caps of the planet are space characters in the text grid. the space character is the first valid character, so the slope at that position is equal to the first key - it is 0° (which is correct if i believe the map overlay). the same is true for the elevation data: the elevation file has tons of keys because there are so many different heights. around the ice caps, there also are space characters in the json files. 0 is the first valid character, and the first key is 30, so the height at the poles is 30m, which is exactly the height shown on the map overlay. the elevation data has no textual representation, so the "data" field is empty as it is in the slopes data. the elevation data has another quirk though - it has far more than 96 keys which would exhaust the ascii charset - in fact it has about 2000 different keys (which comply to about 2000 different elevations). the grid looks weird, because i guess that the file is then encoded in utf-8. so much for the file format - what next? ---edit: i am now pretty sure about the UTF8 - first, because it is named "UTFgrid" (duh!) and second because there are UTF-specific decoding functions in the parser.
-
Ok, so here are some news. The height and slope data is made in a similar way to the biome data. my guess with 256x256 characters was wrong, there are actually only 64x64 characters. one character stand for 2x2 pixels. i compared the slopes image of one from the kerbin tiles with the slopes json file of the same tile: As you can see, the shape of the big dark blue part is similar, and the rest will be too. so i guess we could be able to generate slope/elevation data from the respective images once we decode the characters. What i dont know yet: The json file starts with {"keys":["0","12","9","2","4","1","3","5","8","11","10","14","7","19","6","15","13","39","22","16","45","17","21","29","18","28","27","31","34","20","43","25","26"], "data":{}, "grid":[ " ", " ", " ", "!#$$%$&$&&'&&&&&$&$$$' ", "$&&&%&&$'& $&&$()&$&&&$$( ", (...) ]} i have no idea what the "keys" field means, and what the "data" field means (and if it is important as it is empty anyway). the "grid" field is obviously the real data. Also, i did find out that moving the mouse generates an ElevationOver, BiomeOver etc. event, which automagically generates an event data field, which already carries the full-text decoded data ("4°" for slopes or "3000m" for height or "Greater Flats" for biome). I was unable to find the actual json parser though for now, i still am searching.
-
You can right - the json files for height, slope, and biome are missing for all bodies but kerbin. Even for kerbin, they are only available for the outermost zoom and the nex zoom level, and even then one is missing. Downloading wou not be a big problem, my script should work for json files as good as it did for the biome tiles, but I gues that they are gone. We might be able to generate the json files from the biome tile though, I want to try that If everything else fails. Might be unaccurate though (but not more unaccurate than the images). Also, no need for a sorry, you guys put a lot of work into that :)
-
Well, if in understand it correctly, the biggest part of the json file is an array of 256x256 characters. Each of the different characters stands for a different biome (e.g. A=highlands, B=lowlands, &=water). The character array is exactly exactly as big as the image file (I think) So if you generate the image data in pixels, you might also be able to generate a text file with characters in them. We have to find out which character stands for which biome though. This is a guess though, but I think it works like that.
-
Just to let you know:
-
Hi everybody, i made something nice for you here, so you can use kerbalmaps again: http://ksp.deringenieur.net/ This is still based on the original data which was linked in this thread, see below. It might be outdated. Just to note: i do not want to steal the project from anybody, but i really, really liked kerbalmaps and was sad that it went offline. This version of kerbalmaps is TEMPORARY and will be removed when the original gets back to life, or when drew/joel/ivansanchez/anyone else has a better idea, or whenever i feel that it is time. i do host that on my private hosting ressources, so if i think i need them for something else, i will remove it. Please feel free to use it as much as you like, but as the server has a somewhat limited upload you might run into trouble when too many people access it simultaneously. The sat, height, and slope layer should work for any celestial body. The biome layer should work for kerbin and the mun, just as it was with the original kerbalmaps.com. The small overlay in the lower left should show coordinates for every celestial body, by klicking the coordinates you can switch between decimal degrees and dms notation. The "current biome", "height" and "slope" stuff in it do only work on the outermost zoom level for kerbin, more on that in the technical details below. Although this version can be scrolled indefinitely to the left and to the right, POI and anomalies will only show up in the "center" of the map. This means that you can rotate the celestial body (= scroll to the left/right) as much as you would like, but to see the markers for POI or anomalies you will have to scroll to the center which can be kind of hard to accomplish - the easiest way is to re-load the site. I will try to fix that, but that will take a while. I also removed the google tracker. If anybody feels offended that i do now host this, drop me a message. That should not be a problem. Technical info for the interested: I used the data from the ZIP archive above to make this work. I set up a new blank website, added Leaflet to show the map, recompiled the Leaflet KSP plugin to work with my setup, added proj4leaflet which also wanted to be recompiled and then dropped the data in. I had to change a lot of small bits inside of the Leaflet KSP plugin to make it work as my setup is somewhat different to the original one. i also made changes so that my different directory structure works better, and this should be also good if ever someone else gets this project as there are no more hard-coded urls in the Leaflet KSP plugin. everything now smoothly works from the base dir with subdirectories, without the need for subdomains and such. also, the whole thing could be zipped up and should work locally without trying to reach external servers, which the current zip version does. The graphic tiles for sat, slope and hight inside the ZIP archive were complete, but the tiles for the biome layer were missing. It worked nevertheless, because these files were still reachable on the original server kerbalmaps.com. With a small shell script i was able to scrape all those missing files from the original server and added them into my structure, so that it will still work if kerbalmaps.com breaks away entirely, which i dont hope. Unfortunately, only the biome tiles for kerbin and the mun are available, as i have a hard time to generate new tiles. For the small overlay in the lower left of the page, there are special json files which contain the information of which biome is where and which height/slope is in which position. They are not the same as the graphical tiles, but specially-made for the purpose of the overlay. Those json files are missing almost entirely, the only ones i have (kerbin on the outermost zoom level) come from the zip archive. if the rest ever surfaces, i will add them in, but for now they were not in the zip, not reachable on the original server, and not in the web archive - so as of now they are lost. Anyone else working on this: i would like to help, so please contact me if you need or want something. i have pretty much understood the structure of the data and am somewhat aware of how the json stuff works, but i am unable to generate new maps, let alone json files. Maybe we could work together? I would provide my hosting ressources (if there is not too much traffic) for development purposes, though maybe some day this will have to move somewhere else.
- 255 replies
-
- 11