[mapguide-users] Permanent changes in data - Solved

Stefan Dalakov s.dalakov at mapware.net
Tue Dec 2 07:17:01 EST 2008


I solved it. The problem was that MG Studio shows that the ID field is 
of type "Double". In the DBF file (as this is a shp Feature source) the 
ID field is declared as N,11,0
So I substituted *MgDoubleProperty *with* **MgInt32Property* and it 
works now.

Stefan Dalakov


Kenneth Skovhede, GEOGRAF A/S wrote:
> Could it be that "ID" is the primary key, and if you insert two 
> features with ID 11,
> it breaks? Or that the ID is auto-assigned, and thus not assignable 
> from MapGuide/FDO?
>
> btw, things tend to work better with MapGuide if your primary key is 
> an integer.
> Regards, Kenneth Skovhede, GEOGRAF A/S
>   
>
>
> Stefan Dalakov skrev:
>> It is something stupid, but I cannot spot it...
>> Everything works if I omit the bold part of the code :
>>
>>   function MakeLine($name, $x0, $y0 , $x1, $y1)
>>   {
>>     $propertyCollection = new MgPropertyCollection();
>> *    $cntr = (double) 11.0 ;
>>     $idProperty = new MgDoubleProperty("ID",$cntr);
>>     $propertyCollection->Add($idProperty);
>> *    $owner = "Aaa" ;
>>     $ownerProperty = new MgStringProperty("Owner", $owner);
>>     $propertyCollection->Add($ownerProperty);
>>     $nameProperty = new MgStringProperty("Purpose", $name);
>>     $propertyCollection->Add($nameProperty);
>>     $wktReaderWriter = new MgWktReaderWriter();
>>     $agfReaderWriter = new MgAgfReaderWriter();
>>     $agftext = "LINESTRING XY ($x0 $y0, $x1 $y1)" ;
>>     $geometry = $wktReaderWriter->Read( $agftext);
>>     $geometryByteReader = $agfReaderWriter->Write($geometry);
>>     $geometryProperty = new MgGeometryProperty("Geometry", 
>> $geometryByteReader);
>>     $propertyCollection->Add($geometryProperty);
>>     return $propertyCollection;
>>   }
>>
>> MG Studio says this property is Double
>>
>> Stefan Dalakov
>>
>>
>> Kenneth Skovhede, GEOGRAF A/S wrote:
>>> You could be affected by this bug:
>>> http://trac.osgeo.org/mapguide/ticket/649
>>>
>>> Otherwise, try to post a section of the code,
>>> maybe someone will spot something obvious.
>>>
>>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>>
>>>
>>>
>>> Stefan Dalakov skrev:
>>>> Hi all,
>>>> I am trying to add a feature (permanently) to a data source.
>>>> I am using MGOS 1.2 and tried Sheboygan samples, where this part is 
>>>> not working, I have not explored the reason yet.
>>>> My idea is to digitize a feature ( a line ) and add it permanently 
>>>> to an existing layer on the map.
>>>> I wrote some code, and everything seems OK, no errors,  but at the 
>>>> end I have no feature added.
>>>> Can someone help with a piece of code ?
>>>>
>>>> Thanks in advance
>>>> Stefan Dalakov
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>> _______________________________________________
>>> mapguide-users mailing list
>>> mapguide-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20081202/a60ea429/attachment.html


More information about the mapguide-users mailing list