|
POST
|
Go ahead and mark Randy .'s response as the answer. He responded first and identified the issue, I just elaborated on it.
... View more
05-15-2015
12:25 PM
|
0
|
0
|
3806
|
|
POST
|
Unfortunately, I can't seem to find the documentation I want to reference right now, so I will have to get by with some examples. https://community.esri.com/migrated-users/4406
is on the right track, especially about the filter problem not being related to what you are, or aren't, seeing in SSMS. The Shape.STArea() and Shape.STLength() aren't missing in SSMS because they are a derived field in ArcGIS Desktop. The Feature classes in a geodatabase in SQL Server documentation doesn't explicitly state this; unfortunately, but it does imply it by not showing STArea() or STLength() on the diagram of geometry storage in SQL Server. Additionally, the names of those fields gives a hint they are derived because the TSQL syntax for generating the area of a geometry is geometry.STArea() . If you used SDEBINARY instead of GEOMETRY for storage, you would notice the names of the fields change to Shape.area and Shape.len because "area" and "len" are columns in the feature table (F<layer_id>) for storing geometric shapes in binary. If you have an unversioned feature class, you can emulate in SSMS the table structure you see in ArcGIS Desktop fairly easily. The top window is the SQL to emulate the table in the bottom window, and the middle and bottom windows show the values. Something similar could be done with versioned data, but you would have to build off of a versioned view (_evw) instead of the base table.
... View more
05-14-2015
07:43 PM
|
2
|
2
|
3806
|
|
POST
|
There are a couple tools, or more, in the Layers and Table Views toolset that should work for you: Make Query Table, Make Query Layer. These tools will create virtual key fields, i.e., ESRI_OID, for you.
... View more
05-14-2015
01:08 PM
|
0
|
1
|
2779
|
|
BLOG
|
This is the first in a two-part series on the risks to software users of poor documentation; specifically, the confusion and unexpected results that come from weakly documented spatial operators in GIS software. The first part in the series looks at how inconsistent and incomplete documentation requires users to guess how spatial operators are implemented. The second part in the series looks at the inconsistent results that arise from mixing different implementations of spatial operators. Nine months since my last blog post, I can't say that was the pace I was aiming for when GeoNet got stood up (at least I don't give more weight to GeoNet resolutions than I do New Year's ones). I don't know if my drought is busted, but a raw nerve has been hit hard enough by Esri to make it rain, at least for the moment. Of all the soapboxes that litter my closets, poor documentation and its consequences is one of the most tattered. As much as Honest Abe says you can't trust everything you read on the internet, I do think software users should be able to trust a company's online help/documentation. One cannot spend too much time in the world of spatial relations without coming across the Dimensionally Extended 9 Intersection Model (DE-9IM). The DE-9IM was developed by Clementini and others in the mid-'90s as an evolution of the 4 Intersection Model (4IM) and 9 Intersection Model (9IM). Although the DE-9IM isn't the only definition of spatial relationships, it became the prevailing 2D definition after inclusion in the OpenGIS Implementation Specification for Geographic information - Simple feature access - Part 1: Common architecture. References to and discussions of DE-9IM used to be found in various Esri documentation, but those references and documentation are becoming harder to find in current ArcGIS documentation. For example, between the new 10.3 ArcGIS for Desktop, ArcGIS for Server, and ArcGIS for Developers sites, Clementini is only referenced on a couple handful of pages and DE-9IM is only referenced and discussed on one page: Relational functions for ST_Geometry. Whereas Python has a we're-all-grown-ups philosophy, Esri seems to be going the other direction and feeding us Pablum, without the vitamin fortification. Although DE-9IM is the basis for 2D spatial predicates/relations in many geometry libraries and geospatial applications, there are two overlay types for the Select Layer By Location tool where Esri's default implementation differs from Clementini: Contains, Within. In both cases, the default or unqualified overlay type implies Esri's definition (blue underline) while the Clementini definition (red underline) is handled through qualifiers. So how does the Esri definition of Contains and Within differ from the Clementini definition? Forgoing mathematical notation and illustration matrices, the difference boils down to how boundaries of geometries are handled. For example, geometry a that is entirely on the boundary of geometry b is considered within geometry b using Esri's definition but not within geometry b using Clementini's definition. Let's create simple polygon and line features to demonstrate: >>> polygon = arcpy.FromWKT('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))')
>>> line = arcpy.FromWKT('LINESTRING(1 0, 2 0)')
>>> arcpy.CopyFeatures_management(polygon, 'in_memory/polygon')
<Result 'in_memory\\polygon'>
>>> arcpy.CopyFeatures_management(line, 'in_memory/line')
<Result 'in_memory\\line'> Executing the Select Layer By Location tool using both definitions of Within: >>> arcpy.SelectLayerByLocation_management("line", "WITHIN", "polygon")
<Result 'line'>
>>> arcpy.GetCount_management("line")
<Result '1'>
>>> arcpy.SelectLayerByLocation_management("line", "WITHIN_CLEMENTINI", "polygon")
<Result 'line'>
>>> arcpy.GetCount_management("line")
<Result '0'> So far, so good. Beyond the fact that Esri's default definitions of Contains and Within differ from most other geometry libraries and geospatial applications, including the OGC simple feature standards, at least the results match the sparse documentation available online. At this point, it is really important to point out something that is easily overlooked. Esri's ST_Geometry functions are compliant with the OGC simple feature access and SQL standards, which means ST_Within adheres to the Clementini definition and not the Esri definition. SQL> SELECT sde.st_within(sde.st_geomfromtext('LINESTRING(1 0, 2 0)', 0),
2 sde.st_geomfromtext('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))', 0))
3 FROM dual;
SDE.ST_WITHIN(SDE.ST_GEOMFROMTEXT('LINESTRING(10,20)',0),SDE.ST_GEOMFROMTEXT('PO
--------------------------------------------------------------------------------
0 Up until this point, I would argue the Esri documentation pertaining to spatial relations has been weak because it relies heavily on inference. The attentive user might notice there are multiple Within overlay types in the drop-down box for the Select Layer By Location tool, and the inquisitive user might go one step further to read about overlay types to understand the differences between them. The really attentive and knowledgeable user might understand that a single line in the What is the ST_Geometry storage type? documentation stating ST_Geometry implements the SQL 3 specification means the ST_Within function adheres to Clementini's definition instead of Esri's from the Select Layer By Location tool. In short, there is no documentation that explicitly acknowledges there are different definitions of certain spatial relations within various parts of Esri's own software. Confused yet? Just wait, the fun really starts when we dive into the ArcPy Geometry Classes because the documentation goes from weak to really weak. The only references to OGC in the ArcPy Geometry Classes documentation are for the WKB and WKT properties, and there are no references to DE-9IM or Clementini. Let's take a look at the documentation for the within method: So, the geometry is within another geometry if it is within that geometry. Got it. Oh wait, are they asking me whether a geometry is within another geometry? Although none of the illustrations captures a situation that differentiates the Esri and Clementini definitions, the lack of any reference to OGC, DE-9IM, or Clementini makes one think it is Esri's definition being used. Let's check: >>> line.within(polygon)
False Ouch, that smarts. It is pretty clear there is a lack of consistency with how certain spatial operators are implemented in various parts of Esri's software, but the worst part is the documentation doesn't even point it out. Users are left to infer, and likely incorrectly at times, how the software works instead of being informed about how it works. Caveat utilitor.
... View more
05-14-2015
09:07 AM
|
5
|
3
|
11382
|
|
POST
|
I just tried my original SQL against your sample dataset, and it worked with a definition query. So, it appears the functionality is there, now it is a question of why it isn't working for you. Are you getting an error message or simply unexpected results? I do notice you are missing a left bracket on the t2.[FID...] in the last statement of the where clause.
... View more
05-14-2015
09:03 AM
|
0
|
1
|
3042
|
|
POST
|
After a quick check, I am guessing it is Line 53 of your code snippet that is throwing the error. I guess my first question is whether you want to rely on implicit type conversion? Python doesn't natively support implicit type conversion, and the Zen of Python states "explicit is better than implicit." Even though NumPy's array constructor supports implicit type conversion, I would argue relying on it is not very Pythonic. What are you trying to achieve with Lines 32 & 33? If you explicitly convert strings to numbers and empty strings to None, I think the code will stop throwing errors at Line 53.
... View more
05-13-2015
11:14 AM
|
0
|
0
|
4212
|
|
POST
|
Can you paste the specific error message, the actual text returned? It would be helpful to know what function or method is actually raising the error.
... View more
05-13-2015
08:53 AM
|
0
|
0
|
4212
|
|
POST
|
Not sure about your 3rd point, but for the first two check out Pop-ups and the Attribute pane (Work with selected features). I think most of the identify functionality people are used to in ArcGIS Desktop exists in ArcGIS Pro, they just changed the terminology, tools, and workflow a bit. I am not saying the new way is perfect, but I think the logic of it will start to make more sense as you work with it.
... View more
05-12-2015
07:41 AM
|
1
|
11
|
14497
|
|
POST
|
The "SHAPE@XY" token doesn't return an ArcPy Point object, it returns "a tuple of the feature's centroid x,y coordinates." Line 15 of your code replaces a Python tuple with an ArcPy Point object, which is what I am guessing is causing the error on Line 16. Does the code work if you update Line 15 to: row[0] = (306400, 4098400)
... View more
05-11-2015
08:11 PM
|
1
|
1
|
4923
|
|
POST
|
You didn't catch it because documenting important functionality like that on a third-party blogging platform is, well, poor taste. It would be nice and a bit more enterprise-y if the ArcGIS Python development team did more blogging within an Esri domain, say GeoNet maybe.
... View more
05-11-2015
07:54 PM
|
0
|
0
|
4035
|
|
POST
|
Opening a Support case to get a bug logged can be helpful, but it can also just be an act of catharsis. Unless Development has already logged a similar bug in their system, history tells me not to expect a quick fix.
... View more
05-11-2015
07:47 PM
|
0
|
0
|
791
|
|
POST
|
I think your code snippet pretty clearly shows there is a bug, but good luck getting Esri to fix it. I don't mean to come off as cynical, but I have opened so many bugs with Esri over the years that I know luck and happenstance both play a strong role in what eventually gets addressed. Soapbox aside, you should be able to workaround this bug by inserting the following line before line 14 of your code snippet: arcpy.MakeRasterLayer_management(NewRaster, 'NewRaster')
... View more
05-11-2015
07:39 PM
|
0
|
1
|
2725
|
|
POST
|
No problem. Whether my response or someone else's, please close out your questions by marking a "Correct" answer when you no longer have an issue.
... View more
05-11-2015
09:52 AM
|
1
|
0
|
1972
|
|
POST
|
Couldn't agree more. A robust geometry library and implementation should be seen as the foundation of a Geographic Information System, not as some bin item or nice-to-have. Esri's lack of and inconsistency with supporting empty geometries is another case in point. I opened five or more bugs in the past two weeks on this topic, and I am not battling Esri to justify cleaning up the inconsistencies and adding better support. The Romans did just fine without a zero, right? Now where is my abacus.
... View more
05-11-2015
08:14 AM
|
2
|
4
|
2032
|
|
POST
|
Beyond the ArcPy Mapping module (arcpy.mp), which had to get updated quite a bit because of how different the ArcGIS Pro UI is compared to ArcGIS Desktop, it is disappointing all of the other modules and base classes have been updated and cleaned up so little. Esri took the release of ArcGIS Pro, a brand new application, to migrate ArcPy to Python 3.x, but I would have liked to see the migration to Python 3.x include cleaning up some of the detritus. For example, why keep the iterator.next() methods around with the cursors in ArcGIS Pro, especially the arcpy.da cursors? PEP 3114 was accepted back in 2007 as an acknowledgement that calling for the next item of an iterator in Python 2.x was/is not consistent with how other magic/dunder methods are handled in the language. Esri did add dunder next methods in ArcGIS Pro because they had to or none of the cursors would work, but they didn't drop the explicit next method. Some might say including the explicit next method allows for a smoother transition from ArcGIS Desktop and Python 2.x to ArcGIS Pro and Python 3.x, but that argument is rather facile. The major overhaul to ArcPy Mapping already broke the smooth transition argument, and keeping an explicit next method with the cursors just promotes poor Python programming, especially for those unfortunate souls who decide to learn Python through ArcPy.
... View more
05-10-2015
07:39 PM
|
1
|
0
|
2032
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | a week ago | |
| 1 | a week ago | |
| 2 | 06-05-2026 10:30 AM | |
| 1 | 05-29-2026 08:22 AM | |
| 1 | 06-02-2026 06:16 AM |
| Online Status |
Online
|
| Date Last Visited |
4 hours ago
|