[mapguide-users] Request for help inserting new row into SDF file.

Dave Wilson dave.wilson at autodesk.com
Wed Feb 28 10:25:04 EST 2007


A geometry property is optional.

More importantly is the existing SDF ReadOnly? If you do a
DescribeSchema on it is it listed as ReadOnly? Although to be honest I'm
not sure the code honors that property. Is the id property of the SDF
autogenerated or do you have to supply the value? How was the SDF
generated?

I can't see anything immediately wrong with the code snippet.

Is it possible that you are inserting a duplicate key value? That will
fail silently (known bug).

Dave


-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Jackie Ng
Sent: Tuesday, February 27, 2007 5:32 PM
To: mapguide-users at lists.osgeo.org
Subject: Re: [mapguide-users] Request for help inserting new row into
SDF file.


I don't think you can insert data without a geometry component in SDF
files.

- Jackie


Matthew D wrote:
> 
> I am attempting to insert a feature/record into an SDF file.  The 
> record does not have any geometry.
> 
> I have no problem returning data from this code $featureReader = 
> $featureService->SelectFeatures($featureResId, $class, $queryOptions);
> 
> 
> The insert method doesn't seem to work AND does not give any error 
> messages why not.
> 
> $propertyValues = new MgPropertyCollection(); $propertyValues->Add(new

> MgInt64Property('mow_id', 3)); $propertyValues->Add(new 
> MgInt64Property('seg_id', 2231)); $propertyValues->Add(new 
> MgInt16Property('percent_required', 100)); $propertyValues->Add(new 
> MgStringProperty('contractor', 'Mow Machine 65')); 
> $propertyValues->Add(new MgStringProperty('mow_date', '20070202')); 
> $propertyValues->Add(new MgStringProperty('comments', 'Some 
> comments'));
> 		
> $commands = new MgFeatureCommandCollection(); $commands->Add(new 
> MgInsertFeatures($class, $propertyValues));
>        
> $featureService->UpdateFeatures($featureResId, $commands, false);
> 
> Could someone tell me if there is something I am missing, or if there 
> is some way to find out why this is not working?
> 
> Thanks,
> 
> Matt
> 

--
View this message in context:
http://www.nabble.com/Request-for-help-inserting-new-row-into-SDF-file.-
tf3303740s16610.html#a9195532
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users



More information about the mapguide-users mailing list