Search code examples
pythonimage-processingdigitization

Digitize map using .png image and draw a circle with known lat./long. as center by inputing radius value in python


I have a .png map image which contains location of handpumps in given village. there are 70 location value.I want to do following in python (had already done similar thing in matlab previously) -

  1. digitize .png image of map(had already done similar thing in matlab previously) but need to do in python now.
  2. draw a circle with transparent color with given lat./long. point as center and radius given by me.

Any help will be highly appreciated. just started doing this, so will keep on updating this post as i search and find solution. thanks.


Solution

  • done with help of converting simialr R code...

    def bubbles(lat,long,re,colvar,wellnum,txt):
       
        s=list(map(lambda x: x *1.2, re))
    
        fig, ax = plt.subplots()
        lc=plt.scatter(lat, long, s,c=colvar,cmap="coolwarm", alpha=0.8, edgecolors="grey", linewidth=2)
    # Add titles (main and on axis)
        for i in range(0,len(wellnum)):
            plt.text(lat[i],long[i],' {1}ft\n{0}\n{2}R2'.format(wellnum[i],re[i],str(round(txt[i],2))))
        plt.xlabel("LAT")
        plt.ylabel("LONG")
        plt.title("B")
        axcb = fig.colorbar(lc)
        axcb.set_label('Pe')
        
        plt.show()
        return fig