<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META name=GENERATOR content="MSHTML 8.00.6001.18372">
<DIV><SPAN class=309442213-20022009><FONT color=#0000ff size=2 face=Arial>Hi
Dan</FONT></SPAN></DIV>
<DIV><SPAN class=309442213-20022009><FONT color=#0000ff size=2 face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=309442213-20022009><FONT color=#0000ff size=2 face=Arial>Thanks
for the information.</FONT></SPAN></DIV>
<DIV><SPAN class=309442213-20022009><FONT color=#0000ff size=2 face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=309442213-20022009><FONT color=#0000ff size=2 face=Arial>regards</FONT></SPAN></DIV>
<DIV><SPAN class=309442213-20022009><FONT color=#0000ff size=2 face=Arial>Vinay</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV dir=ltr class=OutlookMessageHeader align=left><FONT size=2 face=Tahoma>-----Original Message-----<BR><B>From:</B> Dan Stoica (via Nabble)
[mailto:<a href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2358800&i=0" target="_top" rel="nofollow">ml-user+64177-1235426992@...</a>]<BR><B>Sent:</B> Friday,
February 20, 2009 7:21 AM<BR><B>To:</B> vinay<BR><B>Subject:</B> RE:
[fdo-users] inserting data into a SDF file<BR><BR></FONT></DIV>HI Vinay,
<BR><BR>Regarding creating spatial contexts and in general when you need a
working example: have a look into the SDF unit tests. <BR><BR><BR>Regards,
<BR>Dan. <BR><BR>-----Original Message----- <BR>From: <A href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2358773&i=0" rel="nofollow" target=_top>fdo-users-bounces@...</A> [mailto:<A href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2358773&i=1" rel="nofollow" target=_top>fdo-users-bounces@...</A>] On Behalf Of vinay
<BR>Sent: Thursday, February 19, 2009 10:35 PM <BR>To: <A href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2358773&i=2" rel="nofollow" target=_top>fdo-users@...</A> <BR>Subject: Re: [fdo-users]
inserting data into a SDF file <BR><BR><BR>Hi Jackie, <BR><BR>Thanks for the
tip. It worked. Also thanks for making fdotoolkit app open <BR>source. It is
very helpful for me to learn and understand different things <BR>related to
FDO seeing your source code. <BR><BR>I am having very hard time to understand
spatialcontext concepts. When <BR>creating the datastore for the sdf file i am
want to create a default <BR>spatialcontext but i am having difficulty in
creating a default wkt <BR>coordinate system. Do you have any suggestions.
<BR><BR>Thanks in advance. <BR><BR>regards <BR>Vinay <BR><BR><BR>Jackie Ng
wrote:
<DIV class=shrinkable-quote><div class='shrinkable-quote'><BR>> <BR>> If you look at the property
value collection of the insert command in the <BR>> debugger, you will see
the count will increase in increments of 4. <BR>> <BR>> As a result, the
insert command will use the same first 4 property values <BR>> for every
insert operation. <BR>> <BR>> To fix this, clear the property value
collection of the insert command <BR>> before setting the property values.
<BR>> <BR>> Hope that helps. <BR>> <BR>> - Jackie <BR>>
<BR>> <BR>> vinay wrote: <BR>>> <BR>>> Hi All, <BR>>>
<BR>>> I am using the FDO dlls from the MAP ObjectArx SDK 2009 in
Visual studio <BR>>> 2008. I am writing a small app to understand FDO
API. I am able to create <BR>>> a sdf file, describe schema for the sdf
file, create feature class, etc. <BR>>> I created four
datapropertydefinitions in which one is an <BR>>> identityProperty. I am
inserting values into my properties in a for-loop. <BR>>> When I open
this sdf file in map 2009, all columns have the same values <BR>>>
except the auto generated property column as shown below. <BR>>>
<BR>>> Please take a look in case I am missing something simple here.
<BR>>> <BR>>> <A href="http://n2.nabble.com/file/n2349739/data.png" rel="nofollow" target=_top>http://n2.nabble.com/file/n2349739/data.png</A><BR>>>
<BR>>> Source code snippets for the sample app is below <BR>>>
<BR>>> OSGeo.FDO.Schema.FeatureSchema Schema = new <BR>>>
OSGeo.FDO.Schema.FeatureSchema("SchemaOne", "Sample Schema"); <BR>>>
OSGeo.FDO.Schema.FeatureClass ClassOne = new <BR>>>
OSGeo.FDO.Schema.FeatureClass("Class one", "Class one for Schema One");
<BR>>> <BR>>> <BR>>>
OSGeo.FDO.Schema.DataPropertyDefinition DataProp1 <BR>>> = new
OSGeo.FDO.Schema.DataPropertyDefinition("Prop1", "Property one"); <BR>>>
OSGeo.FDO.Schema.DataPropertyDefinition DataProp2 <BR>>> = new
OSGeo.FDO.Schema.DataPropertyDefinition("Prop2", "Property two"); <BR>>>
OSGeo.FDO.Schema.DataPropertyDefinition DataProp3 <BR>>> = new
OSGeo.FDO.Schema.DataPropertyDefinition("Prop3", "Property three");
<BR>>>
OSGeo.FDO.Schema.DataPropertyDefinition DataProp4
<BR>>> = new OSGeo.FDO.Schema.DataPropertyDefinition("Prop4", "Property
four"); <BR>>>
DataProp1.DataType = <BR>>>
OSGeo.FDO.Schema.DataType.DataType_Int32; <BR>>>
DataProp1.IsAutoGenerated = true; <BR>>>
DataProp1.Nullable =
false; <BR>>> <BR>>>
DataProp2.DataType = <BR>>>
OSGeo.FDO.Schema.DataType.DataType_Decimal; <BR>>>
DataProp2.IsAutoGenerated = false; <BR>>>
DataProp2.Nullable =
false; <BR>>>
DataProp2.ReadOnly = false; <BR>>>
<BR>>>
DataProp3.DataType = <BR>>>
OSGeo.FDO.Schema.DataType.DataType_Decimal; <BR>>>
DataProp3.IsAutoGenerated = false; <BR>>>
DataProp3.Nullable =
false; <BR>>>
DataProp3.ReadOnly = false; <BR>>>
<BR>>>
DataProp4.DataType = <BR>>>
OSGeo.FDO.Schema.DataType.DataType_String; <BR>>>
DataProp4.IsAutoGenerated = false; <BR>>>
DataProp4.Nullable =
false; <BR>>>
DataProp4.ReadOnly = false; <BR>>>
DataProp4.Length = 20; <BR>>> <BR>>>
//Class one data props
<BR>>>
ClassOne.Properties.Add(DataProp1); <BR>>>
ClassOne.IdentityProperties.Add(DataProp1); <BR>>>
ClassOne.Properties.Add(DataProp2); <BR>>>
ClassOne.Properties.Add(DataProp3); <BR>>>
ClassOne.Properties.Add(DataProp4); <BR>>> <BR>>> <BR>>>
<BR>>> OSGeo.FDO.Connections.Capabilities.IConnectionCapabilities
connCap = <BR>>> conn.ConnectionCapabilities; <BR>>>
ITransaction fdoTrans = null; <BR>>>
if
(connCap.SupportsTransactions()) <BR>>>
fdoTrans
= conn.BeginTransaction(); <BR>>> <BR>>>
using
(OSGeo.FDO.Commands.Feature.IInsert insert <BR>>> =
conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Insert)
<BR>>> as OSGeo.FDO.Commands.Feature.IInsert) <BR>>>
{
<BR>>> <BR>>>
for (int nIndex = 1; nIndex
< 5; nIndex++) <BR>>>
{ <BR>>>
<BR>>>
OSGeo.FDO.Commands.PropertyValue <BR>>> PropValue1 = null; <BR>>>
PropValue1 = new <BR>>>
OSGeo.FDO.Commands.PropertyValue(); <BR>>>
PropValue1.SetName(DataProp1.Name); <BR>>>
PropValue1.Value = new <BR>>>
OSGeo.FDO.Expression.Int32Value(nIndex); <BR>>>
insert.PropertyValues.Add(PropValue1); <BR>>> <BR>>>
PropValue1 = null; <BR>>>
PropValue1 = new <BR>>>
OSGeo.FDO.Commands.PropertyValue(); <BR>>>
PropValue1.SetName(DataProp2.Name); <BR>>>
PropValue1.Value = new <BR>>>
OSGeo.FDO.Expression.DecimalValue(1000.50 + nIndex); <BR>>>
insert.PropertyValues.Add(PropValue1);
<BR>>> <BR>>>
PropValue1 =
null; <BR>>>
PropValue1 = new
<BR>>> OSGeo.FDO.Commands.PropertyValue(); <BR>>>
PropValue1.SetName(DataProp3.Name); <BR>>>
PropValue1.Value = new <BR>>>
OSGeo.FDO.Expression.DecimalValue(2000.50 + nIndex); <BR>>>
insert.PropertyValues.Add(PropValue1);
<BR>>> <BR>>>
PropValue1 =
null; <BR>>>
PropValue1 = new
<BR>>> OSGeo.FDO.Commands.PropertyValue(); <BR>>>
PropValue1.SetName(DataProp4.Name); <BR>>>
PropValue1.Value = new <BR>>>
OSGeo.FDO.Expression.StringValue("Note"+nIndex.ToString()); <BR>>>
insert.PropertyValues.Add(PropValue1);
<BR>>> <BR>>>
try
<BR>>>
{ <BR>>>
using <BR>>>
(OSGeo.FDO.Commands.Feature.IFeatureReader reader = insert.Execute())
<BR>>>
{ <BR>>>
while
(reader.ReadNext()) { } <BR>>>
} <BR>>>
} <BR>>>
catch (Exception ex) <BR>>>
{ <BR>>>
//throw new <BR>>> FeatureServiceException("Error inserting new
feature", ex); <BR>>>
MessageBox.Show(ex.Message); <BR>>>
}
<BR>>>
} <BR>>>
} <BR>>>
if (connCap.SupportsTransactions()) <BR>>>
fdoTrans.Commit(); <BR>>>
conn.Close(); <BR>>>
<BR>>> <BR>>> <BR>> <BR>> </DIV></div>-- <BR>View this message
in context: <A href="http://n2.nabble.com/inserting-data-into-a-SDF-file-tp2349739p2356982.html" rel="nofollow" target=_top>http://n2.nabble.com/inserting-data-into-a-SDF-file-tp2349739p2356982.html</A><BR>Sent
from the FDO Users mailing list archive at Nabble.com.
<BR><BR>_______________________________________________ <BR>fdo-users mailing
list <BR><A href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2358773&i=3" rel="nofollow" target=_top>fdo-users@...</A> <BR><A href="http://lists.osgeo.org/mailman/listinfo/fdo-users" rel="nofollow" target=_top>http://lists.osgeo.org/mailman/listinfo/fdo-users</A><BR>_______________________________________________
<BR>fdo-users mailing list <BR><A href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2358773&i=4" rel="nofollow" target=_top>fdo-users@...</A> <BR><A href="http://lists.osgeo.org/mailman/listinfo/fdo-users" rel="nofollow" target=_top>http://lists.osgeo.org/mailman/listinfo/fdo-users</A><BR></BLOCKQUOTE>
<BR>
<BR>
<P><B><FONT SIZE=1 FACE="Arial">The information contained in this message is intended only for the recipient, and may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and delete it from your system. Eagle Point reserves the right, subject to applicable local law, to monitor and review the content of any electronic message or information sent to or from Eagle Point employee e-mail addresses without informing the sender or recipient of the message. </FONT></B></P>
<BR>
<BR>
<br><hr align="left" width="300">
View this message in context: <a href="http://n2.nabble.com/inserting-data-into-a-SDF-file-tp2349739p2358800.html">RE: [fdo-users] inserting data into a SDF file</a><br>
Sent from the <a href="http://n2.nabble.com/FDO-Users-f2048584.html">FDO Users mailing list archive</a> at Nabble.com.<br>