From 9a93d505bbe3c7725748775d2676fb26a74998b0 Mon Sep 17 00:00:00 2001 From: Michael Kalbermatten Date: Fri, 29 May 2015 08:13:27 +0200 Subject: [PATCH] Migrate to GeoAlchemy 2 --- las_extractor/util/point_cloud_profiler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/las_extractor/util/point_cloud_profiler.py b/las_extractor/util/point_cloud_profiler.py index 24a81e6..13d38ca 100644 --- a/las_extractor/util/point_cloud_profiler.py +++ b/las_extractor/util/point_cloud_profiler.py @@ -17,7 +17,7 @@ osgeo_loaded = False import simplekml -from geoalchemy import WKTSpatialElement, WKBSpatialElement +from geoalchemy2 import WKTElement from las_extractor.models import DBSession, LidarTileIndex # Get the las file tiles intersected by the buffered profile's line @@ -28,8 +28,8 @@ def generate_tile_list(line, bufferSizeMeter, outputDir, fileList, dataDir): tileList = [] # Intersect the buffer with the tile index - wktsPolygon = WKTSpatialElement(str(polygon), 21781) - intersectResult = DBSession.query(LidarTileIndex).filter(LidarTileIndex.geom.intersects(wktsPolygon)).all() + wktsPolygon = WKTElement(str(polygon), 21781) + intersectResult = DBSession.query(LidarTileIndex).filter(LidarTileIndex.geom.ST_Intersects(wktsPolygon)).all() # Read the query result and store the path to tiles files into ascii file checkEmpty = 0