Bug in reprojection
STH
Global Mapper UserTrusted User
There seem to be a bug in GlobalMapper when viewing some systems. Its small, but very noticeable when generating new files. It will leave in my case a 1x10 pixel area in every "corner" of the "old" area-limits.
This is what I did to see this bug:
1. Load a MapCatalogue of all my input files.
2. Configure - Projection - Choose my custom made prj-file (attached below)
When I now zoom in to a corner between 4 adjacent files I see the error between the files (all4images.jpg). I zoom in and mark the missing" data. The 3 horisontal lines missing from file in the SOUTH-EAST is the red-yellow-blue lines, while the purple vertical line is missing from the file SOUTH-WEST. It seems globalmapper "cuts" them.
A before (before.jpg) and after (after.jpg) image WITH interpolate turned on shows the problem.
3. Choose layer - options - modify display of map layers - Check Interpolate - OK - OK
4. File - Export Raster - Export GeoTIFF:
Geotiff options: 24-bit, Change spacing to even numbers 0,3 and 0,3. Check Always generate square pixels. Generate TFW file, Interpolate to fill small gaps in data
Gridding: Width: 1200 x 1200, skip existing files
Export bounds: Global Projection: 152400 x 70800
5. The resulting files all have the same 1x10 pixel "gap" where the "old" images met.
PRJ: PROJCS["Transverse_Mercator",GEOGCS["Geographic Coordinate System",DATUM["UK72",SPHEROID["GRS 1980",6378137.000,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["scale_factor",1.00006900],PARAMETER["central_meridian",18.03473900000047],PARAMETER["latitude_of_origin",0],PARAMETER["false_easting",128594.600],PARAMETER["false_northing",-6525959.45],UNIT["Meter",1]]
[UPDATE] Quick fix: The quick fix would be that the interpolate option would fill this gap, I do not understand why GlobalMapper does not do this now. Anyway what is considered a "small" gap for interpolation? Is 4x10 pixels a small gap? Is this a setting that can be changed somehow to also fill gaps in larger areas?
This is what I did to see this bug:
1. Load a MapCatalogue of all my input files.
2. Configure - Projection - Choose my custom made prj-file (attached below)
When I now zoom in to a corner between 4 adjacent files I see the error between the files (all4images.jpg). I zoom in and mark the missing" data. The 3 horisontal lines missing from file in the SOUTH-EAST is the red-yellow-blue lines, while the purple vertical line is missing from the file SOUTH-WEST. It seems globalmapper "cuts" them.
A before (before.jpg) and after (after.jpg) image WITH interpolate turned on shows the problem.
3. Choose layer - options - modify display of map layers - Check Interpolate - OK - OK
4. File - Export Raster - Export GeoTIFF:
Geotiff options: 24-bit, Change spacing to even numbers 0,3 and 0,3. Check Always generate square pixels. Generate TFW file, Interpolate to fill small gaps in data
Gridding: Width: 1200 x 1200, skip existing files
Export bounds: Global Projection: 152400 x 70800
5. The resulting files all have the same 1x10 pixel "gap" where the "old" images met.
PRJ: PROJCS["Transverse_Mercator",GEOGCS["Geographic Coordinate System",DATUM["UK72",SPHEROID["GRS 1980",6378137.000,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["scale_factor",1.00006900],PARAMETER["central_meridian",18.03473900000047],PARAMETER["latitude_of_origin",0],PARAMETER["false_easting",128594.600],PARAMETER["false_northing",-6525959.45],UNIT["Meter",1]]
[UPDATE] Quick fix: The quick fix would be that the interpolate option would fill this gap, I do not understand why GlobalMapper does not do this now. Anyway what is considered a "small" gap for interpolation? Is 4x10 pixels a small gap? Is this a setting that can be changed somehow to also fill gaps in larger areas?
Comments
-
Do the gaps show up in your data prior to reprojected or only after you have reprojected to your custom projection? Is it possible for you to provide me with your map catalog file and 4 of the data files that demonstrate this so that I can examine what is going on? You can email them to support@globalmapper.com.
The small gap filling for color images is currently only for very small gaps (i.e. 2 pixels or less in any direction). For elevation layers the gaps can be much larger, up to 30 pixels, as elevation layers tend to have larger holes and smoother transitions between values. For image layers the color transitions can be much more abrubt and interpolating to fill gaps of significant size doesn't generate usable results in many cases.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
global_mapper wrote: »Do the gaps show up in your data prior to reprojected or only after you have reprojected to your custom projection? Is it possible for you to provide me with your map catalog file and 4 of the data files that demonstrate this so that I can examine what is going on? You can email them to support@globalmapper.com.
The gaps does not show before reprojection (when using the correct coordinate system - SWEREF 99 TM), it shows after I choose Tools - configure projection and then my custom projection (image before.jpg). I can not send you the original files (50MB each) - however I will send you the MapCatalogue and Workspace- file to your e-mail in a sec.
[UPDATE] = I have sent you the 4 files on yousendit.com - it will arrive within 15 minutes.global_mapper wrote: »The small gap filling for color images is currently only for very small gaps (i.e. 2 pixels or less in any direction). For elevation layers the gaps can be much larger, up to 30 pixels, as elevation layers tend to have larger holes and smoother transitions between values. For image layers the color transitions can be much more abrubt and interpolating to fill gaps of significant size doesn't generate usable results in many cases. -
The problem was indeed related to the Transverse Mercator and UTM projections becoming non-reversible quickly as you get more than about 3 degrees from the central meridian (as some of your coordinates are relative to the center of the UTM zone).
I have been able to improve Global Mapper's behavior in the face of projection math that is not perfectly reversible. I have placed a new build at http://www.globalmapper.com/global_mapper10.zip with the change for you to try. Simply download that file and extract the contents into your existing v10.xx installation folder to give it a try.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
global_mapper wrote: »The problem was indeed related to the Transverse Mercator and UTM projections becoming non-reversible quickly as you get more than about 3 degrees from the central meridian (as some of your coordinates are relative to the center of the UTM zone).
I have been able to improve Global Mapper's behavior in the face of projection math that is not perfectly reversible. I have placed a new build at http://www.globalmapper.com/global_mapper10.zip with the change for you to try. Simply download that file and extract the contents into your existing v10.xx installation folder to give it a try.
Great!
I see the files I sent you now work without the gap - however for the large area I process I still see some of these errors - however they are smaller (only 1x5 pixels now). They look perfect in GlobalMapper after applying my custom projection - no gaps or strange artifacts. However after running File - Export - Geotiff I get the 1x5 pixels black in the corner. I have uploaded new example files and the result.tif and error.dxf to your ftp. I have also attached the whole area coverage (area_coverage.dxf) so you can see the size of the import/export area.
I will order one more license of GlobalMapper today for all the good support. -
I have tried your new data, but have been unable to reproduce the sliver with the latest build. Basically I just load your TIF files, change the projection on the Projection tab of the Configuration dialog to the TM/UK72 projection that you specified earlier, then do a 24-bit RGB GeoTIFF export (I've tried both the default resolution and 0.3 meters, as well as exporting the whole thing, cropping to your export area, and cropping to a screen rectangle around the join location). Is there something different that you are doing?
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
global_mapper wrote: »I have tried your new data, but have been unable to reproduce the sliver with the latest build. Basically I just load your TIF files, change the projection on the Projection tab of the Configuration dialog to the TM/UK72 projection that you specified earlier, then do a 24-bit RGB GeoTIFF export (I've tried both the default resolution and 0.3 meters, as well as exporting the whole thing, cropping to your export area, and cropping to a screen rectangle around the join location). Is there something different that you are doing?
I have now spent several more hours with different settings. I have checked that I have installed the newest version of GlobalMapper (10.2.10.0) and tried the export on two different computers with the same settings, making sure that 0,3 pixels, interpolate and anti-alias is turned on. The difference between the example and the "real" export is:
1. I use the MapCatalog - containing far more files.
2. I export to 1200x1200 starting with 152400, 70800 as the top left corner defined in the export.
I have now cropped 2 smal areas from different sides of the area (one small from top left, another from middle right). After export I see that the area in the top left is ok (without the black dot) while the other area is as shown on the attached image
I will convert the 8 images to grayscale, attach the areas and outputfiles and upload to your ftp. Not sure how the transformation works and how you fixed it, but it seems to work ok for some areas. I have tried the following:
1. Original files from a MapCatalog. Export the selected areas with my settings (0.3, 1200x1200, crop to area etc). This will result in the attached "bug" on area in south-east.
2. Convert the original files to grayscale (in input-dir on your ftp). Then add these to a new MapCatalog and export. This will result in the attached "bug" on area in south-east.
3. Only load the converted grayscale pictures (in inputdir on your ftp). Then export. The result is ok on both areas
4. Load the original MapCatalog first, then load the converted files. Only use the converted files for export. The result is ok on both areas.
It seems there is a problem with using MapCatalog. I am guessing that GlobalMapper "computes" some variable for the whole MapCatalog area and that this is ok for some parts while other parts shows error. I will do a final test. Load all original files (NOT using a MapCatalogue) and export as usual. I will notify you of the result here in approx 30 minutes. I hope it will work. -
I am still running the batch - however it seems to get better when not using MapCatalogue - I will continue to check the files and notify if I find any black gaps that were there when using MapCatalogue and are also there now.
-
I am now even further in the processing, have checked more than 10 output-files. All of them have the "black area" when using the MapCatalogue - however when using the files as input they do not have the black area. It seems that the black area is smalles in the north-west area, and that it gets larger when going south-east. This is based on the generating from the MapCatalogue. How does the parameters get calculated? Perhaps when using MapCatalogue they get calculated for the top left of the MapCat and therefore does not "work" on the bottom left, while when importing one and one inputfile it calculates the values every time and then gets a more "correct" value for each export? Just an idea.
-
The map catalog does store the bounding boxes of the files inside of it and the fix for non-reversible projections was not added to where the map catalog calculates the global bounding box. I will add it there and see if that helps.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
I have added the fix for non-reversible projections to the map catalog so your problem should hopefully be fixed now. I have placed a new build at http://www.globalmapper.com/global_mapper10.zip with the change for you to try. Simply download that file and extract the contents into your existing v10.xx installation folder to give it a try.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Just restarted the batch process. After 1-2 hours using files (NOT MapCatalogue) It seems that memoryusage is much higher (1,4GB instead of 700MB when it starts) and its very slow in generating files. I think the memory does not get cleared after each export or something. I started the batch-process again with the MapCatalogue and the first files came without errors, will check in some hours how the files further from the startingpoint will look and let you know - but it seems good for the moment. I know for sure that when using MapCatalogue the memory usage does not increase, it stays at 700MB and the speed stays at superfast even at the last file.
Thanks again, without this excellent support this project would be a pain in the neck. Let me know if I can participate in any testing or other tasks related to GlobalMapper. -
Using map catalogs makes handling large collections of file much more efficient in most cases, which is why map catalogs would be faster. Map catalogs only keep the files that are actually needed at the moment loaded, which allows for much less memory usage and more efficient caching.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 345 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 636 GM Script Language
- 54 User Scripts
- 114 GPS Features
- 417 Projection Questions
- 826 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 178 Announcement and News
- 913 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 569 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 238 How I use Global Mapper
- 107 Global Mapper Forum Website