1

I would like to use a GeoTIFF file in a d3-geo project of mine. However, I could not find any example to do such a thing easily, especially regarding changes in map projections in the image.

How would I import and display a GeoTIFF file using a specific map projection in d3-geo?

JoeBe
  • 1,224
  • 3
  • 13
  • 28
  • D3 is more for geographic visualizations as opposed to geoprocessing. So, if you are looking to re-project the image to some different projection, it is best to do that some other way. It certainly can be done - but will be slow in the browser and requires more work than reprojecting in GIS software. If, however, you aren't looking reproject the image, it is possible to align a d3 geoProjection and preprojected imagary. All that needs to be done in this case is to set the right parameters, see this [answer](https://stackoverflow.com/q/41282911/7106086) for an example. – Andrew Reid Feb 20 '20 at 05:49
  • @AndrewReid I cannot get my head around the `fitSize()` for my use case. I have an azimuthal equal-area projected topojson, with a `fitSize([screen.width - margin, screen.height - margin], { type: "FeatureCollection", features: myTopoJSON.features})`. Now I am trying to adjust the size of my image with the same parameters I am using in the `fitSize()` function, even though the location of the image is correct, the size is wrong. I assume it has something to do with the second argument of the `fitSize()` function. – JoeBe Feb 20 '20 at 06:40
  • I think I figured out why... The image is cropped a little bit, which is why it will always be a little bit larger than the topojson map – JoeBe Feb 20 '20 at 06:45

0 Answers0