Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. dist = lineStr.project(refPt)
  2.  
  3. np = lineStr.interpolate(dist) # using shapely
  4.  
  5. SELECT AsText(ClosestPoint(GeomFromText('LINESTRING(0 0, 0 4)') , GeomFromText('POINT(2 2)') ))
  6.  
  7. POINT(0 2)
  8.  
  9. from pyspatialite import dbapi2
  10. conn = dbapi2.connect('path_to_your_database/db.sqlite')
  11. cur = conn.cursor()
  12. qry = "SELECT AsText(ClosestPoint(GeomFromText('LINESTRING(0 0, 0 4)'), GeomFromText('POINT(2 2)') ))"
  13. cur.execute(qry)
  14. cur.fetchone()[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement