• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Anyone using FWTools?

Messages
181
Country
vaticancity
Being playing with FWTools a little, in particular the GDAL lib...
Just so I can get at a GeoTiff header, as well as the raw image if need be...

... the FWTools lib works but its stupid... if I just want this little thing... I add 43 Megs to my application because FWTools has to be installed as a big lump of lib...

I just cant believe its so backward with COM and registries and and and... this thing still wants you to set up paths which its install program doesnt even do... so you get into this terrible user installation...

I'm sorry user... go get this big lump...
Yes you installed it but now my program has to try find the stupid thing...
Ha... I found it user and we have now set the env variables so it can find itself... please restart your machine now so that it all kicks in...

Or some other such kludge like launching the app in another process...

They dont even list the dependencies!.... does anyone actually use this thing!

Is there a clever FWTools... if we pay money do we get the clever one... is there an alternate lib out there... 43 megs to read a file header is crazy... and most users will never ever get this right...

I need a lib... C or dotnet... that reads GeoTiff file headers... thx
 
Last edited:
In that case you just need one executable out of FWTools and you can throw the rest away.......

..... gdalinfo.exe.

This is actually part of GDAL as I recall so it should be available separately from http://www.gdal.org/. Frank Warmerdam (FW) bundled the GDAL stuff with a lot of other utlities in FSTools as I recall.

Or if you want to use it in a program then there are a number of dll files you might use and package with the application. I use C# and gdal_csharp.dll looks rather handy to me ;)
 
Thanks Scruffy... been there, done that... even with all these files installed
Code:
12/30/2008  02:58 PM         5,070,848 gdal16.dll
12/09/2008  02:28 PM            21,504 gdaladdo.exe
12/09/2008  02:28 PM            53,248 gdalenhance.exe
12/09/2008  02:28 PM            12,800 gdalinfo.exe
12/09/2008  02:28 PM             7,168 gdalmanage.exe
12/09/2008  02:28 PM             8,704 gdaltindex.exe
12/09/2008  02:28 PM            12,288 gdaltransform.exe
12/09/2008  02:28 PM            22,528 gdalwarp.exe
12/09/2008  02:28 PM             9,216 gdal_contour.exe
12/09/2008  02:28 PM            22,016 gdal_grid.exe
12/09/2008  02:28 PM            14,848 gdal_rasterize.exe
12/09/2008  02:28 PM            57,344 gdal_translate.exe
12/09/2008  03:24 PM           997,376 geos_c.dll
12/09/2008  03:24 PM           176,128 libcurl.dll
12/09/2008  03:26 PM         1,064,960 libeay32.dll
12/30/2008  05:33 PM               524 Microsoft.VC90.CRT.manifest
12/09/2008  03:24 PM           499,712 msvcp71.dll
12/09/2008  03:26 PM           568,832 msvcp90.dll
12/09/2008  03:24 PM           348,160 msvcr71.dll
12/09/2008  03:26 PM           655,872 msvcr90.dll
12/09/2008  03:24 PM           343,040 msvcrt.dll
12/09/2008  02:28 PM             7,168 nearblack.exe
12/09/2008  02:28 PM            65,536 ogr2ogr.exe
12/09/2008  02:28 PM            61,440 ogrinfo.exe
12/09/2008  02:28 PM            61,440 ogrtindex.exe
12/09/2008  03:26 PM           200,704 ssleay32.dll
12/09/2008  03:26 PM            73,728 zlib1.dll

It still fails and thats not to mention this "lite" install also wants all these data files...

Code:
07/21/2008  03:20 PM             6,797 coordinate_axis.csv
09/28/2007  04:52 PM            11,977 cubewerx_extra.wkt
03/18/2007  10:44 PM           345,646 ecw_cs.wkt
07/21/2008  03:20 PM            12,848 ellipsoid.csv
03/04/2004  01:06 PM                50 epsg.wkt
03/04/2004  01:06 PM           206,014 esri_extra.wkt
04/24/2010  10:46 PM                 0 fileList.txt
07/21/2008  03:20 PM            39,191 gcs.csv
10/30/2008  02:31 PM             1,454 gcs.override.csv
10/04/2006  09:54 PM             2,037 gdalicon.png
10/04/2006  09:55 PM            13,084 GDALLogoBW.svg
10/04/2006  09:55 PM            12,367 GDALLogoColor.svg
10/04/2006  09:55 PM            12,367 GDALLogoGS.svg
07/20/2007  04:21 PM           155,975 gdal_datum.csv
10/22/2007  09:03 PM            15,804 gt_datum.csv
10/22/2007  09:03 PM             1,719 gt_ellips.csv
08/25/2008  05:15 PM            10,183 LICENSE.TXT
07/21/2008  03:20 PM           492,362 pcs.csv
07/20/2007  04:21 PM               921 pcs.override.csv
11/28/2002  10:53 AM             1,599 prime_meridian.csv
07/21/2008  03:20 PM           181,552 projop_wparm.csv
02/15/2006  03:22 PM            13,304 s57agencies.csv
08/29/2000  02:04 PM             7,254 s57attributes.csv
07/30/2005  02:27 PM            18,115 s57attributes_aml.csv
08/30/2005  02:02 PM             8,745 s57attributes_iw.csv
08/29/2000  02:04 PM            20,885 s57expectedinput.csv
11/20/2007  09:40 AM            31,226 s57objectclasses.csv
11/20/2007  09:40 AM            63,984 s57objectclasses_aml.csv
11/20/2007  09:40 AM            37,030 s57objectclasses_iw.csv
11/12/2002  01:36 PM             9,216 seed_2d.dgn
05/12/2003  10:42 AM             2,048 seed_3d.dgn
07/21/2008  03:20 PM            10,315 stateplane.csv
07/21/2008  03:20 PM            18,860 unit_of_measure.csv

And when you query the obscure... Init Exception... you get the... Oh just install the whole of FWTools...

Its a big time waster... decide to give it away or sell it... this thing is a quick sand... its stupid... wasted 4 hours on the stupid thing...
 

Attachments

  • fileList.txt
    1.4 KB · Views: 508
Now that I've calmed down... nothing gets me more than if I lock in and then a day later find its a piece of junk...

Scruffy I think the problem is actually in the dotNet interop modules... I think the guy has linked it to everything... its now a mega brick...

The way to use FWTools is as you mentioned... have a look at the libs they using... and go use that... in the case of GeoTiff... you bypass FWTools which goes to GDAL and you bypass that as well until you get to these guys... http://www.remotesensing.org/geotiff/geotiff.html and you find the real tiff libs...

I also had a quick look at something called SharpMap which sits in front of FWTools... scary... ha ha

Needless to say, the documentation sucks and I've decided its going to be faster to just write the whole damn mapping program myself...
 
listgeo.exe is another way to get the data if you don't mind shelling out. That turns up in FSTools as well.

I am sure you have seen the GIS articles on Code Project.
 
Last edited:
Hi,

Yes, I am using FwTools as well :). As Jon pointed out you might be able to just use one of the libraries, if you are only interested in GeoTIFFs using only the libgeotiff might work. But if you want to use it with .NET then you need the wrapper and as you pointed it seems there is no wrapper per lib.

I have this same problem with the tool I am working on now, but I delayed it till later to figure out which files I actually need to ship with the tool. I plan to ask that on the mailing list, those guys are very helpful over there.
 
Thanks... Scruffy, I wouldn't normally consider it... shelling out or trapping the console pipe... over just calling the thing that does it directly but this GDAL thing is ringing all my alarm bells... I think if you going to use it, make the time, dig into it and rewrite the damn thing... or don't use it...

Like just look at this page...
http://trac.osgeo.org/gdal/wiki/BuildingOnWindows

That pre-built download gives you a LIB and some header files... and my first instinct was great!... I make a little DLL and interop from Java or C#... great!

But no... all that would do is give me my DLL, that "still" talks to their DLL... in "another" package...
Thats why your app is going to feel like a DOS dinosaur to the end user...
Why do they even bother making it open source!!!!
I don't think they want you to use it?

Its dwang... they creating a huge barrier to entry... they hiding a biz model... I think...

Arno I think there is a lot of mapping noise out there... I've been wondering if I really need GDAL and or the whole of FWTools and I don't think so... I think with just KML... a single hook like GeoTiffs... and MS's normal libs for say getting at BSQ data... one can make great FS mapping packages/tools... I think even linked to PostGIS servers delivering data...

If it doesn't support shape and the myriad of other files... bad luck... they locked down the library, and I found another way... besides I think KML is much better than "shape" which is like a women wearing her underwear on the outside... its old technology... ha ha

I'm using the Scruffy methodology on this one ;)

... wonder where FS will take me next... Astronomy? ;)
 
Hi,

I guess it depends on what you want to do. Those libraries contain a lot of functionality already. If you want to support GeoTIFF in any projection and have functionality to reproject them, I think using such a library is easier than writing it yourself. But it comes at a price with some extra dependencies as well of course.

Did you look at the geotiff lib already? For just reading the header that should be enough. I do not know how easy that one is to build as a DLL, but it does not depend on too many others i believe.

GDAL can read many more formats and is probably too much if you only want to read some GeoTIFF files.
 
Hi crash.

As far as stripping out the image data without the header, even MSPaint will display a geotiff. It just displays it as a regular tif, ignoring the registration.

So all you need is a program that will read the header data, or add the header data to a tif.

I hate to send you to a place with more frustration, but...

http://dl.maptools.org/dl/geotiff/libgeotiff/

This is a link to a zip file that contains a setup for a GUI of the tools you need. It also includes exactly the dlls and executables you need. Unfortunately, it uses the "installer" method on your computer, writing to the registry, creating an uninstall process, etc...

To make this simple, as there is no restriction in the readmes for distribution, and as this is open sourced, I have simpy made a folder of the mess, zipped it, and make it available to you without the setup file:

GeoTIFF_Tools_GUI.zip


As the readme says:

This free GUI was contributed by Kevin Chen (kchen@geosage.com) on Saturday 3 April 2005. If you have any question, you may direct your enquiry to him.

To further torment you, the TIFF files need to be uncompressed in order for the dlls to work properly. LZW compression kills the output.

Dick
 
Last edited:
Arno... Rumba... yes thanks, thats exactly where I ended up as well...

Rumba... yes that UI is a little frontend to the stuff I think Scruffy also mentioned... haven't tried it yet but it looks easy to use from shell and or if I want to dive into the source and make an DLL for C#...

... thx...

Arno... yes you right... it depends...
What I'm actually using the geoTiff for is to make the "World" in my little whackO mapO program... because I'm not too sure if I'm on the right track ;)

I'm making the program pick up on the geotTiff "World"... so if I drop a WGS 84 map of the world into the code as the first "tile"... that becomes the "world"...

... what I then want to do is add "realizable" KML...
So my whackO mapO program renders KML on my "world"...

And then thats where it ends... adding rivers and roads is just boring map stuff... I am then going to bastardize KML and make it do the FS thang! ;)

So... you draw little polygons on GE... they will show in WhackO MapO and you can say... that there polygon is the snow LC... and that there line is a VTP railway... and that little place mark is Arno's scenery and lets make it a church... and BTW... maps are boring... on our server we have a BastardO WhackO MapO KML for New York, Harry Potter... a world with out Australia... ha ha

Thats the idea... its not really a map although I'm stealing a few idea's... its the front end "brains" to S Builder....

You'll get used of me... a mean imagination ;)
Don't think there is a library for that... perhaps some tablets ... ha ha ha
 
Here's some more to irritate you:

GeoTIFF_Tools_GUI_modern.zip

It uses the latest FWTools dlls. They are multiplying to increase the bloat, but they do handle LZW compression in the tif. It uses the same GUI... just the dlls are changed, so there is some backward compatibility.

Of course this isn't much help for a C# solution. I'm not sure how Luis did this for SBuilderX, but he did have a solution for the geotiff headers in VB.Net 2.0

Dick
 
I am using the FwTools DLL files in my gPoly tool as well and that is in C#. With the wrapper it seems to work quite well. But like I mentioned in my earlier post I still need to figure out which files it depends on exactly, now I just have all DLL files from FwTools with my application.
 
I found a more compact setup for .NET tiffs ( including geotiff ):

FreeImage

It has a 185kb NET wrapper DLL, and a 2364kb binary DLL... so the size isn't unworkable. Still a lot of code for a small usage.

I built a C# metadata reader example they provided, and it imported and built it in VSExpress C# 2010 just fine. I loaded the mileniumimage3.tif from the SDK, and got the metadata back:

freeimagemetadata.png


Dick
 
I found a more compact setup for .NET tiffs ( including geotiff ):

FreeImage

Dick

Rhumba... seems you have a knack for finding good stuff ;)

Now this is an open source lib... load it up and run it... even the C compiles out of the box... no pseudo dwang where some idiot pretends he codes in pico, debugs in a terminal window and expects you to spend 3 days reconstructing all the crap in a raw makefile...

I was thinking that if this little lib needed a little GeoTiff stuff... I'd take the stuff from these other fake open source projects and put it in here...

I really didnt have to or want to know what a GeoTiff or Tiff was...

Now that I do... I actually think its going to take about 20 lines of code to just do it (get/set the GIS info) in dotNET... no libs required...

When I get to it... I'll post it here...
 
Thanks Dick, interesting, might be an alternative for the FwTools DLLs as well for me.
 
Let Gates live!

You know, we all assuming for some reason that dotNet cant do it...
DotNet... eats this stuff up... yes! I'm surprised as well - ha ha...

This almost does it all already... pure DOT NET

Code:
         Int16 ImageWidth = 0; //pixels
        Int16 ImageHeight = 0; //pixels
        Double LEFT_LONG = 0; //map coords
        Double TOP_LAT = 0; //map coords
        Double dXScale = 0; //degs/pixel
        Double dYScale = 0; //degs/pixel

        Int16 GEOMODEL = 0;
        Int16 GEORASTER = 0;
        Int16 GeographicType = 0;
        Int16 GeogAngularUnits = 0;


        enum EXIFTags
        {
            PixelScale = 0x830e,
            ModelTiePoint = 0x8482,
            GeoTiffDirectory = 0x87AF,
            ImageWidth = 0x0100,
            ImageHeight = 0x0101,
            BitsPerSample = 0x0102,
            Compression = 0x0103,
            Photometric = 0x0106,
            Thresholding = 0x0107,
            PlanarConfig = 0x011c
        }

        enum GEOVector
        {
            Version = 0x0001,
            Model = 0x0400,
            Raster = 0x0401,
            Citation = 0x0402,
            GeographicType = 0x0800,
            GeogCitation = 0x0801,
            GeogGeodeticDatum = 0x0802,
            GeogPrimeMeridian = 0x0803,
            GeogLinearUnits = 0x0804,
            GeogLinearUnitSize = 0x0805,
            GeogAngularUnits = 0x0806,
            GeogAngularUnitSize = 0x0807,
            GeogEllipsoid = 0x0808,
            GeogSemiMajorAxis = 0x0809,
            GeogSemiMinorAxis = 0x080A,
            GeogInvFlattening = 0x080B,
            GeogAzimuthUnits = 0x080C,
            GeogPrimeMeridianLong = 0x080D,
            ProjectedCSType = 0x0c00,
            PCSCitation = 0x0c01,
            Projection = 0x0c02,
            ProjCoordTrans = 0x0c03,
            ProjLinearUnits = 0x0c04,
            ProjLinearUnitSize = 0x0c05,
            ProjStdParallel1 = 0x0c06,
            ProjStdParallel2 = 0x0c07,
            ProjNatOriginLong = 0x0c08,
            ProjNatOriginLat = 0x0c09,
            ProjFalseEasting = 0x0c0A,
            ProjFalseNorthing = 0x0c0B,
            ProjFalseOriginLong = 0x0c0C,
            ProjFalseOriginLat = 0x0c0D,
            ProjFalseOriginEasting = 0x0c0E,
            ProjFalseOriginNorthing = 0x0c0F,
            ProjCenterLong = 0x0c10,
            ProjCenterLat = 0x0c11,
            ProjCenterEasting = 0x0c12,
            ProjCenterNorthing = 0x0c13,
            ProjScaleAtNatOrigin = 0x0c14,
            ProjScaleAtCenter = 0x0c15,
            ProjAzimuthAngle = 0x0c16,
            ProjStraightVertPoleLong = 0x0c17,
            ProjRectifiedGridAngle = 0x0c18,
            VerticalCSType = 0x1000,
            VerticalCitation = 0x1001,
            VerticalDatum = 0x1002,
            VerticalUnits = 0x1003
        }

        public Bitmap initGeoTiff()
        {

            Bitmap mainBmp = new Bitmap(@"F:\DEV2010\PROJECTS\netProjects\TestPanel\TestPanel\RingPiece.tif");

  
            PropertyItem[] propItems = mainBmp.PropertyItems;

            foreach (PropertyItem propItem in propItems)
            {

                switch (propItem.Id)
                {
                    case (int)EXIFTags.ImageWidth:

                        if (propItem.Len != 2) throw new Exception("Oops this code is not smart enuf");
                        ImageWidth = BitConverter.ToInt16(propItem.Value,0);

                        break;

                    case (int)EXIFTags.ImageHeight:

                        if (propItem.Len != 2) throw new Exception("Oops this code is not smart enuf");
                        ImageHeight = BitConverter.ToInt16(propItem.Value,0);

                        break;

                    case (int)EXIFTags.ModelTiePoint:
                        {
                            //Wild guesses at what data actually is... but looks ok
                            byte[] b = propItem.Value;
                            Double d0 = BitConverter.ToDouble(b, 0);
                            Double d1 = BitConverter.ToDouble(b, sizeof(Double));
                            Double d2 = BitConverter.ToDouble(b, 2 * sizeof(Double));
                            LEFT_LONG = BitConverter.ToDouble(b, 3 * sizeof(Double));
                            TOP_LAT = BitConverter.ToDouble(b, 4 * sizeof(Double));
                            Double d5 = BitConverter.ToDouble(b, 5 * sizeof(Double));

                        }
                        break;

                    case (int)EXIFTags.PixelScale:
                        {
                            byte[] b = propItem.Value;
                            //Wild guesses at what data actually is... but looks ok
                            dXScale = BitConverter.ToDouble(b, 0);
                            dYScale = BitConverter.ToDouble(b, sizeof(Double));
                            Double dZ = BitConverter.ToDouble(b, 2 * sizeof(Double));

                        }
                        break;

                    case (int)EXIFTags.GeoTiffDirectory:
                        {
                            //Wild guesses at what data actually is... 

                            int byteOffset = 0;
                            byte[] b = propItem.Value;

                            while (byteOffset < b.Length)
                            {

                                Int16 vector = BitConverter.ToInt16(b, byteOffset);
                                byteOffset += sizeof(Int16);

                                switch (vector)
                                {
                                    case (int)GEOVector.Version:
                                        Int16 bV1 = BitConverter.ToInt16(b, byteOffset);
                                        byteOffset += sizeof(Int16);
                                        Int16 bV2 = BitConverter.ToInt16(b, byteOffset);
                                        byteOffset += sizeof(Int16);
                                        Int16 bV3 = BitConverter.ToInt16(b, byteOffset);
                                        byteOffset += sizeof(Int16);

                                        string GeoVersion = "" + bV1 + "." + bV2 + "." + bV3;

                                        break;

                                    case (int)GEOVector.Model:
                                        {
                                            Int16 bSpacerUnknown = BitConverter.ToInt16(b, byteOffset);
                                            byteOffset += sizeof(Int16);
                                            Int16 bSpacer2Unknown = BitConverter.ToInt16(b, byteOffset);
                                            byteOffset += sizeof(Int16);
                                            GEOMODEL = BitConverter.ToInt16(b, byteOffset); // 1 = Projected,2 = Geographic,3 = Geocentric
                                            byteOffset += sizeof(Int16);
                                        }
                                        break;

                                        
                                    case (int)GEOVector.Raster:
                                        {
                                            Int16 bSpacerUnknown = BitConverter.ToInt16(b, byteOffset);
                                            byteOffset += sizeof(Int16);
                                            Int16 bSpacer2Unknown = BitConverter.ToInt16(b, byteOffset);
                                            byteOffset += sizeof(Int16);
                                            GEORASTER = BitConverter.ToInt16(b, byteOffset); // 1 = Pixel Is Area, 2 = Pixel Is Point
                                            byteOffset += sizeof(Int16);
                                        }
                                        break;
                                        
                                    case (int)GEOVector.GeographicType:
                                        {
                                            Int16 bSpacerUnknown = BitConverter.ToInt16(b, byteOffset);
                                            byteOffset += sizeof(Int16);
                                            Int16 bSpacer2Unknown = BitConverter.ToInt16(b, byteOffset);
                                            byteOffset += sizeof(Int16);
                                            GeographicType = BitConverter.ToInt16(b, byteOffset); // 4326 = WGS 84
                                            byteOffset += sizeof(Int16);
                                        }
                                        break;

                                    case (int)GEOVector.GeogAngularUnits:
                                        {
                                            Int16 bSpacerUnknown = BitConverter.ToInt16(b, byteOffset);
                                            byteOffset += sizeof(Int16);
                                            Int16 bSpacer2Unknown = BitConverter.ToInt16(b, byteOffset);
                                            byteOffset += sizeof(Int16);
                                            GeogAngularUnits = BitConverter.ToInt16(b, byteOffset); // 9102	= Angular Degree
                                            byteOffset += sizeof(Int16);
                                        }

                                        break;
                                default:
                                        Debug.WriteLine(" VECTOR Data that could be captured ");
                                        Debug.WriteLine(String.Format("{0:X}", vector));
                                        //Dummy Read
                                        byteOffset += 3 * sizeof(Int16);
                                    break;
                                }// end vector switch

                            }// end while vector
                            
                        }
                        break;

                    default:
                        Debug.WriteLine(" Meta Data that could be captured ");
                        Debug.WriteLine(String.Format("{0:X}", propItem.Id));
                        Debug.WriteLine(propItem.Type);
                        Debug.WriteLine(propItem.Len);
                        Debug.WriteLine(propItem.Value);
                        break;
                }
            }//end meta


            if (dXScale == 0) throw new Exception("Oops Image does not have properties");

            //Output test mapping data...
            Debug.WriteLine("LEFT COORD OF IMAGE " + LEFT_LONG);
            Debug.WriteLine("RIGHT COORD OF IMAGE " + LongFromXPixel(ImageWidth));
            Debug.WriteLine("TOP COORD OF IMAGE " + TOP_LAT);
            Debug.WriteLine("BOTTOM COORD OF IMAGE " + LatFromYPixel(ImageHeight));

            //Check from Long and Lat to actual Pixel pos
            Debug.WriteLine("THE CENTER OF MY WORLD MAP IS " + PixelFromPntCoord(0.0, 0.0));
            
            //Playing
            Debug.WriteLine("Impossible Coord " + LongFromXPixel(-100));

            return mainBmp;


       }
        //---
        public Double LongFromXPixel(Int16 xPixel)
        {
            Double xLong = LEFT_LONG + (xPixel * dXScale);
            return xLong;
        }
        //---
        public Double LatFromYPixel(Int16 yPixel)
        {
            Double yLat = TOP_LAT - (yPixel * dYScale);
            return yLat;
        }
        //---
        public Int16 XPixelFromLong(Double xLong)
        {
            Double xPixel = (Double)(xLong - LEFT_LONG) / dXScale;
            return (Int16)xPixel;
        }
        //---
        public Int16 YPixelFromLat(Double yLat)
        {
            Double yPixel = (Double)(TOP_LAT - yLat) / dYScale;
            return (Int16)yPixel;
        }
        //---
        public Point PixelFromPntCoord(Double xLong, Double yLat)
        {
            Point pixelPoint = new Point(XPixelFromLong(xLong),YPixelFromLat(yLat));
            return pixelPoint;
        }

Kind of glad I had a little look at dotNet again... of course if you developing from PC to Apple Linux to Symbian Cell... Rhumba's find is the way to go... but if you targeting the dotNet user... its much more powerful than I imagined.

And something else I discovered... did you know that the same EXIF structure is also used in PNG, JPEG... so a GeoPNG is not actually a crazy thing... camera's are already GeoTagging Jpegs...

Well... I'm happy now... I say... LET GATES LIVE!

Figured how to parse the Projection Data...
There you go... all done in dotNET
See Code Above...
 
Last edited:
I dunno guys...

I got FWTools and wrote a commandline routine to take my downloaded 0.16m jp2's, (about 15 gigs),warp them,store the geotiff data,write the inf file, resample it, and collect the bgls. It took about 60 hours straight, ( I wasn't home) but I had commercial level photoreal bgls for nothing. I'll publish it if anyone thinks it's worth it. The code, that is.
 
I got FWTools and wrote a commandline routine to take my downloaded 0.16m jp2's, (about 15 gigs),warp them,store the geotiff data,write the inf file, resample it, and collect the bgls. It took about 60 hours straight, ( I wasn't home) but I had commercial level photoreal bgls for nothing. I'll publish it if anyone thinks it's worth it. The code, that is.

John Yes... show us the BAT or the JScript or whatever it was you used...
A few comments in the code would be nice...

Don't think anyone is arguing with FWTools as a production factory...
But if all you trying to do is display an Icon (analogy)... too much indivisible engine is the issue...

Lets see the code... I'm wondering what made the inf for you from the command line?
And I didn't know that the resampler even cared about GeoTags?
So I'm wondering why you bothered unless perhaps its some stitching process?
Yeah...teach us... ET wants input ;)

The real issue is actually just this... lock in.
So if I was developing for a military company, would I do it in dotNet... perhaps... but only if I developed the whole graphics engine as well...
I'm making a little mapping program now and expediency makes the choice dotNet or more specifically Microsoft's graphics engine... but if I was working for Lockheed Martin, I'd probably develop the whole engine from open source on Debian, and interop with dotNet where need be... the reason is lock in.
For example... what happens if I go along and find that dotNets engines cant load 5 gig images, and I need that... screwed!
Thats the issue... but then again Lockhead Martin and Microsoft probably have a join design team... so not an issue, but perhaps Garmin doesn't have that privilege... they would then go "owned" open source.

What I'm finding is that its not very "open"... so the real question is who actually owns FWTools... that would probably answer all our questions.
I don't believe that the "open" source model in FWTools is the same tool that they have used in say Global Mapper... they derivatives in a biz model and that means lots of work if you have to dive in.

On a million dollar military project... I'd make sure I own the whole value added channel... as a hobbyist that wants to get the whole thing done in a week... its a calculated gamble... I lock in somewhere at some level and take the risk.

The real process that I'm going through is discovering what the real business models are... thats actually a lot of fun.


One thing that I am wondering about is why we don't see plugin drivers for the Microsoft dotNet system... specialized GeoTiff drivers that fall into the same API... to me that seems the most logical step... so again I think its the business model... like I guess Adobe wouldn't want to plug their engines into MS for free... etc etc

Now thats the interesting stuff ;)
 
Last edited:
As you requested.......

ECHO ON
REM
REM WARP THE JP2 from Vermont stateplane to GEO LAT LON
REM

GDALWARP -s_srs EPSG:32145 -t_srs "+proj=latlong +datum=WGS84" -co
INTERLEAVE=PIXEL -co TFW=YES -of GTiff -rcs E:\%1.jp2 C:\PHOTOREAL\%1.tif
REM
REM StORE THE GEOTIFFS
REM THEY WILL BE NEEDED FOR NIGHT TEXTURES BECAUSE CONVERSION TO BMPS
REM

LISTGEO C:\PHOTOREAL\%1.tif>C:\PHOTOREAL\GTFS\%1.GTF
REM
REM CREATE THE INF FILE ON THE FLY
REM

echo [Source] >> %1%.inf
echo Type = GeoTiff >> %1%.inf
echo Layer = Imagery >> %1%.inf
echo SourceDir = "C:\PHOTOREAL" >> %1%.inf
echo Variation = Day >> %1%.inf
echo SourceFile = "%1.tif" >> %1%.inf
echo NullValue = 0,0,0 >> %1%.inf
echo [Destination] >> %1%.inf
echo DestDir = "C:\PHOTOREAL" >> %1%.inf
echo DestBaseFileName = "%1" >> %1%.inf
echo DestFileType = BGL >> %1%.inf
echo UseSourceDimensions = 1 >> %1%.inf
echo CompressionQuality = 90 >> %1%.inf
echo NullValue = 0,0,0 >> %1%.inf
REM
resample.exe %1.inf
REM
REM MY TIFS WERE 400 MEGS EA SO I DIDN'T KEEP STUFF FIRST PASS
REM

del C:\PHOTOREAL\%1.tif
del C:\PHOTOREAL\%1.inf
del C:\PHOTOREAL\%1.tfw

REM
REM IF I DO NIGHT TEXTURES I WIL REGEN ONE AT A TIME
REM
REM ABOVE CODE IS CALLED DO_IT_ALL_INITIAL_PASS.BAT



REM FOLLOWING CODE IS CALLED RUN_DO_IT_ALL_INITIAL_PASS.BAT

CALL DO_IT_ALL_INITIAL_PASS 100218
CALL DO_IT_ALL_INITIAL_PASS 100219
CALL DO_IT_ALL_INITIAL_PASS 100220
.................................
CALL DO_IT_ALL_INITIAL_PASS 1003301

PUT BOTH BATS IN FWTOOLS/BIN AND DBL CLICK ON RUN_DO_IT_ALL_INITIAL_PASS.BAT
GO TO LAS VEGAS FOR A COUPLE OF DAYS
COME BACK AND HARVEST YOUR BGLS
PREPARE FOR A FAT FINANCIAL OFFER FROM MEGASCENERY TO PLEASE SHUT UP AND GO AWAY.....

...
ALL KIDDING ASIDE, THIS ALLOWS ONE TO GO DIRECTLY FROM JP2S TO BGLS FOR SOMETHING REASONABLE :teacher:TO FLY OVER.....
 
Last edited:
Back
Top