in the below posted code, i want to find the SRID of a geometry. i pass the geometry as a parameter.
the problem is when i run the code, i receive :
psycopg2.errors.SyntaxError: FEHLER: Syntaxfehler bei »{«
LINE 3: Find_SRID({'coordinates': [[[747588.406469401...
^
as an attempt to fix it, i enclosed the geometry parameter between single qoutes as follows:
ST_GeomFromJSON('{geometry}') As geomertySRID
but then i receive the following error:
psycopg2.errors.SyntaxError: FEHLER: Syntaxfehler bei »coordinates«
LINE 3: Find_SRID('{'coordinates': [[[747588.40646940...
^
please let me know how to fix this error
code:
def executeForFindSRID(self,geometry):
print(geometry)
query="""
SELECT
ST_GeomFromGeoJSON({geometry}) As geomertySRID
""".format(geometry=geometry)
data = self.connection.query(query,[])
# print(data)
return data
geometry
here is the geometry i would like to find its SRID`
DEBUG:root:responseParameters['treatmentAsJSONInEPSG25832']: {'coordinates': [[[747588.4064694013, 6643569.636689969], [747597.3898909885, 6643584.395168291], [747581.3480667257, 6643607.880399012], [747574.9313370206, 6643609.292079547], [747563.5095581454, 6643597.870300672], [747556.9644938463, 6643584.780172074], [747562.6112159868, 6643575.668415893], [747577.2413597145, 6643570.278362939], [747588.4064694013, 6643569.636689969]]], 'type': 'Polygon'}
{'coordinates': [[[747588.4064694013, 6643569.636689969], [747597.3898909885, 6643584.395168291], [747581.3480667257, 6643607.880399012], [747574.9313370206, 6643609.292079547], [747563.5095581454, 6643597.870300672], [747556.9644938463, 6643584.780172074], [747562.6112159868, 6643575.668415893], [747577.2413597145, 6643570.278362939], [747588.4064694013, 6643569.636689969]]], 'type': 'Polygon'}