|
POST
|
Both 6152 and 4269 still give the same error: SRID does not exist. The SRID column in the ST_Spatial_References table go from 0 to 56 and many of the values in SR_NAME are the same. Of the 56 records, there are only 8 distinct: GCS_WGS_1984 NAD_1927_StatePlane_Arizona_Central_FIPS_0202 NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202 NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202_Feet_Intl NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202_IntlFeet NAD_1983_HARN_UTM_Zone_12N NAD_1983_UTM_Zone_12N Unknown_CoordSys Maybe our ST_Spatial_References table is incomplete?
... View more
04-01-2015
10:03 AM
|
0
|
0
|
4987
|
|
POST
|
As always, thanks for the reply, Joshua. I get what you're saying, but I get this error when I try to use that number: ORA-20005: srid 4326 does not exist in st_spatial_references table. ORA-06512: at "SDE.ST_GEOMETRY_OPERATORS", line 2556 When I look at the SDE.ST_Spatial_References table, the SRID column has smaller numbers and there are four records that have WGS1984 in the name. The CS_ID field has the 4326 number, but it doesn't appear that ST_Transform is looking at that field.
... View more
04-01-2015
09:37 AM
|
0
|
7
|
4987
|
|
POST
|
I think Subtypes are the best way to go here. I have used them once in the past and it is a little tricky to wrap your head around at first. Could you describe your data and the rules the domains must follow?
... View more
04-01-2015
09:24 AM
|
1
|
8
|
1920
|
|
POST
|
Well, I figured out the (HUGE CLOB) issue, but I still can't get it to convert from UTM to Latitude, Longitude. I get an error saying ORA-20603: Spatial References are not compatible. ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 788 ORA-06512: at "SDE.ST_GEOMETRY_OPERATORS", line 2577 Here's the SQL SELECT EID, SHAPE, ST_X(SHAPE) as X, ST_Y(SHAPE) as Y,
sde.st_astext(sde.st_transform(SHAPE, 0)) AS TEXTCOORD
FROM LIS.ADDRESS_PNT I was just testing the ST_X and ST_Y to see if any ST_Geometry operations would work (and they did).
... View more
03-31-2015
02:32 PM
|
1
|
0
|
4987
|
|
POST
|
In our Oracle 11g SDE (10.0), there's a point feature class with a Shape field of ST_Geometry type. It also has a Northing and Easting field that gets populated by GPS personnel. I need to be able to get GCS_WGS_1984 (SRID 0) latitude and longitude (decimal degrees) from the points that are in NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202 (SRID 48). I'm sure there's a way to do it with ST_Transform and/or ST_AsText, but I haven't been able to figure it out; ST_AsText always comes through as just (HUGE CLOB). What's the proper Oracle SQL syntax to get this?
... View more
03-31-2015
02:07 PM
|
0
|
11
|
17074
|
|
POST
|
I'm on 10.2.2 and just tested this with a new Personal GDB and did not have the same issue. The Rnd field was not automatically populated.
... View more
03-30-2015
10:26 AM
|
0
|
1
|
1140
|
|
POST
|
Oh, ok, now I see what you're doing with AddField. The version of the update cursor you are using is actually an old method and is being replaced by the one using the data access module (arcpy.da). It might be worth transitioning to arcpy.da.UpdateCursor to see if maybe that solves your issue.
... View more
03-30-2015
10:05 AM
|
1
|
3
|
4071
|
|
POST
|
There's some good information in this thread that might help you. To simply things, You could probably just look at using Calculate Field instead of an update cursor. Also, take another look at how you're adding your fields; Your syntax looks strange and I don't see where you specify the field type. Finally, since you are joining the dirpath and filename a lot, might be easier to just make a variable at the beginning for your full file path. I haven't tested this, but here's some code that hopefully portrays some of my ideas. I also created a dictionary (addFields) where the key is the new field name and the value is the possible search fields. addFields = {
"New_Name": ["ENG_NAME", "Name"],
"Another_New_Field": ["PossibleSearchField1", "AnotherPsblSrchFld", "MaybeAnotherPSF"],
"New_Fld": ["SimilarName", "Other_Existing_Fld"]
}
filepath = os.path.join(dirpath, filename)
fieldsExisting = [f.name for f in arcpy.ListFields(filepath)]
for addField, psf in addFields.items():
if addField not in fieldsExisting:
# Adjust AddField parameters as needed
arcpy.AddField_management(
filepath, ## in_table
addField, ## field_name
"TEXT", ## field_type
"", ## field_precision
"", ## field_scale
12 ## field_length
)
psfMatch = set(fieldsExisting) & set(psf) ## Compare lists and return matches in a set
if len(psfMatch) == 1:
matchField = next(iter(psfMatch)) ## Get field name from psfMatch set
arcpy.CalculateField_management(
filepath, ## in_table
addField, ## field
"!{}!".format(matchField), ## expression
"PYTHON_9.3" ## expression_type
)
else:
print "More than one possible search field match, unable to caclulate field." This doesn't attempt to convert field datatypes. I was just writing out some ideas.
... View more
03-30-2015
09:34 AM
|
1
|
5
|
4071
|
|
POST
|
Thanks for the reply's guys. I think the answer is that this can't be done. I've come across a few sources that claim it is not possible to send a PL/SQL record type table object through cx_Oracle. Discussion of the cx_Oracle Python interface to Oracle ()
... View more
03-30-2015
08:38 AM
|
0
|
0
|
1895
|
|
POST
|
Sorry for the confusion with the first post. I was just trying to get my thoughts out into some psuedo code. Unfortunately, the procedure I'm calling does not use a refcursor; it has to be a table object of record datatype.
... View more
03-30-2015
08:37 AM
|
0
|
0
|
1895
|
|
POST
|
Yes, I believe I do need to create an array. I'd like to provide some more information about the procedure I'm calling. It has an input of a table type and an output of a table type. Both in and out tables are defined with a custom RECORD datatype. Here's how the input table is defined: TYPE meter_info_tab_type IS TABLE OF meter_info_rec_type
INDEX BY BINARY_INTEGER;
Here's a sample of what the input table's record type looks like: TYPE meter_info_rec_type IS RECORD
(
c_esb_guid VARCHAR2(50),
c_newserialnum VARCHAR2(10),
c_remoteid VARCHAR2(15),
d_install DATE,
c_remotetype VARCHAR2(2),
c_recordtype VARCHAR2(1),
l_processed NUMBER,
) Here's how the input and output tables are used in the procedure: PROCEDURE InsertMeterInfo
(
p_error_data OUT error_tab_type,
p_meter_info_data IN meter_info_tab_type
)
IS
... rest of procedure code... All the cx_oracle arrayvar() examples use VARCHAR2 or NUMBER datatypes. How do I define an arrayvar with a RECORD datatype so I can put in a list of lists or tuples for the rows? This page looked to have some promising information, but I'm still having trouble.
... View more
03-27-2015
12:25 PM
|
0
|
2
|
1895
|
|
POST
|
ListUsers() has the IsDirectConnection property. I think If it's not direct connect, then it's application server.
... View more
03-26-2015
01:34 PM
|
1
|
5
|
2963
|
|
POST
|
I'm trying to use Python to call a procedure in another Oracle database (using cx_Oracle) that requires an input parameter of a table object. The table object needs to be comprised of some records from our Oracle SDE (a fairly simple select statement). Using Python, how do I create an Oracle table object to send it to the stored procedure? Something kind of like: oracle_sde = u'UserNameHere/PasswordHere@DatabaseNameHere'
oracle_otherdb = u'UserNameHere/PasswordHere@DatabaseNameHere'
sql = "SELECT * FROM TABLE_NAME"
sde_cnxn = cx_Oracle.connect(oracle_sde)
sde_cursor = sde_cnxn.cursor()
sde_cursor.execute(sql)
otherdb_cnxn = cx_Oracle.connect(oracle_otherdb)
otherdb_cursor = otherdb_cnxn.cursor()
otherdb_cursor.callproc("MyProcedure", sde_cursor.fetchall()) I know it's not really a GIS question, but I figured you guys would be up for the challenge!
... View more
03-26-2015
12:33 PM
|
0
|
5
|
7351
|
|
POST
|
I just tried the same thing in a File Geodatabase and it worked. Maybe try leaving that optional "Join" field in Remove Join blank. However, I was not using GlobalID as a key field. Is there something else you could use to test with just to see if you can get a model that works?
... View more
03-24-2015
04:51 PM
|
0
|
0
|
1012
|
|
POST
|
If you're using a table in SDE (instead of a feature class), are you creating a table view instead of a feature layer? Also, make sure you're referencing the correct table view for the remove. ArcGIS Help 10.1 - Remove Join (Data Management) Could you also try rewriting just a simple add join, remove join based on the Esri help example to see if you're doing it right. Once you get something working, start adding in the rest of your code and see where it breaks. Maybe post a sample here so we can review it.
... View more
03-23-2015
04:48 PM
|
0
|
2
|
1012
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 1 | 07-31-2025 11:59 AM | |
| 1 | 07-31-2025 09:12 AM | |
| 2 | 06-18-2025 03:00 PM | |
| 1 | 06-18-2025 02:50 PM |