I have a versioned (not move to base) polygon feature class in oracle. I do an insert to the versioned view to create a new feature. The result looks valid, there is a feature, it has a polygon, it works in ArcMap but looking at the table the shape.area is zero, the shape.length has a value. Versions are Oracle 11gR2 and Geodatabase 10.3.1.
This is the code in oracle:
insert into mytable_evw (begdate, globalid, shape)
values(
sysdate +3,
sde.gdb_util.next_globalid(),
sde.st_transform(sde.st_geometry('linestring(104 87, -47 71, -93 64, -148 72, 104 87)', 4326), (select srid from sde.st_geometry_columns where table_name= ‘MYTABLE’))
);
Commit;
Another thing I found strange is that if I didn't provide the last coordinate pair matching the first, the polygon didn't form porperly contrary to the documentation I read.
Solved! Go to Solution.
It appears you are inserting a LINESTRING into a polygon feature class. I am surprised it isn't generating an error. What if you use: 'POLGYON((104 87, -47 71, -93 64, -148 72, 104 87))'
It appears you are inserting a LINESTRING into a polygon feature class. I am surprised it isn't generating an error. What if you use: 'POLGYON((104 87, -47 71, -93 64, -148 72, 104 87))'
Thanks Joshua, it was the double bracket that got me when I first tried it. The st_transform example only had linestring, linestring works with single brackets. Everything except shape.area looked ok.
for the record
insert into mytable_evw (begdate, globalid, shape)
values(
sysdate +3,
sde.gdb_util.next_globalid(),
sde.st_transform(sde.st_geometry('POLYGON((104 87, -47 71, -93 64, -148 72, 104 87))', 4326), (select srid from sde.st_geometry_columns where table_name='MYTABLE'))
);
Commit;