私は2つの線ストリングLine1、Line2を持っています。PostGISのST_DWithinの代わりにpythonで整形式
line1 = "LINESTRING(72.863221 18.782499,72.863736 18.770147,72.882275 18.756169,72.881417 18.750805,72.878842 18.736987,72.874379 18.709512,72.860989 18.679593,72.864422 18.653897)"
line2 = "LINESTRING(72.883133 18.780793,72.882103 18.760314,72.862534 18.716422,72.860474 18.683577)"
次のPOSTGISのクエリを整形して実行しようとしています。今のところ私はST_DWithinコマンドの代替を見つけることができませんでした。
road2 = "ST_GeographyFromText('SRID=4326;%s')"%line1
road4 = "ST_GeographyFromText('SRID=4326;%s')"%line2
cur.execute("SELECT ST_AsText(road1) from %s as road1,%s as road2
where ST_DWithin(road1,road2,500)"%(road2,road4))
res = cur.fetchall()
print res
誰でもST_DWithinの何が魅力的であるか知っていますか?