Skip to main content
Bounty Ended with 50 reputation awarded by nilgun
Added more thoughts.
Source Link
Alex Leith
  • 13.5k
  • 31
  • 69

What you could do is measure the size of your original pixels in your target SRS, and make your target resolution a multiple of those. (You'll need to pick something that works for most of the area, as it will change at high latitudes).

Otherwise, your testing with 8 x 8 sounds like it worked ok, so experiment with compression to get the file size right.

And finally, you could just rely on GeoServer and use GeoWebCache to convert it for you. This will result in something fast, as is what you want to be using anyway in production. So, even if you do optimise your source data, allowing GWC to pre-cache or cache on demand should make it as good as possible.

EDIT:

What's going on here is that your TARGET raster is not going to be aligned with your SOURCE raster. As you note, using a low resolution target means that the error in alignment is small, but it't not perfect. This is a fundamental fact of the two grids you're making, in two quite different coordinate reference systems, and unless you make your grid very small, you'll always have errors. (And unless that small grid lines up perfectly with every cell of the source, it'll still have errors, really, they'll just be small...)

Something to ask is: how accurate is your data. You're mapping at a ~50 m grid, recall, so it's not going to be very accurate, and is certainly not all that precise. A target grid that lines up within maybe 10%, or 5 m, could be acceptable. But that's up to you.

Looking at your images, the 20 m and 30 m grids line up good enough, in my view. It's not a systematic error, i.e., you've got errors in all different directions.

What you could do is measure the size of your original pixels in your target SRS, and make your target resolution a multiple of those. (You'll need to pick something that works for most of the area, as it will change at high latitudes).

Otherwise, your testing with 8 x 8 sounds like it worked ok, so experiment with compression to get the file size right.

And finally, you could just rely on GeoServer and use GeoWebCache to convert it for you. This will result in something fast, as is what you want to be using anyway in production. So, even if you do optimise your source data, allowing GWC to pre-cache or cache on demand should make it as good as possible.

What you could do is measure the size of your original pixels in your target SRS, and make your target resolution a multiple of those. (You'll need to pick something that works for most of the area, as it will change at high latitudes).

Otherwise, your testing with 8 x 8 sounds like it worked ok, so experiment with compression to get the file size right.

And finally, you could just rely on GeoServer and use GeoWebCache to convert it for you. This will result in something fast, as is what you want to be using anyway in production. So, even if you do optimise your source data, allowing GWC to pre-cache or cache on demand should make it as good as possible.

EDIT:

What's going on here is that your TARGET raster is not going to be aligned with your SOURCE raster. As you note, using a low resolution target means that the error in alignment is small, but it't not perfect. This is a fundamental fact of the two grids you're making, in two quite different coordinate reference systems, and unless you make your grid very small, you'll always have errors. (And unless that small grid lines up perfectly with every cell of the source, it'll still have errors, really, they'll just be small...)

Something to ask is: how accurate is your data. You're mapping at a ~50 m grid, recall, so it's not going to be very accurate, and is certainly not all that precise. A target grid that lines up within maybe 10%, or 5 m, could be acceptable. But that's up to you.

Looking at your images, the 20 m and 30 m grids line up good enough, in my view. It's not a systematic error, i.e., you've got errors in all different directions.

Source Link
Alex Leith
  • 13.5k
  • 31
  • 69

What you could do is measure the size of your original pixels in your target SRS, and make your target resolution a multiple of those. (You'll need to pick something that works for most of the area, as it will change at high latitudes).

Otherwise, your testing with 8 x 8 sounds like it worked ok, so experiment with compression to get the file size right.

And finally, you could just rely on GeoServer and use GeoWebCache to convert it for you. This will result in something fast, as is what you want to be using anyway in production. So, even if you do optimise your source data, allowing GWC to pre-cache or cache on demand should make it as good as possible.