Hi @EmilyWindahl , any update on the release date for this?
FYI for others I've got it working in 2.9 by just replacing all the 'import gdal' with 'from osgeo import gdal' in the python scripts in :
- Oriented Imagery\GPTool\ManageOrientedImagery.pyt (line 39)
- Oriented Imagery\GPTool\orientedimagerytools.py (line 40)
- Oriented Imagery\Types\FeatureServiceWithAttachments.py (line 27)
Two other issues I've had with getting a FeatureServiceWithAttachments with resolution as below (not sure where to report this?)
1. Edge case bug if records have null geometry, then the script fails with a 'NoneType is not subscriptable' error. This is because it is fetching and trying to parse the null geometry. To 'fix', I just put a lazy try/catch around the attachment loop in def getImageListFromFeatureLayerURL in FeatureServiceWithAttachments.py, but I guess should really be logged and parsed and returned to user.
for attachment in attachments:
try:
attachmentURL = attachment['DOWNLOAD_URL']
if '?token' in attachmentURL:
attachmentURL = attachmentURL.split('?token')[0]
pointGeometry = [
f.geometry for f in features if f.attributes['OBJECTID'] == attachment['PARENTOBJECTID']][0]
imageList.append({"point": {'x': pointGeometry['x'], 'y': pointGeometry['y'], 'srs': featureSet.spatial_reference.get(
'wkid')}, "imageURL": attachmentURL})
except:
pass
And secondly, in the same script, the def getExitData that uses the gdal.Info function with vsicurl fails.
return gdal.Info('/vsicurl/{}'.format(imageURL), allMetadata=True, format='json'
I haven't had time to understand true root cause, but it seems vsicurl is broken on the version of GDAL packaged with OptimizeRasters (tried on 3 machines). I replaced the GDAL libraries with the latest available and it now works as expected.