[PYTHON] .gdb import - spatial envelope settings not working

1754
15
Jump to solution
05-24-2017 07:47 AM
MarekDekys
New Contributor III

Hi,

I'm trying to import .gdb (file geodatabase) file using python

while everything works fine, I'm having trouble defining custom envelope for my import to crop an area out from big .gdb file:

no matter what I put into [] it always loads all 490 objects:

setImportQueryAndEnvelope("OBJECTID < 491", [7157.656, 4162.500,274845.500,5143901.000] ,"NORTH_WEST")

but I'm not sure if the syntax is correct because manual suggests: 

@param env: The spatial envelope with syntax (xMin, xMax, yMin, yMax). (default = None). [sequence of float]

while in dialog there are options for width, height and X-Offset and Y-Offset

I tried the documentation's syntax to achieve 1x1 km crop using  :

[7157.656, 7257.656, 4162.500, 4262.500]

(the 2nd and 4th values are just incremented by 1000 - to correspond with manual's syntax of xMin, xMax, yMin, yMax ) but the output is always the same..

I also tried to put all zeros in dialog window and it correctly loaded 0 objects

but when I try the same thing in code using [0,0,0,0] it still loads all 490 objects and it should load 0 objects instead

any help appreciated. 

thanks,

Mark

0 Kudos
15 Replies
ThomasFuchs
Esri Regular Contributor

Thank you for reporting this issue. I can reproduce it and need to work with a developer on this.
At this time it is unclear if it can be resolved by changing the command alone. I'll keep you posted.

ThomasFuchs
Esri Regular Contributor

Update:
Sadly, I have to confirm that there is a bug in the spacial envelope. Any entered values are not set. The development team is working on a fix.
At this point only the SQL queries can be used.

DavidWasserman
Occasional Contributor III

Hi Thomas, 

Thanks for confirming that this is a bug. It sounds like a SQL fish net is the only alternative. The only other alternatives is can think of is using OSGEO command line to potentially process the data before hand or transform it into a shapefile for editing in Global Mapper (which also is an imperfect process). 
Marek if you can't do a GIS fix, your alternative might be the best approach. Thanks for reporting this. 
David

David Wasserman, AICP
MarekDekys
New Contributor III

Thanks all,

that's bad news that this is a bug,  I will have to recreate spatial envelope in python in CE then. And doing that I found another issue -> https://community.esri.com/message/690436-no-more-handles-swt-error-while-batch-processing-gdb-in-py... 

do you have any estimation when it will be fixed? 

thanks,

Mark

0 Kudos
ThomasFuchs
Esri Regular Contributor

Good News! The issue has been resolved in CityEngine 2017.1

This version is scheduled to be released in November.

0 Kudos
DavidWasserman
Occasional Contributor III

Great news Thomas!

David Wasserman, AICP
0 Kudos