I want to geocode a set of addresses with GoogleMaps, store the results in a different SRID in a PostGIS table and then project it in QGIS over a layer with the identical SRID. So far, it has been a complete mess since I succeed in geocoding but can't change the SRID so I can't have overlapping layers.
I break the process in steps:
- Geocode addresses
- Add column mygeometry with a different SRID (2100) than the geocoder's usual (GoogleMaps' Mercator) and store it all at my PostGIS table as tableA
- Open QGIS, add layers from tableA and tableB (which is a map of the country).
Here's the Python code for geocoding and storing (I note that mygeometry column has already been created as a geometry(MultiPoint,2100) column:
from geopy import geocoders g = geocoders.GoogleV3() for i in range (1,tableAlength): location, (latitude, longitude) = g.geocode(tableA.ix[i]) if location: mygeometry ='SRID=2100;MULTIPOINT(%r %r)' % (longitude, latitude) mystring=("UPDATE tableA SET latitude=" +str(latitude) +" WHERE tableA_id='"+str(i)+"';") db.alters(mystring) mystring=("UPDATE tableA SET longitude=" +str(longitude) +" WHERE tableA_id='"+str(i)+"';") db.alters(mystring) mystring=("UPDATE tableA SET mygeometry='" +str(mygeometry)+"' WHERE tableA_id='"+str(i)+"';") db.alters(mystring) i=i+1 else: i=i+1
I have tried it also with Nominatim and no success. The question is why it does not store my points in the new SRID.