POST
|
Nothing says Unknown coordinate system like '{B286C06B-0879-11D2-AACA-00C04FA33C20}'... Yes, I agree. You can pull out these class ID values from the bin/XMLSupport.dat file within your installation directory, but it'd be nice to have a 'named' way to create an unknown coordinate system. I've submitted an enhancement request on the problem.
... View more
06-13-2013
03:20 PM
|
0
|
0
|
907
|
POST
|
Anyone know a better way to create an Unknown spatial reference object? try this:
sr = arcpy.SpatialReference()
sr = sr.loadFromString('{B286C06B-0879-11D2-AACA-00C04FA33C20}') That should create a proper 'unknown' spatial reference object. Source bug report.
... View more
06-12-2013
05:44 PM
|
1
|
0
|
907
|
POST
|
Calculate Geometry is not a tool. I can right click and use it, but I am trying to make it automatic. The purpose of this is to save time for when field workers have new data they want to put into CAD. This is the process my boss has done many times manually, but now wants automated to save time and effort. You can perform the centroid calculation using CalculateField, one of the code samples shows how to use it to add a centroid.
... View more
06-12-2013
04:49 PM
|
0
|
0
|
698
|
POST
|
I've create an example, example-toolbox.pyt that hopefully clarifies (also as a Github Gist😞 import arcpy
class Toolbox(object):
def __init__(self):
self.label = u'Example_Toolbox'
self.alias = ''
self.tools = [FirstTool, SecondTool, ThirdTool]
class FirstTool(object):
def __init__(self):
self.label = u'First Tool'
self.description = u''
self.canRunInBackground = False
self.category = "Import"
def getParameterInfo(self):
return
def execute(self, parameters, messages):
pass
class SecondTool(object):
def __init__(self):
self.label = u'Second Tool'
self.description = u''
self.canRunInBackground = False
self.category = "Export"
def getParameterInfo(self):
return
def execute(self, parameters, messages):
pass
class ThirdTool(object):
def __init__(self):
self.label = u'Third Tool'
self.description = u''
self.canRunInBackground = False
self.category = "Export"
def getParameterInfo(self):
return
def execute(self, parameters, messages):
pass You'll then have two categories within your toolbox: Export and Import, Import will contain one item and Export will contain two. cheers, Shaun
... View more
06-10-2013
04:35 PM
|
1
|
2
|
1473
|
POST
|
I believe that the call to arcpy.da.searchCursor will always include 'OBJECTID' in the output results, and so you'll need to include that in your aggregation function. So after your main 'GROUP BY' statement, append 'OBJECTID', in your case: sqlclaus = [None, "GROUP BY CONVERT(DATE, CRET_TS),GISF_CRET_METH_CD,BWCreator,OBJECTID"] This won't affect the results as the column only contains unique results, but should allow your above query to run (provided this was the sole issue).
... View more
06-06-2013
12:07 PM
|
0
|
0
|
973
|
POST
|
Note there are no more system-based .prj file in v10.1 anymore (!!!!) But you can manufacture one via the SR's exportToString() method and then write it to a file. If you'd like a full set of PRJ files, you can generate them fairly easily. I've posted a short script which will populate your 'Coordinate Systems' directory with all internal projections here: https://gist.github.com/scw/5720029
... View more
06-06-2013
12:08 AM
|
1
|
0
|
1237
|
POST
|
Seems like a bug to not have that property available... Agreed, I've filed a bug for the problem as NIM092211.
... View more
06-05-2013
07:23 PM
|
0
|
0
|
1237
|
POST
|
NOTE: as of Version 10.3, the SpatialReference object contains the "latitudeOfOrigin" property, and the trick below is unncessary. Hi Tim, It looks like a property which should be included in the SpatialReference object, but I don't see it either. For a quick and dirty hack, you can pull the relevant string out of the exportToString() results: import arcpy
import re
# a projection with a latitude of origin property
proj = 'NAD 1983 Contiguous USA Albers'
sr = arcpy.SpatialReference(proj)
lat_of_origin_regex = "Latitude_Of_Origin',(\d+\.?\d*)]"
match = re.search(lat_of_origin_regex, sr.exportToString())
if match:
lat_of_origin = float(match.groups()[0])
print "{0} has latitude of origin {1}".format(proj, lat_of_origin)
else:
print "no latitude of origin detected." Set up your own spatial reference object in the code above, and you should be able to use the lat_of_origin variable to get what you need. cheers, Shaun
... View more
06-05-2013
02:53 PM
|
0
|
0
|
1237
|
POST
|
I agree, that is frustrating. I've found an existing open bug related to the issue here: http://support.esri.com/en/bugs/nimbus/role/beta10_1/TklNMDg0MjA4
... View more
06-05-2013
01:33 PM
|
0
|
0
|
579
|
POST
|
I can confirm that it doesn't work by doing a simple join when inside of an FGDB, you'd need to perform arcpy.CopyRows_management() prior to joining. But better than that, have you seen arcpy.da.ExtendTable? That looks to do what you need in one command.
... View more
06-04-2013
03:23 PM
|
0
|
0
|
579
|
POST
|
This question really isn't about Python nor spatial statistics, so you're unlikely to get an in-depth response here. You might want to try [Cross Validated](http://stats.stackexchange.com/) for this kind of question. If you have other ancillary data that is spatial, you might be interested in this tool to link ArcGIS with R which lets you connect ArcGIS with R, which may be useful.
... View more
06-04-2013
03:01 PM
|
0
|
0
|
231
|