PostgreSQL - pg_geometry

1781
2
09-12-2016 01:56 AM
TimarGabor
New Contributor

Hi Experts,

we have ArcGIS Server 10.4.1 Advanced  with PostgreSQL 9.4.9. and PostGIS

I've created two enterprise geodatabases from ArcCatalog:

db1: with ST_GEOMETRY

db2: with PG_GEOMETRY

db1 and db2 works fine from the ArcGIS Desktop ArcCatalog (arctoolbox and also python scripts). But when I try running python scripts on the ArcGIS Server, only db1 works. Scrips couldn'nt connect to PG_GEOMETRY db2. I use .sde files generated and tested by ArcCatalog.

working script, running on the server (ujsde.sde points to db1 with ST_GEOMETRY):

# Import arcpy module
import arcpy
import arcserver

# Local variables:
input_shp = "/home/arcgis/ujshp.shp"
output_shp = "shp_new"
sde_conn = "/home/arcgis/ujsde.sde"


# Process: Feature Class to Feature Class
arcpy.FeatureClassToFeatureClass_conversion(input_shp, sde_conn, output_shp)

it works fine.

failed script, running on the server (ujsde_pg.sde points to db2 with PG_GEOMETRY):

import arcpy
import arcserver

# Local variables:
input_shp = "/home/arcgis/ujshp.shp"
output_shp = "shp_new_pg"
sde_conn = "/home/arcgis/ujsde_pg.sde"


# Process: Feature Class to Feature Class
arcpy.FeatureClassToFeatureClass_conversion(input_shp, sde_conn, output_shp)

error:

[arcgis@... ~]$ /home/arcgis/server/tools/python /home/arcgis/shp2sde_pg.py
Connection to database 'ujsde_pg' failed.
Traceback (most recent call last):
File "/home/arcgis/shp2sde_pg.py", line 22, in <module>
arcpy.FeatureClassToFeatureClass_conversion(input_shp, sde_conn, output_shp)
File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\conversion.py", line 1694, in FeatureClassToFeatureClass
raise e
arcgisscripting.ExecuteError: ERROR 000210: Cannot create output /home/arcgis/ujsde_pg.sde\shp_new2
Failed to execute (FeatureClassToFeatureClass).

Need some extra environment settings on linux connecting with arcpy to the PG_GEOMETRY based geoadatabse...?

What is the difference between the ArcCatalog ArcPy and the ArcGIS Server ArcPy?

The lib files are in the right folder on the server....

Thanks,

Gabor

arcgis python api‌ arcgisserver‌ postgresql postgis*‌ #postgresql

0 Kudos
2 Replies
AvinashPatel1
Occasional Contributor III
TimarGabor
New Contributor

Thx for the link!

The postgreSQL is installed with PostGIS. I've successfully run the "Enable Enterprise Geodatabase" from ArcCatalog, the DB became  a "PostgreSQL Enterprise Geodatabase". I can run every ArcTool from ArcCatalog,  I can create feature classes, etc. But the server-side python scripts don't work

0 Kudos