Board index FlightGear Development Scenery

Error ogr-decode

Questions and discussion about enhancing and populating the FlightGear world.

Error ogr-decode

Postby legoboyvdlp » Mon Sep 17, 2018 5:23 pm

Code: Select all
   CLIPPED row 1 of 1 - center lat is 53.6875
Saving to buckets
Error reading Index file ../../Projects/Ireland/work/w010n50/w010n51/chop.idx abort
All done!


Every time I try to run ogr-decode on my osm landmass, I get this. Any ideas?
User avatar
legoboyvdlp
 
Posts: 5832
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Error ogr-decode

Postby legoboyvdlp » Mon Sep 17, 2018 6:27 pm

Hgtchop and terrafit finished with no errors, same with genapts. But ogr-decode failed on Default.
User avatar
legoboyvdlp
 
Posts: 5832
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Error ogr-decode

Postby wlbragg » Mon Sep 17, 2018 7:16 pm

Is the below file there and does it compare to others that do work?
../../Projects/Ireland/work/w010n50/w010n51/chop.idx


I noticed your on windows, what version or where did you get the tool chain?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4183
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Error ogr-decode

Postby legoboyvdlp » Mon Sep 17, 2018 8:34 pm

I compiled it myself using fg-from-scratch on windows 10 and it worked fine for Jan Mayen.

That file was the only one processed before the process aborted, so no .idx file worked at all.

What tool creates the .idx, is it made by ogr-decode itself?

I also get an Error 4: no such file when using gdalchop so I use hgtchop. I think gdalchop has never worked on windows.
User avatar
legoboyvdlp
 
Posts: 5832
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Error ogr-decode

Postby wlbragg » Mon Sep 17, 2018 9:05 pm

What tool creates the .idx, is it made by ogr-decode itself?


/src/Lib/terragear/tg_chopper.cxx
Approx. Line 137

Code: Select all
long int tgChopper::GenerateIndex( std::string path )
{
    std::string index_file = path + "/chop.idx";
    long int index = 0;

    //Open or create the named mutex
    boost::interprocess::named_mutex mutex(boost::interprocess::open_or_create, "tgChopper_index2");
    {
        boost::interprocess::scoped_lock<boost::interprocess::named_mutex> lock(mutex);

        /* first try to read the file */
        FILE *fp = fopen( index_file.c_str(), "r+" );
        if ( fp == NULL ) {
            /* doesn't exist - create it */
            fp = fopen( index_file.c_str(), "w" );
            if ( fp == NULL ) {
                SG_LOG(SG_GENERAL, SG_ALERT, "Error cannot open Index file " << index_file << " for writing");
                boost::interprocess::named_mutex::remove("tgChopper_index2");
                exit( 0 );
            }
        } else {
            fread( (void*)&index, sizeof(long int), 1, fp );
            if (ferror(fp))
            {
                perror ("The following error occurred");
                SG_LOG(SG_GENERAL, SG_ALERT, "Error reading Index file " << index_file << " abort");
                boost::interprocess::named_mutex::remove("tgChopper_index2");
                exit(0);
            }
        }

        index++;

        rewind( fp );
        fwrite( (void*)&index, sizeof(long int), 1, fp );
        fclose( fp );
    }

    boost::interprocess::named_mutex::remove("tgChopper_index2");

    return index;
}

Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4183
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Error ogr-decode

Postby Alant » Mon Sep 17, 2018 9:13 pm

Same here. I reported it on the devel list back in July. It fails ogr.decode on some, but not all, shape files., with the same error message that you see.

All is OK when I test it on the simple example that comes with this package.

The batch file I use is one that works with an older version of the terragear toolchain.

Unfortunately the author is not seeing these errors.

Alan
Alant
 
Posts: 750
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: Error ogr-decode

Postby wlbragg » Mon Sep 17, 2018 9:16 pm

This is really interesting. This is exactly where the Windows early abort error was see

05e4d8 fix Windows early abort in tg_chopper.cxx
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4183
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Error ogr-decode

Postby Alant » Mon Sep 17, 2018 9:41 pm

I have sent a message to re-activated the devel list thread. Are there any terragear developers still with us?

Alan
Alant
 
Posts: 750
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: Error ogr-decode

Postby xDraconian » Mon Sep 17, 2018 10:06 pm

legoboyvdlp wrote in Mon Sep 17, 2018 6:27 pm:But ogr-decode failed on Default

Do you in fact have a Default layer? i.e. does work\Default exist?

If that isn't the issue, would you mind sharing your work files with me so that I can attempt to reproduce the issue?
xDraconian
 
Posts: 86
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: Error ogr-decode

Postby legoboyvdlp » Mon Sep 17, 2018 10:21 pm

No, there is no Default in work - in data/ there is. I'll zip it up and send it tomorrow or next day ;)
User avatar
legoboyvdlp
 
Posts: 5832
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Error ogr-decode

Postby legoboyvdlp » Tue Sep 18, 2018 2:12 pm

User avatar
legoboyvdlp
 
Posts: 5832
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Error ogr-decode

Postby xDraconian » Fri Sep 21, 2018 7:36 am

Hi Jonathan,

I looked at your command.
Cause: you did not declare a subfolder to place the generated files, therefore, all chop.idx files are being overwritten, leaving you with a single chop.idx file. You should have many unique chop.idx files. ogr-decode will write a new chop.idx file, which is destroying the chop.idx file it is attempting to read.

Changing the command to this will work without issue:
Code: Select all
ogr-decode.exe --area-type Default work/Default data/land_polygons

Make sure each landclass is in a unique work folder.

Scott
xDraconian
 
Posts: 86
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: Error ogr-decode

Postby legoboyvdlp » Fri Sep 21, 2018 8:35 am

Ah, ok! Thank you :)

I will try that shortly.

Edit:

Having run the script again
Code: Select all
ogr-decode.exe --area-type Default ../../Projects/Ireland/work/Default ../../Projects/Ireland/data/land_polygons

,
I get
Code: Select all
   CLIPPED row 1 of 1 - center lat is 53.6875
Saving to buckets
Error reading Index file ../../Projects/Ireland/work/Default/w010n50/w010n52/chop.idx abort
.

So it now puts it in the correct folder, but still has the error.
Perhaps I need to run the tools from the beginning (hgtchop, terrafit, etc)?

I should also try redownloading and cropping the osm landmass shapefiles, perhaps they got corrupted...

I looked in the folder work/Default/w010n50/w010n52, and there is only one chop.idx file.
User avatar
legoboyvdlp
 
Posts: 5832
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Error ogr-decode

Postby xDraconian » Sat Sep 22, 2018 4:22 am

legoboyvdlp wrote in Fri Sep 21, 2018 8:35 am:I looked in the folder work/Default/w010n50/w010n52, and there is only one chop.idx file.

Yes, that is as expected.

legoboyvdlp wrote in Fri Sep 21, 2018 8:35 am:Perhaps I need to run the tools from the beginning (hgtchop, terrafit, etc)?

Yes, I would delete my work folder and restart from the beginning.
xDraconian
 
Posts: 86
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: Error ogr-decode

Postby legoboyvdlp » Tue Sep 25, 2018 3:46 pm

We have some sea level rise!

Image

Still chop.idx error even after redownloading, cropping, and saving landmass shapefile:


Saving to buckets
Error reading Index file work/Default/w010n50/w010n52/chop.idx abort

also get the error on all roads, rail, stream, lake, and about half of corine landcover data
command file:
https://pastebin.com/b6Tyc1xZ


edit: this suggests it may be multithreading causing it possible?
viewtopic.php?t=22464&p=211792#p211792

edit 2:
see
viewtopic.php?t=22464&p=211792#p218439

did this get commited?

I'll try and use https://onedrive.live.com/?authkey=%21A ... ion=locate
User avatar
legoboyvdlp
 
Posts: 5832
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Next

Return to Scenery

Who is online

Users browsing this forum: Bing [Bot] and 5 guests