uDIG
  1. uDIG
  2. UDIG-1767

Add a priority for reading image georeferencing

    Details

      Description

      When loading geotiff uDig needs to check available metadata in both gotiff header and associated .tfw and .prj files before making a decision what readers to assign.

        Activity

        Hide
        Levi Putna added a comment -
        Since we have two readers and we didn't want the layer to be loaded by both, uDig is making a choice on the presence of the tfw file alone. I’m going to have a look into updating this to make a more informed decision on available metadata.

        Will upload patch when finished.
        Show
        Levi Putna added a comment - Since we have two readers and we didn't want the layer to be loaded by both, uDig is making a choice on the presence of the tfw file alone. I’m going to have a look into updating this to make a more informed decision on available metadata. Will upload patch when finished.
        Hide
        Andrea Antonello added a comment -
        I am interested in how you will handle this, since it is years that I ask for the solution of this matter and in the end I had to tech the two involved readers to be strickt. Since they act in a chain of responsability pattern and do not know a thing about each other, I see no way to solve this differently, without breaking encapsulation.

        What do you think?

        Andrea
        Show
        Andrea Antonello added a comment - I am interested in how you will handle this, since it is years that I ask for the solution of this matter and in the end I had to tech the two involved readers to be strickt. Since they act in a chain of responsability pattern and do not know a thing about each other, I see no way to solve this differently, without breaking encapsulation. What do you think? Andrea
        Hide
        Levi Putna added a comment -
        Ok, I'm new to this so bare with me.

        It seems that the ServiceFactory createService() method returns a list of Service that canProcess the current service request, as the Catalogue only needs one service it creates the fist service in the list.

        It seems that if we don’t want to breaking encapsulation the best fix is to update ServiceExtension so that in addition to canProcess also provide a ranking as to how well it can process the particular service.

        The catalogue can then create the service that best handle the request.

        Thoughts?
        Show
        Levi Putna added a comment - Ok, I'm new to this so bare with me. It seems that the ServiceFactory createService() method returns a list of Service that canProcess the current service request, as the Catalogue only needs one service it creates the fist service in the list. It seems that if we don’t want to breaking encapsulation the best fix is to update ServiceExtension so that in addition to canProcess also provide a ranking as to how well it can process the particular service. The catalogue can then create the service that best handle the request. Thoughts?
        Hide
        Levi Putna added a comment - - edited
        After further investigation I have changed my tact slightly.

        What I plan to do is update IGeoResourceInfo adding a getCompleteness() method that returns the completeness of service metadata/info

        Ill update WorldImageInfo and create an GeotiffInfo class that can do some service specific completeness calculations.

        CatalogImpl.acquire() will also need to be updates to return the first service that is complete or if no service is complete the service with the highest completeness.

        In addition AbstractRasterServiceInfo is not actually an Abstract class so I well refactor it to be RasterServiceInfo
        Show
        Levi Putna added a comment - - edited After further investigation I have changed my tact slightly. What I plan to do is update IGeoResourceInfo adding a getCompleteness() method that returns the completeness of service metadata/info Ill update WorldImageInfo and create an GeotiffInfo class that can do some service specific completeness calculations. CatalogImpl.acquire() will also need to be updates to return the first service that is complete or if no service is complete the service with the highest completeness. In addition AbstractRasterServiceInfo is not actually an Abstract class so I well refactor it to be RasterServiceInfo
        Hide
        Levi Putna added a comment -
        This turned out to be much more complicated than expected, Jody jumped in to give me a hand and we got a little distracted organising some logic. We will continue working on this Monday.
        Show
        Levi Putna added a comment - This turned out to be much more complicated than expected, Jody jumped in to give me a hand and we got a little distracted organising some logic. We will continue working on this Monday.
        Hide
        Jody Garnett added a comment -
        Levi is very kind with his description:

        "little distracted"
        What really happened is his fixed worked perfectly! (and was then never called). A little trip through the debugger showed some classes to do with with the import wizards that were doing the work themselves (rather than letting the catalog do it). I have gone through and left a trail of breadcrumbs (well comments in the classes) so we can tell where the code goes.

        "organised some logic"
        I am going to move the classes into the catalog so we can cut down on duplication; giving Levi *one* thing to fix...
        Show
        Jody Garnett added a comment - Levi is very kind with his description: "little distracted" What really happened is his fixed worked perfectly! (and was then never called). A little trip through the debugger showed some classes to do with with the import wizards that were doing the work themselves (rather than letting the catalog do it). I have gone through and left a trail of breadcrumbs (well comments in the classes) so we can tell where the code goes. "organised some logic" I am going to move the classes into the catalog so we can cut down on duplication; giving Levi *one* thing to fix...
        Hide
        Levi Putna added a comment -
        Looks like ill have to modifying the import wizard State to pass the creation of Services functionality to the Catalog.

        Will also need to add a method to CatalogImpl returns a priority list of possible services to create.

        This will then allow the import wizard ask the user to select the service they wish to implement, if there are multiple services that can implement the request equally well.
        Show
        Levi Putna added a comment - Looks like ill have to modifying the import wizard State to pass the creation of Services functionality to the Catalog. Will also need to add a method to CatalogImpl returns a priority list of possible services to create. This will then allow the import wizard ask the user to select the service they wish to implement, if there are multiple services that can implement the request equally well.
        Hide
        Jody Garnett added a comment -
        Aside: This is holding up the live dvd translation effort:

        Hello Jody,

        I got commit rights for the osgeo svn repo to add translated documents for the udig quickstart.
        The current install_udig.sh [1] on trunk would install udig-1.2.0.linux.gtk.x86.zip I guess the version within udig_quickstart.rst [2] should be 1.2 instead of 1.1, would you agree?

        In the next few days I try to test the quickstart and whether the screenshots are still up to date (e.g. splash, I remeber there were some thread entries about logos and icons ...)

        Do you have some additional hints or would recommed to me to go straigth forward and translate the content to German?

        Are there any plans to upgrade to 1.2.x for the live DVD?

        Thanks a lot and cheers to Australia,
        Frank

        [1] : http://j.mp/lugL8h
        [2] : http://j.mp/mmCMCD
        Show
        Jody Garnett added a comment - Aside: This is holding up the live dvd translation effort: Hello Jody, I got commit rights for the osgeo svn repo to add translated documents for the udig quickstart. The current install_udig.sh [1] on trunk would install udig-1.2.0.linux.gtk.x86.zip I guess the version within udig_quickstart.rst [2] should be 1.2 instead of 1.1, would you agree? In the next few days I try to test the quickstart and whether the screenshots are still up to date (e.g. splash, I remeber there were some thread entries about logos and icons ...) Do you have some additional hints or would recommed to me to go straigth forward and translate the content to German? Are there any plans to upgrade to 1.2.x for the live DVD? Thanks a lot and cheers to Australia, Frank [1] : http://j.mp/lugL8h [2] : http://j.mp/mmCMCD
        Hide
        Jody Garnett added a comment - - edited
        Starting with code review with Levi, will update catalog docs as I go.

        Work covered:
        - IServiceInfo.getCompletness() - having trouble with this may call it IServiceInfo.getMetric()
        - creation always used list of URLS (for DnD) or a Map of connection params
        - aquire split into constructServies (which returns a prioritised list) which aquire will add to the catalog if needed
        - constructSerices used directly by EndConnectionState.run to get list of candidate services
        - CatalogImport.performFinish uses the above list; and will need to only add the "new" services; and dispose any that were not used. Catlog.checkMembers and Catalog.checkNonMembers is used to sort out the difference
        - GeoTiffRasterServiceExtension needed to not give up if a world file was present
        - Update AbstractRasterServiceInfo to check the reader to see if the CRS and bounds could be found!

        Review feedback:
        - Updating header to indicate a date range, such as 2004-2011 to mark modified files
        - Updating javadoc header with @version 1.2
        - Moved javadocs into ICatalog and updated http://udig.refractions.net/confluence/display/DEV/2+Catalog
        - checkNonMembers / checkMembers could use a code example (but not today) just making sure the parameters and returns are documented
        - Run FindBugs - while Levi's code was good; we found some thing scary in replace (it was comparing ID equals URL which would always fail)
        Show
        Jody Garnett added a comment - - edited Starting with code review with Levi, will update catalog docs as I go. Work covered: - IServiceInfo.getCompletness() - having trouble with this may call it IServiceInfo.getMetric() - creation always used list of URLS (for DnD) or a Map of connection params - aquire split into constructServies (which returns a prioritised list) which aquire will add to the catalog if needed - constructSerices used directly by EndConnectionState.run to get list of candidate services - CatalogImport.performFinish uses the above list; and will need to only add the "new" services; and dispose any that were not used. Catlog.checkMembers and Catalog.checkNonMembers is used to sort out the difference - GeoTiffRasterServiceExtension needed to not give up if a world file was present - Update AbstractRasterServiceInfo to check the reader to see if the CRS and bounds could be found! Review feedback: - Updating header to indicate a date range, such as 2004-2011 to mark modified files - Updating javadoc header with @version 1.2 - Moved javadocs into ICatalog and updated http://udig.refractions.net/confluence/display/DEV/2+Catalog - checkNonMembers / checkMembers could use a code example (but not today) just making sure the parameters and returns are documented - Run FindBugs - while Levi's code was good; we found some thing scary in replace (it was comparing ID equals URL which would always fail)
        Hide
        Jody Garnett added a comment -
        Renamed getCompleteness to getMetric which was way easier to explain. From the wiki:


        Grabbing a IServiceInfo is the best way to check if you can connect to a service. You will find that the IService.getMetric() provides a good measurement of how well the service will work. It is used to indicate if the service has all the information it needs to function smoothly. If some information is missing, such as a coordinate reference system or index, some prep may be required.
        Show
        Jody Garnett added a comment - Renamed getCompleteness to getMetric which was way easier to explain. From the wiki: Grabbing a IServiceInfo is the best way to check if you can connect to a service. You will find that the IService.getMetric() provides a good measurement of how well the service will work. It is used to indicate if the service has all the information it needs to function smoothly. If some information is missing, such as a coordinate reference system or index, some prep may be required.
        Hide
        Jody Garnett added a comment -
        Asked Levi to commit; will update the picture in the docs next week. Thanks Levi!
        Show
        Jody Garnett added a comment - Asked Levi to commit; will update the picture in the docs next week. Thanks Levi!
        Hide
        Levi Putna added a comment - - edited
        Think I have finished, had a little trouble committing initial patch however a weekend of github research helped.

        I have added a github Pull Request https://github.com/uDig/udig-platform/pull/21 to the uDig project. I hope this is the best way to provide patch?

        Can someone review?
        Show
        Levi Putna added a comment - - edited Think I have finished, had a little trouble committing initial patch however a weekend of github research helped. I have added a github Pull Request https://github.com/uDig/udig-platform/pull/21 to the uDig project. I hope this is the best way to provide patch? Can someone review?
        Hide
        Levi Putna added a comment -
        Ok seems the fix for catalog also needs to be applied to layer import… This should be a simple case of finding the layer import wizard performFinish() and updating it to use the new catalogue method.
        Show
        Levi Putna added a comment - Ok seems the fix for catalog also needs to be applied to layer import… This should be a simple case of finding the layer import wizard performFinish() and updating it to use the new catalogue method.
        Hide
        Levi Putna added a comment -
        The patch has been applied https://github.com/uDig/udig-platform/pull/22, the uDig docks have been updated.

        Think its time to close this ticket.
        Show
        Levi Putna added a comment - The patch has been applied https://github.com/uDig/udig-platform/pull/22, the uDig docks have been updated. Think its time to close this ticket.
        Levi Putna made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s UDIG 1.2.2 [ 15072 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Levi Putna
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: