Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8132571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:22:55+00:00 2026-06-06T09:22:55+00:00

I get geoTiff metadata with GeoTiffIIOMetadataAdapter class: String filename = pathToMyTiffFile; FileImageInputStream f =

  • 0

I get geoTiff metadata with GeoTiffIIOMetadataAdapter class:

    String filename = pathToMyTiffFile;
    FileImageInputStream f = new FileImageInputStream(
            new RandomAccessFile(filename, "r"));

    // Look through ImageIO readers
    Iterator iter = ImageIO.getImageReaders(f);
    IIOMetadata imdata = null;
    GeoTiffIIOMetadataAdapter geo_data;
    while (iter.hasNext() && imdata == null) {
        ImageReader reader = (ImageReader) iter.next();
        reader.setInput(f, true);
        String reader_name = reader.getFormatName().toLowerCase();
        if (reader_name.equalsIgnoreCase("tif")) {
            // Get Image metadata
            imdata = reader.getImageMetadata(0);
            geo_data = new GeoTiffIIOMetadataAdapter(imdata);
            if (geo_data != null &&
                    geo_data.getGeoKeyDirectoryVersion() == 1) {
                geo_data.getModelTiePoints(); //here i get [0.0,0.0,0.0,173084.9999999999,5845515.0,0.0]
            }
        }
    }

How can I extract/convert this array to the usual latitude/longitude coordinates? Am I right that 173084.9999999999,5845515.0 is the coordinates of upper-left point of the tiff file?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:22:56+00:00Added an answer on June 6, 2026 at 9:22 am

    The answer is: yes, it is left-upper point of my tiff file. My Tiff is in http://spatialreference.org/ref/epsg/32612/.
    To convert coordinates to wsg84( http://spatialreference.org/ref/epsg/4326/ ) with geotools I needed:

        CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326", true);
        CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:32612");
        MathTransform transformToEpsg4326 = CRS.findMathTransform(targetCRS, sourceCRS);
        double lon = geo_data.getModelTiePoints()[3];// 175784.99999999997 - X
        double lat = geo_data.getModelTiePoints()[4];// 5842215.0   - Y
        GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 32612);
        Geometry pointUpperLeft = geometryFactory.createPoint(new Coordinate(lon, lat));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Get class from div inside an li and add to the same li. The
I get FIX message string (ASCII) as ByteBuffer. I parse tag value pairs and
Get object 's array value in php $obj = new Basecamp($bcUrl, $bcApikey, 'X', 'simplexml');
'get list of all users on domain Dim de As New DirectoryEntry() de.Path =
Get value out of DateTime column if null to return String.Empty else DateTime.ToShortDateString What
(Get-WmiObject -Class Win32_Product -ComputerName $PCNumber -ErrorAction SilentlyContinue | Where-Object { $_.Name -match $softwareName }).Uninstall()
I am trying to analyze a geotiff file, very simple, just trying to get
Get 'n' random string from a Arraylist of string. Where n= number of string
//get current date SimpleDateFormat monthFormat = new SimpleDateFormat(M); int _currentMonth = Integer.parseInt(monthFormat.format(new Date(System.currentTimeMillis()))); SimpleDateFormat
//Get width and resize another element $(document).ready(function() { function ResizeSearch(GridID, SearchID) { var eleWidth

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.