ArcSDE SDK 10.0 Java API: setSpatialConstraints: The Coordinate System Desc Invalid

627
3
02-03-2011 04:03 AM
IsilDemir
New Contributor
Hi,

I'm trying to make a spatial query with the Java API and keep getting this error:

ArcSDE Error Number: -143
Error Description: THE COORDINATE SYSTEM DESCRIPTION IS INVALID.

My code looks like this:


try
{
 SeLayer layer = new SeLayer(conn, layerName, spatialCol);

 SeShape shape = new SeShape(layer.getCoordRef());
 SeExtent extent = layer.getExtent();

 shape.generateRectangle(extent);
 SeShape[] shapes = new SeShape[1];
 shapes[0] = shape;

 SeShapeFilter filter = new SeShapeFilter(layerName, spatialCol, shape, SeFilter.METHOD_ENVP);
 SeShapeFilter[] filters = new SeShapeFilter[1];
 filters[0] = filter;

 String[] cols = new String[1];
 cols[0] = new String("*");

 SeSqlConstruct sqlCons = new SeSqlConstruct(layer.getName());
 SeQuery spatialQuery = new SeQuery(conn, cols, sqlCons);
 spatialQuery.prepareQuery();

 spatialQuery.setSpatialConstraints(SeQuery.SE_OPTIMIZE, false, filters);
 spatialQuery.execute();
}
catch (SeException e)
{
 e.printStackTrace();
}


I keep getting the error I mentioned above at the line where I try to use the method setSpatialConstraints.

When I use the method getCoordSysDescription() on my SeLayer object, the output is like this:

GEOGCS[
"GCS_WGS_1984",
DATUM["D_WGS_1984", SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]
]

Any help will be much appreciated,

Edit: By the way, ArcSDE is running on RHEL & Oracle 11g.

Isil
0 Kudos
3 Replies
IsilDemir
New Contributor
Ok this issue got resolved. I was running the code on a Windows machine, whilst using SDK's Windows libraries connecting to the Linux server via SSH tunnel. Apparently, that's not a good idea 😃 Once I ran the code on the server itself, it worked like a charm.

Sorry everyone for the inconvenience.
0 Kudos
VinceAngelo
Esri Esteemed Contributor
There's nothing wrong with accessing an ArcSDE server across a VPN link -- I do it
all the time with 'C' API apps. If the Windows client version is at least as high as the
server (10.0/10.0sp1), then it should just work (the apparent CR-LF in the coordsys
string may be the issue). If it doesn't, please file a bug report so the problem can
be fixed.

- V
0 Kudos
IsilDemir
New Contributor
Both the Windows client and server versions are 10.0

But it had definitely something to do with encoding because I was developing the client code on a Windows XP with system language settings set to Turkish. Once I changed the language to English in Control Panel > Regional and Language Options > Advanced > Language for Non-Unicode Programs, the windows client began working as well.

Thank you very much for your help 😃
0 Kudos