Select to view content in your preferred language

C API: The specified coordinate point exceeds the valid coordinate range.

462
3
04-22-2010 06:48 AM
BobCave
Emerging Contributor
Hello,

We are using the old C API to access earlier versions of ArcSDE, and I am running into an error I don't understand.  I don't know if this is the correct place to post on this topic, but it is the closest sub-forum I can find.  If this is the wrong place, please redirect me. 

In my program, I am creating a new point geometry using SE_shape_generate_point().  The coordinate reference is for a WGS 84 lat/lon system, and I used SE_coordref_set_xy_by_envelope() to set the extents as follows:

MinX=-180.000000, MaxX=180.000000
MinY=-90.000000, MaxY=90.000000

When I try to create a point (180.00, 90.00), SE_shape_generate_point() returns -139 (The specified coordinate point exceeds the valid coordinate range). 

Before getting this error, I was able to create many points, including another point at the boundary of the valid range (-180.00, 90.00).

Does anyone know why I am getting this error?

Thanks,

Bob
0 Kudos
3 Replies
MelitaKennedy
Esri Notable Contributor
Hello,

We are using the old C API to access earlier versions of ArcSDE, and I am running into an error I don't understand.  I don't know if this is the correct place to post on this topic, but it is the closest sub-forum I can find.  If this is the wrong place, please redirect me. 

In my program, I am creating a new point geometry using SE_shape_generate_point().  The coordinate reference is for a WGS 84 lat/lon system, and I used SE_coordref_set_xy_by_envelope() to set the extents as follows:

MinX=-180.000000, MaxX=180.000000
MinY=-90.000000, MaxY=90.000000

When I try to create a point (180.00, 90.00), SE_shape_generate_point() returns -139 (The specified coordinate point exceeds the valid coordinate range). 

Before getting this error, I was able to create many points, including another point at the boundary of the valid range (-180.00, 90.00).

Does anyone know why I am getting this error?

Thanks,

Bob


Hi Bob,

Internally, the coordinates are being converted to positive integers. It's possible one of the values is rounding to just over 180 or 90 and triggering the error. You should probably nudge the extents out a little, say -181,-91 to 181,91 to allow for cases like this. For all releases post-9.1 with layers that are using high precision, setting the coordref envelope like this is forcing a very small xy resolution (large xyunit) value. With +/-180, the xy resolution is 0.00000000000004 or 25000000000000 (roughly the number of decimal places).

Melita
0 Kudos
VinceAngelo
Esri Esteemed Contributor
I wish the 'C' API didn't have the SE_coordref_set_xy_by_envelope function,
because it creates more problems than it solves.

If you look at the coordref x/y offsets and scale that are generated, you're
likely to see that the actual integer value generated on the Y member
overflows the 2^31-1 limit.

Best practice for ArcSDE coordinate reference creation calls for generating
a buffer around your expected data space, to allow for search circles and
other objects that exceed the data space.  I haven't had many occasions
where I haven't used "SE_coordref_set_xy(coordref,-210,-120,1000000)"
when working with PE_GCS_WGS_1984 data.

See http://forums.esri.com/Thread.asp?c=2&f=1720&t=287575&mc=4#894148
for information on the storage impacts of using a scale factor in excess of the
actual precision.

- V
0 Kudos
JoseSanchez
Frequent Contributor
Whenever I have to load add a feature class in an existing feature dataset, instead of dragging the feature inside the feature dataset, what I do is to create an empty feature class in the feature dataset, import the fields for the external feature class and the use load to populate the feature class inside the feature dataset.

Like that I do not have all of these error messages.
0 Kudos