Auteur Sujet: Elevation on maps  (Lu 34006 fois)

Hors ligne brucepos

  • Caporal
  • Messages: 16
Re : Elevation on maps
« Réponse #45 le: 21 mars 2010, 22:22:19 pm »
Hi,

Sorry you're having such a bother - I know how frustrating these things can be!

I've tidied up the guide a bit and I've also produced a script file that will automate some of the SciLab stuff. I've just uploaded onto the mods server, so it may take a little time to appear.

The version 2 guide you're looking for is the PDF file - I manage to upload the old Word Document as the version 2 file by mistake!

Brucepos

Hors ligne Broadsword

  • Capitaine
  • **
  • Messages: 110
Re : Elevation on maps
« Réponse #46 le: 22 mars 2010, 01:25:11 am »
Hi Brucepos,
Thanks again for the updated manual and the macro.
I wasn't sure how to use the macro -- do I just substitute my filename and path for "filename" in the Line 2, and then hit the "execute" command?
I tried that, but it hung up at one point with an error message:

for i=1:76;for j=1:101;remap(i,j)=linear_interpn(i,j,x1,x2,mapdata);end;end;
                                                                    !--error 999
linear_interpn: Wrong size for input argument #3.
at line       7 of exec file called by :   
exec('C:\Documents and Settings\Gina\Desktop\Histwar downloads\LG files\Altmacro.sce', -1)

Then I tried executing each command manually one by one, and all seemed OK until this:
->for i=1:76;for j=1:101;remap(i,j)=linear_interpn(i,j,x1,x2,mapdata);end;end;
                                                                    !--error 999
linear_interpn: Wrong size for input argument #3.

Suggestions? Also, your manual states: "Hook told us that the histwar maps use elevation data files 101 cells wide by 76 cells high." Would this be true for every size of HW map? I'm making a campaign map.
 

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Re : Elevation on maps
« Réponse #47 le: 22 mars 2010, 01:52:46 am »
Suggestions? Also, your manual states: "Hook told us that the histwar maps use elevation data files 101 cells wide by 76 cells high." Would this be true for every size of HW map? I'm making a campaign map.

The 6 km map is 61 by 46 cells.  All the rest, including the campaign map, are 101 by 76.

Hook

Hors ligne brucepos

  • Caporal
  • Messages: 16
Re : Elevation on maps
« Réponse #48 le: 22 mars 2010, 07:22:13 am »
Hi Broadsword,

It sounds as if something is going wrong at the data stage of things - if you put the file names left and right, top and bottom positions in correctly, then the macro should work. Could you tell me exactly what you put into the SciLab variables?

Hors ligne brucepos

  • Caporal
  • Messages: 16
Re : Elevation on maps
« Réponse #49 le: 22 mars 2010, 13:29:13 pm »
Hi folks,

Time for some humble pie :cry: - I've found an error in the instructions and macro that meant the last five lines of data weren't transferred to the histwar file. A new set of instructions (Version 3) and a new macro (version 3) have been uploaded to the mods depot.

If you are going to use the macro, remember to set the two filenames, and the left, right, top and bottom values BEFORE you execute the macro.

Good luck (and sorry for using you all as Alpha testers!)

Hors ligne Tirailleur

  • Lieutenant
  • **
  • Messages: 57
Re : Elevation on maps
« Réponse #50 le: 22 mars 2010, 19:54:36 pm »
Hi brucepos,

there is no problem to use us as alpha testers. This is really great work from you and it makes it so easy to have real height files for the napoleonic battlefields. It's the "dot on the i" for Les Grognards.

Thanks a lot

Hors ligne spec10

  • Officier d'HistWar
  • Lieutenant
  • **
  • Messages: 80
    • HistWar: Les Grognards unofficial File Depot
Re : Elevation on maps
« Réponse #51 le: 22 mars 2010, 20:11:12 pm »
Only thing we gotta be careful about, or at least have them in mind: Some elevations might have changed over the years, so it's always good to check the sattelite data against historic maps when possible. (Famous example that comes to mind is the Waterloo battlefield where they moved an awful lot of soil to create that artificial hill that's standing there now, but of course that one's quite obvious. There might be more subtle changes on other Battlefields, I'm no expert on that, just some thought I just had)

But I'm sure many if not most battlefields haven't changed that much. At least that's what I hope, because this way of getting elevation data is simply awesome :)
« Modifié: 23 mars 2010, 01:13:22 am par spec10 »

Hors ligne brucepos

  • Caporal
  • Messages: 16
Re : Elevation on maps
« Réponse #52 le: 22 mars 2010, 20:57:16 pm »
That's a good point - after playing with the OOB editor I think it's like the published OOBs - hardly anything seems to agree and judgement is required. I had a bit of fun with the data visualising a bit of terrain I know - Arthur's Seat in Edinburgh!

Hors ligne brucepos

  • Caporal
  • Messages: 16
Re : Elevation on maps
« Réponse #53 le: 22 mars 2010, 20:58:51 pm »
....and here's the google Earth version

Hors ligne Broadsword

  • Capitaine
  • **
  • Messages: 110
Re : Re : Elevation on maps
« Réponse #54 le: 22 mars 2010, 21:43:14 pm »
Thanks again for the V3 updates, Brucepos!
Tried again, but still no joy. I'm going to show you my inputs, so you can see where I might have gone wrong:
1. After deriving all the top, right, etc., numbers, I input them as follows:
-->size(alt1)
 ans  =
 
    6001.    6001. 
 
-->left=2108
 left  =
 
    2108. 
 
-->right=2714
 right  =
 
    2714. 
 
-->top=7608
 top  =
 
    7608. 
 
-->bottom=7560
 bottom  =
 
    7560. 

Then  I ran the macro, having changed my terms according to the name and path of my file (my master file is called "alt1"):
stacksize('max');
alt1=fscanfMat("C:\temp\alt1.txt");
mapdata=alt1(top:bottom,left:right);
[nr nc]=size(mapdata);
x1=1:75/(nr-1):76;
x2=1:100/(nc-1):101;
for i=1:76;for j=1:101;remap(i,j)=linear_interpn(i,j,x1,x2,mapdata);end;end;
remap=remap-min(remap);
iremap=iconvert(remap,2);
mopen(fileoutput,'wb');
for i=1:76; mput(iremap(i,:),'sl');end;
mclose();

The Console gave this error result:

-->exec('C:\Documents and Settings\Gina\Desktop\Histwar downloads\LG files\Altmacro3.sce', -1)
for i=1:76;for j=1:101;remap(i,j)=linear_interpn(i,j,x1,x2,mapdata);end;end;
                                                                    !--error 999
linear_interpn: Wrong size for input argument #3.
at line       7 of exec file called by :   
exec('C:\Documents and Settings\Gina\Desktop\Histwar downloads\LG files\Altmacro3.sce', -1)
 
Any ideas?

Hors ligne brucepos

  • Caporal
  • Messages: 16
Re : Elevation on maps
« Réponse #55 le: 22 mars 2010, 22:43:40 pm »
Hi Broadsword,

Try switching the numbers for top and bottom - the index is from the top of the map, so you'd expect the bottom number to be bigger.

Hors ligne Broadsword

  • Capitaine
  • **
  • Messages: 110
Re : Re : Elevation on maps
« Réponse #56 le: 23 mars 2010, 00:33:44 am »
Hi Broadsword,

Try switching the numbers for top and bottom - the index is from the top of the map, so you'd expect the bottom number to be bigger.

Tried switching top and bottom, but now I got this error:

-->exec('C:\Documents and Settings\Gina\Desktop\Histwar downloads\LG files\Altmacro3.sce', -1)
mapdata=alt1(top:bottom,left:right);
                                    !--error 21
Invalid index.

at line       3 of exec file called by :   
exec('C:\Documents and Settings\Gina\Desktop\Histwar downloads\LG files\Altmacro3.sce', -1)
 

Hors ligne brucepos

  • Caporal
  • Messages: 16
Re : Elevation on maps
« Réponse #57 le: 23 mars 2010, 07:17:32 am »
Hi Broadsword,

If you send me your datafiles and your scilab environment file (use the save option in the menus at the top), I'll have a look at them for you. My Email address is on the instructions.

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Elevation on maps
« Réponse #58 le: 23 mars 2010, 10:57:37 am »
Just a guess here, but does bottom-top need to be 76 or greater?

The ratio between left to right and top to bottom isn't anywhere near what you'd expect... I suspect there's a math error calculating top and bottom.

Hook

Hors ligne Tirailleur

  • Lieutenant
  • **
  • Messages: 57
Re : Elevation on maps
« Réponse #59 le: 23 mars 2010, 11:01:50 am »
Hi Broadsword,

at my first try, i had the same error as you.

The problem seems to be if you only use the big data file (you can see this on your size(alt1) 6001). You have to look at your adjustments for Google Earth (the checkmarks), so you can see the sub data files, too.

One sub data file has a matrix of 1200 x 1200, so if you use only one data file you should see size(alt1) 1200 1200, or by two 2400 1200.

The big file is for example: srtm_39_03
The sub file: srtm_39_03_3_1
(as you see in the fantastic guide from brucepos)

All went well after i used the sub data files.