Can't make Lanclass from Class Map

This is the Forum to discuss the use of SBuilderX (version 3.10 and above). For previous versions of SBuilder please use the "SBuilder for Flight Simulator FS2004" forum.
Post Reply
lorenzownd145
Posts: 24
Joined: Thu Mar 13, 2014 4:35 pm

Can't make Lanclass from Class Map

Post by lorenzownd145 » Sat Mar 22, 2014 2:25 pm

Sorry if it's always me but I seem to have no luck with this program :(
Firstly I have to say that I have already generated many landclass sceneries from maps, so it is not a question on how to do it.
I generated my landclass scenery using a Land Cover map I found on Internet that I cropped to my region of interest, but I forgot to include an island during the cropping, so I have to redo the scenery with the newly created image. And here starts the problem: if I append my image, go to landclass mode and click "make", SBX returns with the error "There has been a problem! Check the generated indexes!" and then "Class Maps have been processed!", but no landclass tiles are generated. What????? I used the same image, except for being a bit larger (to include the part I forgot)! It's almost the same file! Then I tried to export the image in different ways (8 bit palette/24 bit RGB, LZW/Packbits/No compression), but still no success. So at this point my question is: what format/option/anythingelse the image has to be to work correctly with class maps in SBX? What can cause SBX not to read the image for class maps?

My image is a Geotiff file of about 500kb, Geographic, WGS84

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Re: Can't make Lanclass from Class Map

Post by Luis Sa » Sat Mar 22, 2014 5:36 pm

Hello,

What is the exact number of different colours on your image? A bmp image with a palette of 256 colours should work fine. What is the name or label that you use for that map? All the colours in the image have a class definition? These questions may help to find the problem.

Regards, Luis

lorenzownd145
Posts: 24
Joined: Thu Mar 13, 2014 4:35 pm

Re: Can't make Lanclass from Class Map

Post by lorenzownd145 » Sat Mar 22, 2014 9:25 pm

1) I think there are 7 or 8 colours in my image
2) I use an 8 bit (256 colours) palette
3) I put ''Class'' as both the name and label of the image
4) No, some of the colours don't have a class definition; is it a problem?
Thanks anyway for the tips, I'll try to make a 256 bmp

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Re: Can't make Lanclass from Class Map

Post by Luis Sa » Sat Mar 22, 2014 9:36 pm

Hello,

At this moment of writing I am not able to read the source code that I used to generate the landclass BGL from a map. But I imagine it samples (reads the color of) the bitmap at the points where a landclass is needed. Then it translates the color to a landclass definition using the table that you had previously created. I do not remember what SBuilderX does when it unable to discover what class to use ...

Regards, Luis

lorenzownd145
Posts: 24
Joined: Thu Mar 13, 2014 4:35 pm

Re: Can't make Lanclass from Class Map

Post by lorenzownd145 » Sun Mar 23, 2014 10:14 am

It seems to be even worse with the bmp, so I uninstalled and reinstalled the program, but no success, still the same issue. After many fails I tried to re-use the GeoTiff I created earlier, and I noticed something strange: if I click "Make" it still prompts the error "There has been a problem .....", but now I see that it processes about 1/20 of the map before stopping (1/20 of the map, starting from left, now has landclass tiles)

EDIT: Checked the 2 images with GDALINFO: they're both GeoTiff, LZW Compression, WGS84, RGB. Basically they're the same image ...

rhumbaflappy
Posts: 420
Joined: Sat Oct 16, 2004 10:11 pm

Re: Can't make Lanclass from Class Map

Post by rhumbaflappy » Sun Mar 23, 2014 1:44 pm

Perhaps attaching a zip of the original data would help, as wee're having some trouble seeing the problem.

Dick
Dick

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Re: Can't make Lanclass from Class Map

Post by Luis Sa » Sun Mar 23, 2014 4:32 pm

Dear Lorenzo,

Please note: You can for example create, 3 class indexes in a project (you should have more). Once you create these class indexes even without a map loaded you may export the file just to see if they have been created. I have just done that and my exported file is:

Code: Select all

[Main]
CopyRight=PTSIM SB313
Name=PROJECT
NoOfMaps=0
NoOfLands=0
NoOfLines=0
NoOfPolys=0
NoOfWaters=0
NoOfObjects=0
NoOfExcludes=0
NoOfLWCIs=3
BGLProjectFolder=C:\Program Files (x86)\SBuilderX313\Scenery
LatDispCenter= 0
LonDispCenter=-46.3519313304721
Zoom= 0

[LWCI.1]
Text=Land 101 102 103 City Textures 
Color=FFFF0000

[LWCI.2]
Text=Land 99 102 103 City Textures 
Color=FFADFF2F

[LWCI.3]
Text=Land 102 102 103 City Textures 
Color=FFFF8080
If you look to this you see 3 LWCI (Land Water Class Index). If you examine it in more detail you will see that the colors are different. Each color is 4 bytes ( Alpha Red Green and Blue). If there are 2 indexes with the same color, the second one is ignored. But in this case there are 3 distinct indexes with 3 distinct colors.

Now you add your map of "colored indexes". It should have only these 3 colors. Suppose that you add a pure black color (just one color). If you ask SBuilderX to use this map to generate a landclass, it will do nothing.

But per the description of your error messages, there must be something more. Please try to pack an error example for me to try here. Not the whole project. Please delete everything except for the index map (the one with name started by Class) and save and export the project. Send me those 2 small files together with the image file 8the one that is used as an index map inside SBuilder).

Regards, Luis

lorenzownd145
Posts: 24
Joined: Thu Mar 13, 2014 4:35 pm

Re: Can't make Lanclass from Class Map

Post by lorenzownd145 » Mon Mar 24, 2014 6:43 am

I exported the sbx with the class indexes and they just look perfect. Today I will post a zip file with the sbx and 2 images, the one that works and the one that doesn't. Thank you again for your excellent support!

lorenzownd145
Posts: 24
Joined: Thu Mar 13, 2014 4:35 pm

Re: Can't make Lanclass from Class Map

Post by lorenzownd145 » Mon Mar 24, 2014 9:19 pm

Ok, here is the archive with all the necessary to generate the errors http://ge.tt/8XP5v8T1/v/0 . Sorry, I put a password because I don't want my work to be available to anyone and anything on the internet; if you want to help me, PM me for the password.

To Luis: Since you are the person who requested the file, I have already sent you the password via PM.

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Re: Can't make Lanclass from Class Map

Post by Luis Sa » Tue Mar 25, 2014 2:05 am

Hi,

There is an error in SBuilderX :oops: . I will try to correct but it will take some time. What is happening is the following: SBuilder reads your map boundaries and then it evaluates what are the "quads" covered by your map. Your file has 2854 pixels from North to South. SBuilder generates "quads" from west to east and then from north to south as we read a page. Everything is fine until it gets to the last line. Instead of stooping it tries to create one more line at the south. It crashes when it tries to read the color of pixel X=1 Y=2855. May be your south map boundary is exactly where there is a transition on the quad FSX grid. For the moment please save your file as a bitmap (256 colors is fine). In this way the geographic coordinates can be controlled by yourself either in the map TXT file or using the SBX export/import file. Then try to change the south border just a bit north or south. I suspect that you will be able to generate a BGL file.

Note that I will fix this bug! If you want to join a group of testers for a new version please tell me.

Regards, Luis

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Re: Can't make Lanclass from Class Map

Post by Luis Sa » Tue Mar 25, 2014 5:05 am

Luis Sa wrote:Hello,

At this moment of writing I am not able to read the source code that I used to generate the landclass BGL from a map. But I imagine it samples (reads the color of) the bitmap at the points where a landclass is needed. Then it translates the color to a landclass definition using the table that you had previously created. I do not remember what SBuilderX does when it unable to discover what class to use ...

Regards, Luis
Well, :oops: it just skips that quad. An index with the meaning of transparent is used.

Regards, Luis

lorenzownd145
Posts: 24
Joined: Thu Mar 13, 2014 4:35 pm

Re: Can't make Lanclass from Class Map

Post by lorenzownd145 » Tue Mar 25, 2014 9:22 pm

Thanks! It worked! I re-exported my map with less Y pixels and now SBuilderX doesn't give me any errors. One question: when you say "quads", do you mean the squares of the size of a landclass tile? I confirm that SBX skips those quads with colors that are not indexed.

Post Reply