Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to convert tiles x,y,z to latitude and longitude coordinates within a specified latitude and longitude range #1

Closed
JinDing123 opened this issue Jun 20, 2024 · 0 comments

Comments

@JinDing123
Copy link

Hello, thanks for the code, it helps me a lot, but I have a question now, I want to consult you. How to find the latitude and longitude coordinates of tiles in a given latitude and longitude range.

this is the tile x,y,z info

// tile info
const tile = {
  id: 'Raster_GF2_PMS2_E112.4_N37.9_20170526_L1A0002379381-MSS2-geotiff=WebMercatorQuad_13=051_039=006652_005029.png',
  metadataId: 'GF2_PMS2_E112.4_N37.9_20170526_L1A0002379381-MSS2',
  tileMatrixSet: 'WebMercatorQuad',
  format: 'png',
  tileMatrix: 13,

  tileTotalRow: 5029,
  tileTotalCol: 6652,
};


// This is latitude and longitude information

const metadata = {
  geographicCoordinates: {
    coordinates: [
      {
        lat: 38.0286,
        lon: 112.286,
      },
      {
        lat: 37.976,
        lon: 112.554,
      },
      {
        lat: 37.7691,
        lon: 112.489,
      },
      {
        lat: 37.8216,
        lon: 112.221,
      },
    ],
    shapeType: 'polygon',
    geoCenter: {
      lat: 38,
      lon: 112,
    },
  },
};

// TODO: I want to calculate the latitude and longitude information of the tile based on the x,y, and z of the tile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant