POST
|
See first row - "I've run into a problem with an Oracle View..." so yes, it's Oracle.
... View more
01-22-2024
12:51 PM
|
0
|
0
|
430
|
POST
|
We're migrating from ArcGIS 10.7 to PRO and we use FME to transport data which includes calls to methods in arcpy. In one of the old scripts I'm converting right now we use the method arcpy.CreateArcSDEConnectionFile but that method is missing and I can't find itin the new version of arcpy. Is it removed, changed name or what? I can't find any notations on what has happend.
... View more
01-02-2024
11:43 PM
|
0
|
2
|
406
|
POST
|
When using Oracle you can use TNS and create a generic name for a datasource. This name can then be used from ArcGIS Database connection. That means that the exact same service can be published on several Arcgis servers and by configuration use different databases. There seems to be a similar way of doing this in Postgres called something like PGSERVICE. A layer between the caller (psql, Arcgis) and the actual server and database. I have made a few tests and got this to work when using Postgres sql tool, called psql. Now the question is: How do I make a connection from ArcGIS and use the configuration in PGSERVICEFILE ? Example: I have a Postgres database set up on another machine. From ArcGIS PRO I want to connect to that database by using definitions in the connection service file (https://www.postgresql.org/docs/current/libpq-pgservice.html) If we take the example from page above I would like to make a database connection i AGP that uses the [mydb] entry. [mydb]
host=somehost
port=5433
user=someuser password=somepassword I have made adjustments in my local service file and can verify that it works by making a call to"psql", e.g: "C:\Program Files\PostgreSQL\14\bin\psql.exe" -d service=mydb This login works perfect. Now I want to use "mydb" from database connections but cant figure out the syntax. Anyone who has tried this? What I would like to recreate here is the same behaviour as you can with Oracle and where you can make a database connection and just use the TNS-names.
... View more
09-18-2023
06:20 AM
|
0
|
0
|
582
|
POST
|
I removed the entries in gdb_items manually and now registration of feature class is possible. I have mentioned the problem and also the solutionfor the Swedish ESRI-team . Hopefully they will investigate i further.
... View more
09-11-2023
12:19 AM
|
0
|
0
|
399
|
POST
|
Thanks! I thought I had checked all tables BUT I missed out gdb_items. There are records from previously removed tables in that one. It must be some kind of bug i guess. I have seen this behaviour i ArcGIS 10.* and have manually removed those records without causing any problem in database. I will try the same here. If it doesn't work I can recreate the whole database. Thanks again for a fast answer!
... View more
09-08-2023
03:52 AM
|
0
|
1
|
454
|
POST
|
Versions: ArcGIS PRO 3.1.0 & Postgres 14 I have a registered feature class in a Feature Dataset. It was first created & registered outside the FD and then dragged in. Then I remove it with ArcGIS PRO (AGP). After that I create the table again from PgAdmin (or another Sql editor). When trying to register the table in AGP I got a message that says "Error 001050 Either registered with database already or cannot open the dataset." It isn't registered and it does exist. The symbol in front of the table name i AGP Catalog doesn't indicate that it is registrered. The table is at this point empty. I tried this with a feature class that hasn't been part of a Feature Dataset and then the registration is no problem. Something happens when the feature class has been inside a Feature Dataset. I guess some stuff is not removed from the sde-schema but I can't find where it is. Any clues on where to search?
... View more
09-08-2023
02:17 AM
|
0
|
4
|
517
|
POST
|
I'm trying to find an error which occurs when running an FME-script which calls some Python code. In order to recreate the problem I use ArcMap to execute Python code and there I discovered some strange things. Arcmap version 10.7 First I use toolbox to execute the method: arcpy.MakeRasterLayer_management I enter all values which in this case is just an input and output raster. The call works well. From the Results section I copy the Python Snippet which gives me the call in Python. Then I paste this code into the ArcMAP Python Console and when executing i get this error: Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\program files (x86)\arcgis\desktop10.7\arcpy\arcpy\management.py", line 7519, in MakeRasterLayer raise e ExecuteError: ERROR 000867: Environment: contains invalid cell size or dataset. The call looks like: arcpy.MakeRasterLayer_management(in_raster="D:/tmp/anders/Markatkomst_NMD.gdb/NVA_raster", out_rasterlayer="in_memory\NVA_raster2_mem", where_clause="", envelope="281360 6153230 820480 7403330", band_index="") In short I'm trying to copy a raster from a file gdb to in_memory for later use. Anyone who has an idea what the problem is? Is this a bug? My original code in ArcMap which doesn't work either looks this simple: import arcpy import os workSpace = 'D:\\tmp\\anders\\Markatkomst_NMD.gdb' arcpy.CheckOutExtension("Spatial") arcpy.env.workspace = workSpace arcpy.env.extent = "MINOF" arcpy.env.overwriteOutput = True raster_name = "NVA_raster" raster_mem = "in_memory\\" + raster_name raster = os.path.join(workSpace, raster_name) print('Make raster layer prio') print(raster) arcpy.MakeRasterLayer_management(raster, raster_mem) Regards Anders Mark
... View more
03-15-2023
12:39 PM
|
0
|
0
|
246
|
POST
|
I will try to explain: I can't use distinct because every line in the view are correct which means it wouldn't be correct to use just one of the duplicate objectid:s. I.e. data would be missing. The view joins several tables inlucing one geometry table. The same geometry kan be used from more that one row in the view. This is the reason for duplicate object ids. The problem is that ArcGIS depends on that every geotable or geoview contains unique values for OBJECTID. I a view doesn't fulfill that need, ArcGis will automatically aggregate duplicate objectid:s and create a multipart feature but with attribute values from just one of the aggregated records. When checking information about one of those geometries you will see every geometry but only attribute values for one of them. This leads to lack of information which is not preferred. Is the problem more clear now?
... View more
02-20-2023
04:59 AM
|
0
|
4
|
962
|
POST
|
I've run into a problem with an Oracle View that produces duplicates of column OBJECTID. The underlying geo-table has of course unique objectid:s but in the view, every geometry can occur severeal times. This violates functionality that requires that the ObjectID be unique. https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/object-id.htm The view is a registred view in ArcGIS. In my case I have a ArcMap service that consumes the view and when duplicate objectids are spotted it aggregates all rows with the same objectid. Maybe thats fine with the geometrys, as many lines can exist in a poly line field. The problem is the attributes where only one of aggregated rows will represent the geometry/row when consumed in the map service. Maybe it's the first row of the aggregated records that will display in the map or one of the others, it's hard to tell. It feels random. Is there a best practise to solve this kind of issue? I have tried to make the view generate it's own unique value in the OBJECTID column instead reading that's written in the underlying table but when I do this it's not possible to register the view in ArcGIS.
... View more
02-09-2023
04:55 AM
|
0
|
8
|
1024
|
POST
|
Maybe you're right about that. The one thing thats suggest something else is that when I run this code embedded in FME-script on FME-server with ArcGIS 10.3 installed i got no problem. I have specified column names in a json-structure. I use this json specification both when I read the combineRaster and when I write outcome vat-table. It work perfectly. {'tblColsVat': { 'Value' : 'LONG', 'Count' : 'DOUBLE', 'NMD_COMBINE' : 'LONG', 'DosAreaRaster_r' : 'LONG' } } Python: >>> vatTable 'Combine_DOSOBJEKT_r_VAT' >>> vatColumns ['Count', 'DosAreaRaster_r', 'NMD_COMBINE', 'Value'] A verification of vat-table in ArcMap: Question: If the names where truncated in the "in_memory\\combineRaster", how can I then access them with my json specification of fields? I.e. full length column names.
... View more
11-18-2021
01:35 PM
|
0
|
0
|
512
|
POST
|
Thanks but as I wrote, this is not true all the time. When I run the exact same code in ArcMap 10.7 the columns are created correctly.
... View more
11-18-2021
12:57 PM
|
0
|
0
|
543
|
POST
|
I got a strange problem that occur when I combine rasters in my pythoncode. Say I have rasters "NMD_COMBINE", "DosAreaRaster_r" and the result ends up in "rasterOut". Call in code: arcpy.gp.Combine_sa(["NMD_COMBINE", "DosAreaRaster_r"], "combineRaster") Actually all these rasters are "in_memory" so the actual path for all of them are : "in_memory\\NMD_COMBINE" "in_memory\\DosAreaRaster_r" "in_memory\\combineRaster" The call to combine is fine but the result is a little strange regarding the given column names in the "combineRaster". The first 3 column are standard: "OID", "Value", "Count". The other 2 for the combined rasters are: "NMD_COMBIN" "gptmpraste" Look at the columns above! The first one has almost a correct name but are truncated to 10 characters. The second has a completely different name compared to the source but is also 10 chars long. Doesn't it look like it's also truncated and that an "r" is missing? Question: Why does this happen? Normally this Pythoncode is embedded in FME-script but is now extracted and run i Arcmap 10.3 Python window. If I run the exact same thing in ArcMap 10.7 the column names are correct in the combineRaster. Though I don't think it is the versions that make the difference in this case but what is? Something wrong with the installation? Environment variables?
... View more
11-18-2021
12:32 PM
|
0
|
4
|
547
|
POST
|
Yes I understand but my thought was that since ST_GEOMETRY is an ESRI datatype it can be managed within ArcGIS products. SDO_GEOMETRY is an Oracle datatype and that can be managed in SqlDeveloper. If I do what you suggest in SqlDev I cant see any spatial columns in my table. I guess that is because SqlDev searches for column type SDO_GEOMETRY.
... View more
04-26-2021
08:35 AM
|
0
|
0
|
1754
|
POST
|
Ok maybe the problem behaves in a different way when you compare SDO_GEOMETRY and ST_GEOMETRY. If I check the FC in Arcmap I cant see the option "Update Spatial Metadata". Anyway, thanks for suggestions!
... View more
04-26-2021
07:40 AM
|
0
|
2
|
1756
|
Title | Kudos | Posted |
---|---|---|
1 | 05-06-2020 07:14 AM |
Online Status |
Offline
|
Date Last Visited |
01-23-2024
06:36 AM
|