I'm trying to convert coordinates from latitude/longitude into pixel but I lose points in this process.
The code that I'm using is the following:
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
df=pd.read_csv('cords.csv')
cords=df.as_matrix(columns=['x','y'])
gt=[7.6445503225, 5.4065168747250134e-06, 0.0, 45.07436634583334, 0.0, -5.406516856707135e-06]
index=np.zeros(cords.shape)
index[:,1]=((cords[:,1] - gt[3]) / gt[5]).round()
index[:,0]=((cords[:,0] - gt[0]) / gt[1]).round()
index=index.astype(int)
index[:,0]=index[:,0]-min(index[:,0])+1
index[:,1]=index[:,1]-min(index[:,1])+1
row=max(index[:,1])
col=max(index[:,0])
image=np.zeros([row+1,col+1])
for i in range(0,len(index)):
image[index[i,1],index[i,0]]=255
If I plot the coordinates or the index points I get this:

If I plot the image I get this:

As you can see, there are some points that are missing in translating lat/lon into pixel numbers. Yellow is 255 value and purple is 0 value. How can this be solved?
Here you find the coordinates that I'm using cords.csv
Here you find the coordinates with the values that need to be set to each pixel. cords_valus.csv

gtdoing? - Willem Van Onsem