|
POST
|
That route sent me to ESRI Canada, who would have to process it and forward it on to ESRI Redlands. I have never been able to file a bug report without the "magic" customer numbers which are housed within technical support somewhere within our university. There has got to be a simpler solution to get to Redlands without the corporate/country travel stuff. I have to unfortunately had to rely on "insiders" grace for a number of years. As suggested, perhaps, MVP/Frequent Contributors/Pests be given a "Go Away" number to report bugs, particularly when they are more important that a color palette discrepencies and the like. Pardon my frustration, but as you can see, the important issue being brought forward within this thread has been relegated to a lower status than that of how to report bugs. Should you wish to contact me directly, I would appreciate it, in the interim, can the major issue here please be addressed Regards
... View more
08-05-2010
03:17 PM
|
0
|
0
|
3591
|
|
POST
|
I would test by creating 2 known shapes and see if the test passes or fails. Recently http://forums.arcgis.com/threads/9763-Errors-in-arcpy-s-Polygon-class several issues have been raised about the arcpy polygon and polyline class accuracies which affect the extent of features as well as other parameters. To test create two adjacent shapes see if they intersect, offset them by a finite epsilon amount and see if the test fails.
... View more
08-05-2010
02:40 PM
|
0
|
0
|
3641
|
|
POST
|
I have reported this indirectly through Jim Barry since faculty for our site license, don't have the "magic numbers" to report bugs and I can't find any generic "bug report" site that allows users (and not administrators) to post bugs....perhaps Jim could add MVP's and frequent contributors etc to post bugs, or provide sites without a "magic number" to report bugs. Perhaps putting a "bug" icon on the forum threads could serve as a direct link to notify the correct group, in this case, Geoprocessing. And on an aside, it would be inappropriate for any of these metrics to apply to geographic coordinates, which is even more disturbing. I will investigate other issues further and try the long slog through the official channels if no one here picks up on this...but lecture and manual notes can't wait until SP1 arrives, I am probably going to have to demonstrate the principles outside of the arcpy environment.
... View more
08-05-2010
12:47 PM
|
0
|
0
|
3591
|
|
POST
|
Yes it gets worse, even a two point line's properties can't be determined properly whether they are along the X or Y axis relative to the 0,0 origin...another example script and its output follow
'''
LineDemo2.py
Demonstrates errors in calculating various properties for polylines
'''
import arcpy
pnt = arcpy.Point()
polylines = []
vals = [0.001, 0.01, 0.1, 1.0, 10.0, 100.0, 1000.0]
for a_val in vals:
a_line = [[0.0,0.0],[a_val,0.0]]
polylines.append(a_line)
array = arcpy.Array()
polys = []
for i in range(len(polylines)):
a_poly = polylines
print "\n", " Coordinates: ", a_poly
for pair in a_poly:
pnt.X = pair[0]
pnt.Y = pair[1]
array.add(pnt)
print " X: %20.16f Y: %20.16f" % (pnt.X, pnt.Y)
poly = arcpy.Polyline(array)
print "Polyline properties:"
print " length %20.16f" % (poly.length)
print " centroid %s\n true centroid %s " % (poly.centroid, poly.trueCentroid)
print " first point %s\n last point %s " % (poly.firstPoint, poly.lastPoint)
print " extent %s " % (poly.extent)
#print " hull %s\n " % (poly.hullRectangle)
array.removeAll()
polys.append(poly) #for further use
with the results in changing x from 0.001 to 1000 by a factor of 10 Coordinates: [[0.0, 0.0], [0.001, 0.0]] X: 0.0000000000000000 Y: 0.0000000000000000 X: 0.0010000000000000 Y: 0.0000000000000000 Polyline properties: length 0.0010986328125000 centroid 0.00054931640625 0 NaN NaN true centroid 0.00054931640625 0 NaN NaN first point 0 0 NaN NaN last point 0.0010986328125 0 NaN NaN extent 0 0 0.0010986328125 0 NaN NaN NaN NaN Coordinates: [[0.0, 0.0], [0.01, 0.0]] X: 0.0000000000000000 Y: 0.0000000000000000 X: 0.0100000000000000 Y: 0.0000000000000000 Polyline properties: length 0.0100708007812500 centroid 0.005035400390625 0 NaN NaN true centroid 0.005035400390625 0 NaN NaN first point 0 0 NaN NaN last point 0.01007080078125 0 NaN NaN extent 0 0 0.01007080078125 0 NaN NaN NaN NaN Coordinates: [[0.0, 0.0], [0.10000000000000001, 0.0]] X: 0.0000000000000000 Y: 0.0000000000000000 X: 0.1000000000000000 Y: 0.0000000000000000 Polyline properties: length 0.1000976562500000 centroid 0.050048828125 0 NaN NaN true centroid 0.050048828125 0 NaN NaN first point 0 0 NaN NaN last point 0.10009765625 0 NaN NaN extent 0 0 0.10009765625 0 NaN NaN NaN NaN Coordinates: [[0.0, 0.0], [1.0, 0.0]] X: 0.0000000000000000 Y: 0.0000000000000000 X: 1.0000000000000000 Y: 0.0000000000000000 Polyline properties: length 1.0001220703125000 centroid 0.50006103515625 0 NaN NaN true centroid 0.50006103515625 0 NaN NaN first point 0 0 NaN NaN last point 1.0001220703125 0 NaN NaN extent 0 0 1.0001220703125 0 NaN NaN NaN NaN Coordinates: [[0.0, 0.0], [10.0, 0.0]] X: 0.0000000000000000 Y: 0.0000000000000000 X: 10.0000000000000000 Y: 0.0000000000000000 Polyline properties: length 10.0001220703125000 centroid 5.00006103515625 0 NaN NaN true centroid 5.00006103515625 0 NaN NaN first point 0 0 NaN NaN last point 10.0001220703125 0 NaN NaN extent 0 0 10.0001220703125 0 NaN NaN NaN NaN Coordinates: [[0.0, 0.0], [100.0, 0.0]] X: 0.0000000000000000 Y: 0.0000000000000000 X: 100.0000000000000000 Y: 0.0000000000000000 Polyline properties: length 100.0001220703125000 centroid 50.0000610351563 0 NaN NaN true centroid 50.0000610351563 0 NaN NaN first point 0 0 NaN NaN last point 100.000122070313 0 NaN NaN extent 0 0 100.000122070313 0 NaN NaN NaN NaN Coordinates: [[0.0, 0.0], [1000.0, 0.0]] X: 0.0000000000000000 Y: 0.0000000000000000 X: 1000.0000000000000000 Y: 0.0000000000000000 Polyline properties: length 1000.0001220703125000 centroid 500.000061035156 0 NaN NaN true centroid 500.000061035156 0 NaN NaN first point 0 0 NaN NaN last point 1000.00012207031 0 NaN NaN extent 0 0 1000.00012207031 0 NaN NaN NaN NaN so percentage wise, the greater the percentage error as you suggest...hope this gets fixed before the "Power of ArcPy" lecture gets delivered 🙂
... View more
08-05-2010
11:02 AM
|
0
|
0
|
3591
|
|
POST
|
This code using arcpy's polygon class to calculate simple properties for simple shapes are not accurate. ''' GeometryErrorsDemo.py Demonstrates calculating various properties for polygons ''' import arcpy pnt = arcpy.Point() triangle = [[0,0],[0,1],[1,0]] square = [[0,0],[0,1],[1,1],[1,0]] rectangle = [[0,0],[0,1],[2,1],[2,0]] polygons = [triangle, square, rectangle] labels = ["Triangle", "Square", "Rectangle"] array = arcpy.Array() polys = [] for i in range(len(polygons)): a_poly = polygons print "\n", labels," Coordinates: ", a_poly for pair in a_poly: pnt.X = pair[0] pnt.Y = pair[1] array.add(pnt) print " X %20.16f Y %20.16f" % (pnt.X, pnt.Y) array.add(array.getObject(0)) poly = arcpy.Polygon(array) print "Polygon properties:" print " area %20.16f\n length %s" % (poly.area, poly.length) print " centroid %s\n true centroid %s " % (poly.centroid, poly.trueCentroid) print " first point %s\n last point %s " % (poly.firstPoint, poly.lastPoint) print " extent %s " % (poly.extent) print " hull %s\n " % (poly.hullRectangle) array.removeAll() polys.append(poly) Results for a simple triangle, square and rectangle are as follows: Triangle Coordinates: [[0, 0], [0, 1], [1, 0]] X 0.0000000000000000 Y 0.0000000000000000 X 0.0000000000000000 Y 1.0000000000000000 X 1.0000000000000000 Y 0.0000000000000000 Polygon properties: area 0.5001220777630806 length 3.41463033649 centroid 0.3333740234375 0.3333740234375 NaN NaN true centroid 0.3333740234375 0.3333740234375 NaN NaN first point 0 0 NaN NaN last point 0 0 NaN NaN extent 0 0 1.0001220703125 1.0001220703125 NaN NaN NaN NaN hull 1.0001220703125 2.22044604925031E-16 0.50006103515625 -0.50006103515625 -0.50006103515625 0.50006103515625 0 1.0001220703125 Square Coordinates: [[0, 0], [0, 1], [1, 1], [1, 0]] X 0.0000000000000000 Y 0.0000000000000000 X 0.0000000000000000 Y 1.0000000000000000 X 1.0000000000000000 Y 1.0000000000000000 X 1.0000000000000000 Y 0.0000000000000000 Polygon properties: area 1.0002441555261612 length 4.00048828125 centroid 0.50006103515625 0.50006103515625 NaN NaN true centroid 0.50006103515625 0.50006103515625 NaN NaN first point 0 0 NaN NaN last point 0 0 NaN NaN extent 0 0 1.0001220703125 1.0001220703125 NaN NaN NaN NaN hull 6.12398146082414E-17 1.0001220703125 1.0001220703125 1.0001220703125 1.0001220703125 0 0 0 Rectangle Coordinates: [[0, 0], [0, 1], [2, 1], [2, 0]] X 0.0000000000000000 Y 0.0000000000000000 X 0.0000000000000000 Y 1.0000000000000000 X 2.0000000000000000 Y 1.0000000000000000 X 2.0000000000000000 Y 0.0000000000000000 Polygon properties: area 2.0003662258386612 length 6.00048828125 centroid 1.00006103515625 0.50006103515625 NaN NaN true centroid 1.00006103515625 0.50006103515625 NaN NaN first point 0 0 NaN NaN last point 0 0 NaN NaN extent 0 0 2.0001220703125 1.0001220703125 NaN NaN NaN NaN hull 6.12398146082414E-17 1.0001220703125 2.0001220703125 1.0001220703125 2.0001220703125 -2.22044604925031E-16 0 0 close but no cigar, and not readily attributable to floating point representation (ie a unit square should yield an area of 1.0 or exceptionally close to it. Results using more classic pure Python methods from: ''' AreaCentroid.py original source: http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/python.txt ''' def polygon_area(pnts): '''determine the area given a list of points''' area = 0.0 n = len(pnts) j = n - 1 i = 0 for point in pnts: p0 = pnts p1 = pnts area += p0[0] * p1[1] area -= p0[1] * p1[0] j = i i += 1 area /= 2.0 return area def polygon_centroid(pnts): '''return the centroid of a polygon''' n = len(pnts) x = 0.0 y = 0.0 j = n -1 i = 0 for point in pnts: p0 = pnts p1 = pnts f = p0[0] * p1[1] - p1[0] * p0[1] x += (p0[0] + p1[0]) * f y += (p0[1] + p1[1]) * f j = i i += 1 f = polygon_area(pnts) * 6 return [x/f, y/f] import os, sys triangle = [[0,0],[0,1],[1,0]] square = [[0,0],[0,1],[1,1],[1,0]] rectangle = [[0,0],[0,1],[2,1],[2,0]] polygons = [triangle, square, rectangle] labels = ["Triangle", "Square", "Rectangle"] for i in range(len(polygons)): a_poly = polygons print "\n", labels," Coordinates: ", a_poly print "polygon area: ", polygon_area(a_poly) print "polygon centroid: ", polygon_centroid(a_poly) yield correct results. Triangle Coordinates: [[0, 0], [0, 1], [1, 0]] polygon area: 0.5 polygon centroid: [0.33333333333333331, 0.33333333333333331] Square Coordinates: [[0, 0], [0, 1], [1, 1], [1, 0]] polygon area: 1.0 polygon centroid: [0.5, 0.5] Rectangle Coordinates: [[0, 0], [0, 1], [2, 1], [2, 0]] polygon area: 2.0 polygon centroid: [1.0, 0.5] Is this a bug? and can anyone else confirm? This also extends to the polyline class as shown in the following ''' LineDemo.py Demonstrates calculating various properties for polylines ''' import arcpy pnt = arcpy.Point() simple = [[0,0],[1,1]] two_piece = [[0,0],[0,1],[1,1]] three_piece = [[0,0],[0,1],[1,1]] polylines = [simple, two_piece, three_piece] labels = ["simple", "two_piece", "three_piece"] array = arcpy.Array() polys = [] for i in range(len(polylines)): a_poly = polylines print "\n", labels," Coordinates: ", a_poly for pair in a_poly: pnt.X = pair[0] pnt.Y = pair[1] array.add(pnt) print " X: %20.16f Y: %20.16f" % (pnt.X, pnt.Y) poly = arcpy.Polyline(array) print "Polyline properties:" print " length %20.16f" % (poly.length) print " centroid %s\n true centroid %s " % (poly.centroid, poly.trueCentroid) print " first point %s\n last point %s " % (poly.firstPoint, poly.lastPoint) print " extent %s " % (poly.extent) print " hull %s\n " % (poly.hullRectangle) array.removeAll() polys.append(poly) #for further use which for a simple two point line yields simple Coordinates: [[0, 0], [1, 1]] X: 0.0000000000000000 Y: 0.0000000000000000 X: 1.0000000000000000 Y: 1.0000000000000000 Polyline properties: length 1.4143861958645956 centroid 0.50006103515625 0.50006103515625 NaN NaN true centroid 0.50006103515625 0.50006103515625 NaN NaN first point 0 0 NaN NaN last point 1.0001220703125 1.0001220703125 NaN NaN extent 0 0 1.0001220703125 1.0001220703125 NaN NaN NaN NaN hull 0 0 0 0 1.0001220703125 1.0001220703125 1.0001220703125 1.0001220703125 as output. The only common thread seems to be the extent/last point is in error according to >>> print 1 + (1.0/2.0**13) 1.00012207031 so is something being added to the coordinate(s)? I will have to report this thread as a bug, I presume
... View more
08-05-2010
02:55 AM
|
0
|
23
|
10346
|
|
POST
|
Eric...Eric...Eric... Please do remember that not everyone has an "out-of-the-box" version of ArcInfo, check the help Near(Analysis) Licensing Information ArcView: No ArcEditor: No ArcInfo: Yes so such basic GIS questions can only be answered unless you have paid the price.
... View more
08-04-2010
09:33 AM
|
1
|
0
|
1063
|
|
POST
|
feet versus meters??? approx 3ish feet to 1 meter check with the originator of the data something is amiss
... View more
08-03-2010
04:59 PM
|
0
|
0
|
866
|
|
POST
|
Insert a new data frame. Add the problematic layer to it with no other data. Mouse around on screen and check to see if the coordinates shown on the bottom right look "correct". I have seen instances where data has been published/distributed in a supposed coordinate system when in fact it is in another, demonstrating the improper use of the Define Projection tool rather than the Project tool. If that doesn't answer the questions, add the other data to see if you get the error message again.
... View more
08-03-2010
10:42 AM
|
0
|
0
|
2319
|
|
POST
|
see examples at http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Calculate_Field_examples/005s0000002m000000/ look for the section Parser: Python Expression: !shape.extent.XMax! and there are other properties for the shape field that can be accessed
... View more
07-29-2010
06:02 PM
|
0
|
0
|
427
|
|
POST
|
I can't open the zip, it says it is invalid, maybe too many periods etc in the filename
... View more
07-29-2010
07:28 AM
|
0
|
0
|
824
|
|
POST
|
or more simply, put 60.0 in the line to enforce floating point division
... View more
07-27-2010
02:21 AM
|
0
|
0
|
1147
|
|
POST
|
Jim Where is it? Windows 7 etc etc Addendum Figured it out...you have to be logged in...might want to put a note on the page that other options only become available once logged in
... View more
07-21-2010
10:06 AM
|
0
|
0
|
1347
|
|
POST
|
this change apparently affects all "focal" statics types, see http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000qs000000.htm for the correct syntax for all types
... View more
07-20-2010
10:03 AM
|
0
|
0
|
6949
|
|
POST
|
Tina exact data set! I can check on 9.3 and 10 but I need to know if you are using a classified file or one of those tiff's that is nothing more than a pretty picture (ie RGB bands). If it is the latter, then you will only get count data for the individual bands and not the classified data (ie urban landuse etc which has a certain RGB colour)
... View more
07-19-2010
12:19 PM
|
0
|
0
|
1224
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-05-2019 05:21 PM | |
| 1 | 09-02-2016 08:05 AM | |
| 1 | 01-15-2018 01:10 PM | |
| 1 | 09-17-2018 12:48 AM | |
| 1 | 02-20-2020 02:55 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|