I have 10 GB tiff Image file and I want to load on Thinkgeo map.
I use following code to load tiff image file:
Dim MAPA_FOTO As GeoTiffRasterLayer = New GeoTiffRasterLayer(Server.MapPath("~\App_Data\Imagem_Completa_Grade1.tif"))
Dim proj4 As Proj4Projection = New Proj4Projection()
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(32723)
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString()
proj4.Open()
MAPA_FOTO.ImageSource.Projection = proj4
MAPA_FOTO.UpperThreshold = Double.MaxValue
MAPA_FOTO.LowerThreshold = 0
overlays.LayerOverlay(“MAPA FOTO”, False, TileType.SingleTile).Layer(MAPA_FOTO).IsVisible(False)
I develop this project in MVC 3
Earlier when I load 350 MB tiff file that time above code work correctly.
When I use above code to load 10 gb tiff file there are following error occur:
1) Object reference not set to an instance.
2) This layer doesn’t have bounding box.
Their is also one more question that How can I load that much large image file over the web,
Is their any way to load this image faster over the web?
Load Large size tiff image file in thinkgeo map
Hi Vivek,
Based on your reported errors, I am guessing if is the world file “Imagem_Completa_Grade1.tfw” missing?
Besides, as the tif image file is almost 10 GB, it will must result to an out of memory issue if loading it at one time. Currently, Map Suite supports the multi Raster images loading towards this kind of issue. Please refer to our wiki sample Multi_Geo_Raster_Layer wiki.thinkgeo.com/wiki/Map_Suite_Wpf_Desktop_Edition_All_Samples#Multi_Geo_Raster_Layer.
Please let us know if there is any issue when using this feature.
Thanks,
Johnny
Thanks Johnny
Now I split that 10 GB tiff file into several pieces.
But now problem is Memory exception is occur when I run the project as you said.
As You say I see that(Multi_Geo_Raster_Layer ) sample but it is in desktop addition and they are using jpeg image file,
while my project is in MVC 3 and TIF image file,
So Can You please give me the sample in MVC 3,
So I can try.
Hi Vivek,
Thanks for your futher information, before a deeper test, may I make a confirmation with you?
Does the 10GB tiff contain multi tif files or just one tif file?
If they are multi tif files, do they get loaded simultaneously?
If they are not loaded simultaneously, would you please use a loop to load the 10GB file one by one? that way the tif file that caused the error described in your first post could be found, then would you please send us the the founded wrong tif file to check what we could do.
Waiting for your further information.
Summer
Thanks Summer for reply…
There is only 1 tif file with 10 GB size.
Tif contain two other files one is .tfw and another is .xml I split 10 GB tif image into 56 parts with 56 .tfw and .xml files.
So if I load Only one image that it is loaded easily.
I already use a loop to display this many images my code is as below:
Dim i As Integer
Dim MAPA_FOTO(3) As GeoTiffRasterLayer
For i = 1 To 2
MAPA_FOTO(i - 1) = New GeoTiffRasterLayer(Server.MapPath("~\App_Data" + i.ToString() + ".tif"))
Dim proj4 As Proj4Projection = New Proj4Projection()
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(32723)
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString()
proj4.Open()
MAPA_FOTO(i - 1).ImageSource.Projection = proj4
MAPA_FOTO(i - 1).UpperThreshold = Double.MaxValue
MAPA_FOTO(i - 1).LowerThreshold = 0
MAPA_FOTO(i - 1).DrawingQuality = DrawingQuality.HighSpeed
overlays.LayerOverlay("MAPA FOTO" + i.ToString(), False, TileType.SingleTile).Layer(MAPA_FOTO(i - 1)).IsVisible(True).IsVisibleInOverlaySwitcher(False)
Next
Problem is memory exception because 1 image file size is approx. 280MB, and I want to load 56 images on map.
Hi vivek,
Looping the layers will bring us back into the memory exception.
As you have split the tif image into 56 parts, the best solution is following the Multi_Geo_Raster_Layer sample from the code community. The sample is using the R-Tree to build the index with the extent and drawing the shape with GdiPlusRasterLayer directly.
As for the sample is built by Winform, I don’t think it is difficult to build a MVC sample. And the sample is not only for jpg file but fit for every raster image like the Tif,Ecw etc. the only one place needs us to modify is the method “BuildReferenceFile” in MultiGeoRasterLayer class.
Just replace
string[] files = Directory.GetFiles(pathOfRasterFiles, "*.jpg");
with
string[] files = Directory.GetFiles(pathOfRasterFiles, "*.tif");
If there is any questions during using the MultiGeoRasterLayer, please feel free to let us know.
Thanks,
Johnny
if you want to load large tiff through the web. you may wanna try web tiff viewing toolkit. some people suggest to split 10gb file into several small files. that is a good way to go.
Hi Fdsf,
Thanks for your suggestion.
Regards,
Don
hello, you are making a good point. so you may interested in tiff loader, tiff web viewer, tiff splitter or other software.
Posted By fdsf on 01-05-2014 08:26 PM
if you want to load large tiff through the web. you may wanna try web tiff viewing toolkit. some people suggest to split 10gb file into several small files. that is a good way to go.
do an online search and then you will find more about it.
Sdfwe,
Thanks for your sharing.
Johnny
Hi Susanna,
I think you can Google it, we haven’t find a good source for web tiff viewing toolkit till now.
Regards,
Don