I'm sure I must be doing something foolish, but I've hammered on this
for an hour or so, and can't seem to get this to complete. I'm trying to
translate a small dataset from a simple set of points and polygons:
Table "public.stands"
Column | Type | Modifiers
----------+----------+-----------------------------------------------------
id | integer | not null default nextval('stands_id_seq'::regclass)
strata | integer | not null
initage | integer |
boundary | geometry |
location | geometry |
Indexes:
"stands_pkey" PRIMARY KEY, btree (id)
"stands_boundary_gist" gist (boundary)
"stands_location_gist" gist (location)
Check constraints:
"enforce_dims_boundary" CHECK (ndims(boundary) = 2)
"enforce_dims_location" CHECK (ndims(location) = 2)
"enforce_geotype_boundary" CHECK (geometrytype(boundary) =
'MULTIPOLYGON'::text OR boundary IS NULL)
"enforce_geotype_location" CHECK (geometrytype(location) =
'POINT'::text OR location IS NULL)
"enforce_srid_boundary" CHECK (srid(boundary) = 32755)
"enforce_srid_location" CHECK (srid(location) = 32755)
and when I try to populate the location field using the ST_MakePoint()
function, I seem to always get the same result:
delete from stands;
insert into stands
select
tmp_stands.gid as id,
tmp_stands.strata as strata,
tmp_stands.initage as initage,
st_translate( tmp_stands.boundary, 500000, 5900000,0) as boundary,
st_translate( ST_MakePoint( tmp_stands.landx, tmp_stands.landy), 500000,
5900000 ) as location
from tmp_stands;
ERROR: new row for relation "stands" violates check constraint
"enforce_srid_location"
which I don't understand because when I remove the
st_translate(st_makepoint()) command, the boundary translated just fine.
In fact, I can't go back and update the locations no matter what values
I use. If the points (which are in the middle of the polygons) violate
the check constraints, then why do the boundaries translate just fine?
Jeff Hamann, PhD
Forest Informatics
begin:vcard
fn:Jeff Hamann
n:Hamann;Jeff
org:Forest Informatics
adr:;;PO Box 1421;Corvallis;Oregon;97339-1421;United States
email;internet:[email protected]
title:President
tel;work:15417542457
x-mozilla-html:FALSE
url:www.forestinformatics.com
version:2.1
end:vcard
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users