Urban-Analytics / RAMP-UA

https://urban-analytics.github.io/RAMP-UA/
MIT License
15 stars 10 forks source link

Eco twins #286

Closed manluow closed 3 years ago

manluow commented 3 years ago

automatic generate coordinates.

def upload_locations(self, locations):  #  50.7184, lon=-3.5339
    """Reprojects the lat lons around the provided one and uploads them to OpenGL.

    Args:
        locations: A numpy array of 2 * nplaces float32 lat/lons.
        lat: The latitude to transform the coordinates around.
        lon: The longitude to transform the coordinates around.
    """
    #non_zero = np.count_nonzero(locations)
    #print (non_zero)
    new_arr_no_0 = locations[np.where(locations!=0)]
    print (new_arr_no_0)
    a = np.sort(new_arr_no_0)
    step = np.multiply(0.5, a.size)
    print (step)
    step = step.astype(int)
    b = np.mean(a.reshape(-1, step), axis=1)
    print (b)
    lat = b[1]
    lon = b[0]
    #a = np.average(locations, 1)
    #print (a)
    #a = np.sort(locations)
    #result = np.mean(a.reshape(-1, 421542), axis=1)
    #lon = result[0]
    #lat = result[1]

    #lat = np.max(locations)
    #lon = np.min(locations)

    glBindBuffer(GL_ARRAY_BUFFER, self.locations_vbo)
    glBufferSubData(GL_ARRAY_BUFFER, 0, 2*4*self.nplaces, latlon_to_km(locations, lat, lon))
Sparrow0hawk commented 3 years ago

Hi @manluow, sorry i've only just seen this PR.

This is looking to merge the EcoTwins branch into master which is something we've agreed not to do whilst we try and migrate EcoTwins into it's own repository.

If the automatic coordinates function is something you've written for the EcoTwins branch i'd encourage you to submit a pull request from a branch where you've made that change into the EcoTwins branch.

In the meantime i'll close this.

ciupava commented 3 years ago

Hi @Sparrow0hawk, @manluow opened this with me once, with the intent to share her part of the code, which I have eventually embedded in the main code.So that should be definitely be solved.