2

I have a folder of multiple png images of the same map. The map is on country level and consists of administrative polygons. I have the geojson for this and I want to georeference programmatically, with Python, all of these images to the geojson and then get the color value for each polygon. An example of the images is this: enter image description here

and the geojson for this map is available here. I have read about overlay with rasterio but it seems too complicated to rasterize my polygons and back and forth. I also read about georeferencing the polygon corners but this still is about png over tiff file. Any ideas on how to approach this?

lios
  • 218
  • 5
  • 26
  • Are all of your images [choropleth maps](https://en.wikipedia.org/wiki/Choropleth_map)? And you want to basically extract the original data from them by figuring out the color of each? Your sample image lacks georeferencing info (according to `gdalinfo`). So you'll need to estimate a mapping from pixel space to your geojson's coordinate space (which appears to be [UTM](https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system)) of some type. Finally, assign each pixel a polygon and average over the colors (mode or media would prob be best). – webelo Jun 09 '22 at 01:31
  • You are correct in your reasoning – lios Jun 09 '22 at 10:07
  • I think you should a.) [stating the obvious] really search hard to ensure that the original data isn't available somewhere else, then b.) try to work it out yourself then post your [possibly incomplete] code to this question as a starting point. This is more of a "help" site but the answer to your question will probably be very specific to your data/images. If you work for a company you should hire someone to work this out. If you don't, you should find colleagues to collaborate with. If you're non-corporate, DM me and we can work this out together and post a soln. – webelo Jun 10 '22 at 22:54

0 Answers0