SHP modifications issue

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

SHP modifications issue

ytse
I'm using FDO 3.0 to modify (insert/update/delete) an
SHP.
Everything's fine, I can read/write the SHP as I want
to.
My issue occurs when I try to read the SHP using
either ArcView or Mapguide viewer, they are able to
display deleted objects or won't diplay newly added
objects.
If I edirt the DBF file I can actually see that my
deleted objects are still within, tagged by a "*"

Am I missing a step, like a "save" (commit?) command ?

Note that I'm not using fdo transactions (not an SHP
capability)

I'm really stuck and don't understand what's
happening, I'm really requiring your help here as
that's quite urgent, I have to present a beta version
of my current work this week and that's the only
remaining trouble :((

Bye & thx in advance




       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: SHP modifications issue

Dan Stoica
Hi,

The files are flushed when the connection is closed.
The DBF file is compressed (i.e. get rid of the deleted rows) when all the connections are closed.

Also, SHP connection has a method Flush() which can be used programatically.

Which one is the case here?

Dan.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ytse
Sent: Tuesday, January 16, 2007 3:56 AM
To: [hidden email]
Subject: [fdo-users] SHP modifications issue

I'm using FDO 3.0 to modify (insert/update/delete) an
SHP.
Everything's fine, I can read/write the SHP as I want
to.
My issue occurs when I try to read the SHP using
either ArcView or Mapguide viewer, they are able to
display deleted objects or won't diplay newly added
objects.
If I edirt the DBF file I can actually see that my
deleted objects are still within, tagged by a "*"

Am I missing a step, like a "save" (commit?) command ?

Note that I'm not using fdo transactions (not an SHP
capability)

I'm really stuck and don't understand what's
happening, I'm really requiring your help here as
that's quite urgent, I have to present a beta version
of my current work this week and that's the only
remaining trouble :((

Bye & thx in advance




       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: SHP modifications issue

Pierre Dalcourt
In reply to this post by ytse
I believe this issue was fixed in FDO 3.1 in June 2006.
(Our internal defect number for this was 783647.01)

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ytse
Sent: January 16, 2007 3:56 AM
To: [hidden email]
Subject: [fdo-users] SHP modifications issue

I'm using FDO 3.0 to modify (insert/update/delete) an
SHP.
Everything's fine, I can read/write the SHP as I want
to.
My issue occurs when I try to read the SHP using
either ArcView or Mapguide viewer, they are able to
display deleted objects or won't diplay newly added
objects.
If I edirt the DBF file I can actually see that my
deleted objects are still within, tagged by a "*"

Am I missing a step, like a "save" (commit?) command ?

Note that I'm not using fdo transactions (not an SHP
capability)

I'm really stuck and don't understand what's
happening, I'm really requiring your help here as
that's quite urgent, I have to present a beta version
of my current work this week and that's the only
remaining trouble :((

Bye & thx in advance




       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: SHP modifications issue

Robert Fortin
In reply to this post by ytse

There was an issue in 3.0 with deleted feature.  The feature were only tagged as deleted and never removed from the shp/dbf file. This mean they were initially visible in ArcView until you did a refresh in which case they would be made invisible (but still present in the files).  

We fixed this in 3.1. The deleted feature will only be tagged as deleted until the connection is released at which point they will get removed from the dbf and shp file.

RF

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ytse
Sent: Tuesday, January 16, 2007 3:56 AM
To: [hidden email]
Subject: [fdo-users] SHP modifications issue

I'm using FDO 3.0 to modify (insert/update/delete) an SHP.
Everything's fine, I can read/write the SHP as I want to.
My issue occurs when I try to read the SHP using either ArcView or Mapguide viewer, they are able to display deleted objects or won't diplay newly added objects.
If I edirt the DBF file I can actually see that my deleted objects are still within, tagged by a "*"

Am I missing a step, like a "save" (commit?) command ?

Note that I'm not using fdo transactions (not an SHP
capability)

I'm really stuck and don't understand what's happening, I'm really requiring your help here as that's quite urgent, I have to present a beta version of my current work this week and that's the only remaining trouble :((

Bye & thx in advance




       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses http://fr.answers.yahoo.com _______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE : RE: SHP modifications issue

ytse
Thanks everyone (I'm including Dan & Pierre)

I've downloaded and built FDO 3.2 for Windows but I'm
not quite sure which DLL I have to use.
I've added references to the managed OSGEO.* DLL's in
my C# solution but when I try to build the website I
have a "unable to find specified module 0x8007007E"
error

That's one I had earlier and I found the cause at this
time, the unmanaged DLL's refered by the managed DLL's
have to be some place where windows can find them
(current directory, system directory, whatever
directory from the 'path' environment variable)

That was ok for my 3.0 use as soon as I had the
following directory added to my path :
C:\Program
Files\Autodesk\MapGuideEnterprise2007\Server\Bin\FDO

but now it won't work, so I guess I'm missing a couple
dlls in my FDO directory.

I've copied all the files from
- Fdo\Managed\bin\release
- Fdo\Unmanaged\bin\win32\release
- Providers\SHP\Managed\bin\release
- Providers\SHP\bin\win32\release
and that won't work
I've tried adding all the dlls that could be found in
"ThirdParty" subdirectories, that still won't build.

If anyone can redirect me to a list of all the
required dlls for an external windows application, I'd
really be glad.

Thanx again

--- Robert Fortin <[hidden email]> a
écrit :

>
> There was an issue in 3.0 with deleted feature.  The
> feature were only tagged as deleted and never
> removed from the shp/dbf file. This mean they were
> initially visible in ArcView until you did a refresh
> in which case they would be made invisible (but
> still present in the files).  
>
> We fixed this in 3.1. The deleted feature will only
> be tagged as deleted until the connection is
> released at which point they will get removed from
> the dbf and shp file.
>
> RF
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf
> Of Ytse
> Sent: Tuesday, January 16, 2007 3:56 AM
> To: [hidden email]
> Subject: [fdo-users] SHP modifications issue
>
> I'm using FDO 3.0 to modify (insert/update/delete)
> an SHP.
> Everything's fine, I can read/write the SHP as I
> want to.
> My issue occurs when I try to read the SHP using
> either ArcView or Mapguide viewer, they are able to
> display deleted objects or won't diplay newly added
> objects.
> If I edirt the DBF file I can actually see that my
> deleted objects are still within, tagged by a "*"
>
> Am I missing a step, like a "save" (commit?) command
> ?
>
> Note that I'm not using fdo transactions (not an SHP
> capability)
>
> I'm really stuck and don't understand what's
> happening, I'm really requiring your help here as
> that's quite urgent, I have to present a beta
> version of my current work this week and that's the
> only remaining trouble :((
>
> Bye & thx in advance
>
>
>
>
>
>
>
>
>
___________________________________________________________________________

> Découvrez une nouvelle façon d'obtenir des réponses
> à toutes vos questions !
> Profitez des connaissances, des opinions et des
> expériences des internautes sur Yahoo!
> Questions/Réponses http://fr.answers.yahoo.com
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
>



       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE : RE: SHP modifications issue

ytse
In reply to this post by Robert Fortin
Ok I've downloaded, built and installed FDO 3.2 now
But when I execute this piece of code
IProviderRegistry ipr =
FeatureAccessManager.GetProviderRegistry();
ProviderCollection pc = ipr.GetProviders();
I obtain pc.Count = 0 :((

What am I doing wrong ? I didn't have this issue
earlier with FDO 3.0



       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE : RE: SHP modifications issue

ytse
In reply to this post by Robert Fortin
Hi everyone

I've integrated FDO 3.2 in my software and everything
builds/runs fine now, but I still have issues with
FDO.

I've decided to write a small C# piece of code that
simply opens a connection, read a class and write its
content (I've attached to this mail a zip file that
contains the 3 files - dbf,shp,shx - for my shp source
and the .cs file that reads the shp)

The first issue is quite simple :
the shp contains 8 records (checked with Mapguide
viewer 6.5 and ArcView 3.2) but the IReader sees only
the records 2-8 (the first record from the file is
ignored).

Second issue :
I delete the last record that has been read, now
ArcView only sees records 2-7 !! (8 has been deleted,
that's correct, but what about the first ??)

I can only think of three possibilities :
- I'm doing something wrong
- there's a bug in FDO 3.2 SHPProvider
- the shp has an error (but considering that ArcView
and Mapguide Viewer can detect all 8 records, I guess
that's not the cause of the issue)

I'm desperately needing your help here (not even
mentionning inserting data, I'll test this later).









       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

TestFDO32.zip (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: RE : RE: SHP modifications issue

Dan Stoica
I'll have a look today.

Dan.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ytse
Sent: Monday, January 22, 2007 9:15 AM
To: Robert Fortin; Pierre Dalcourt; [hidden email]
Subject: RE : RE: [fdo-users] SHP modifications issue

Hi everyone

I've integrated FDO 3.2 in my software and everything
builds/runs fine now, but I still have issues with
FDO.

I've decided to write a small C# piece of code that
simply opens a connection, read a class and write its
content (I've attached to this mail a zip file that
contains the 3 files - dbf,shp,shx - for my shp source
and the .cs file that reads the shp)

The first issue is quite simple :
the shp contains 8 records (checked with Mapguide
viewer 6.5 and ArcView 3.2) but the IReader sees only
the records 2-8 (the first record from the file is
ignored).

Second issue :
I delete the last record that has been read, now
ArcView only sees records 2-7 !! (8 has been deleted,
that's correct, but what about the first ??)

I can only think of three possibilities :
- I'm doing something wrong
- there's a bug in FDO 3.2 SHPProvider
- the shp has an error (but considering that ArcView
and Mapguide Viewer can detect all 8 records, I guess
that's not the cause of the issue)

I'm desperately needing your help here (not even
mentionning inserting data, I'll test this later).









       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: RE : RE: SHP modifications issue

Robert Fortin
In reply to this post by ytse
It looks like MapGuide 6.5 and ArcView are not filtreing deleted record.  The DBF file has a flag to indicate that a record  has been deleted, if these application are not checking for this flag, this is when you will see more record than expected.  

What we noticed in the past is that on refresh, ArcView would actually look for the deleted record flag and erase objects from the display.  That's what you see on the 2nd issue after deleting record 8. The 1st record is probably marked as deleted when you begin. Now in ArcView when you delete the last record, it looks for delete record flag and remove not only the last record but the 1st one also.

The FDO SHP provider always look at the deleted record flag and therefore ignore deleted features.

RF

-----Original Message-----
From: Ytse [mailto:[hidden email]]
Sent: Monday, January 22, 2007 9:15 AM
To: Robert Fortin; Pierre Dalcourt; [hidden email]
Subject: RE : RE: [fdo-users] SHP modifications issue

Hi everyone

I've integrated FDO 3.2 in my software and everything builds/runs fine now, but I still have issues with FDO.

I've decided to write a small C# piece of code that simply opens a connection, read a class and write its content (I've attached to this mail a zip file that contains the 3 files - dbf,shp,shx - for my shp source and the .cs file that reads the shp)

The first issue is quite simple :
the shp contains 8 records (checked with Mapguide viewer 6.5 and ArcView 3.2) but the IReader sees only the records 2-8 (the first record from the file is ignored).

Second issue :
I delete the last record that has been read, now ArcView only sees records 2-7 !! (8 has been deleted, that's correct, but what about the first ??)

I can only think of three possibilities :
- I'm doing something wrong
- there's a bug in FDO 3.2 SHPProvider
- the shp has an error (but considering that ArcView and Mapguide Viewer can detect all 8 records, I guess that's not the cause of the issue)

I'm desperately needing your help here (not even mentionning inserting data, I'll test this later).









       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses http://fr.answers.yahoo.com

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: RE : RE: SHP modifications issue

Dan Stoica
In reply to this post by ytse
Hi,

The file in question has the 1st record deleted.

We decided that FDO should skip deleted records (that is, marked with an '*' in the .dbf).

As said before, SHP is also doing compression on -edited- files. By getting rid entirely of the deleted records we fix this unpleasant compatibility issue with ESRI tools.


Cheers,
Dan.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ytse
Sent: Monday, January 22, 2007 9:15 AM
To: Robert Fortin; Pierre Dalcourt; [hidden email]
Subject: RE : RE: [fdo-users] SHP modifications issue

Hi everyone

I've integrated FDO 3.2 in my software and everything
builds/runs fine now, but I still have issues with
FDO.

I've decided to write a small C# piece of code that
simply opens a connection, read a class and write its
content (I've attached to this mail a zip file that
contains the 3 files - dbf,shp,shx - for my shp source
and the .cs file that reads the shp)

The first issue is quite simple :
the shp contains 8 records (checked with Mapguide
viewer 6.5 and ArcView 3.2) but the IReader sees only
the records 2-8 (the first record from the file is
ignored).

Second issue :
I delete the last record that has been read, now
ArcView only sees records 2-7 !! (8 has been deleted,
that's correct, but what about the first ??)

I can only think of three possibilities :
- I'm doing something wrong
- there's a bug in FDO 3.2 SHPProvider
- the shp has an error (but considering that ArcView
and Mapguide Viewer can detect all 8 records, I guess
that's not the cause of the issue)

I'm desperately needing your help here (not even
mentionning inserting data, I'll test this later).









       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE : RE: RE : RE: SHP modifications issue

ytse
Thank you for your answer, thank you also Robert for
your previous answer (I'm replying here to both your
mails)

1.--------------------------------------------------

For my knowledge, what make you think that the first
row of this file is deleted ?
=> I don't see the '*' when I edit the dbf with and
hexadecimal editor (though I've been able to see them
earlier, if you refer to my first mail in this thread)

I've tested my code on 110 SHP files (2 completely
distinct class definition, though from the same french
public company) and it's always the same issue, FeatId
1 is ignored, so I guess there's either a bug in FDO's
ISelect/IReader interface or an issue with the SHP
structure of my files (but considering other viewers
can read them without troubles, I don't think so).
I've tried tracing the execution into the .cpp files
(I've added a breakpoint in mgISelectImp.cpp) but I'me
not confortable enough with FDO's internals to
understand what's happening.


Back to the first issue I had (I delete records using
FDO but am still able to see them in MGV/ArcView),
these rows should be physically deleted by the
compression algorithm but I can still see them (with
the '*', this time). I can't show you the code for
this as it's encapsulated within a couple classes, but
what could be wrong ? I've traced the code step by
step and I'm correctly closing the connection.

Here's the method I use to delete each record

public bool Delete(string className, string filter) {
 int n = 0;
 try {
  IDelete del =
(IDelete)this.connection.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Delete);
  del.SetFeatureClassName(className);
  if (!string.IsNullOrEmpty(filters))
del.SetFilter(filters);
  n = del.Execute();
 } catch {}
 return (n > 0);
}

I'm calling this once for each record to delete, then
I call this.connection.Close();
Am I forgetting something ?
I've tried calling this.connection.Flush() after each
edition (in my update / delete / insert methods) but
that doesn't change anything.

As a conclusion for this long mail, first of all I'd
like to thank you all again for your assistance.
I'm still requiring your help and I'm willing to do
all I can to make this go the right way, if you need
additionnal code or files I can pack this in a zip.

Pierre

--- Dan Stoica <[hidden email]> a écrit :

> Hi,
>
> The file in question has the 1st record deleted.
>
> We decided that FDO should skip deleted records
> (that is, marked with an '*' in the .dbf).
>
> As said before, SHP is also doing compression on
> -edited- files. By getting rid entirely of the
> deleted records we fix this unpleasant compatibility
> issue with ESRI tools.
>
>
> Cheers,
> Dan.


       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE : RE: RE : RE: SHP modifications issue

ytse
In reply to this post by Dan Stoica
A couple hours later, a couple additionnal news:
I've downloaded tons of SHP files on the web and I
have not been able to reproduce the "ignoring first
featId" error, but I've downloaded new SHP from the
public office that is my source (being the french
ministry for agriculture) and they still have the same
issue.

As both ArcView and Mapguide viewer are able to read
these files, I guess there must be a little something
that FDO can't notice regarding the SHP structure, if
anyone can try and have a look.

Now I also still have the logical deletion trouble
even with those shape files from internet, this issue
probably being related to a mystake in my code, if
anyone can help too (summary : the records are flaged
but not deleted)

I've attached a zip file containing my classes related
to FDO, if you're willing to have a look at it,
looking for a big mystake (this version includes the
forced call to .Flush())

Thank you all



       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

myFDO.zip (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: RE : RE: RE : RE: SHP modifications issue

Dan Stoica
1) about '*' flag:  I was wrong, the SHP provider is actually checking for  ' ' (space), i.e. valid record instead. The .dbf you send me contains a 0 (zero) in that position. From ESRI tools perpective it doesn't matter since they ignore the flag anyways.

Is is possible that all your SHP files are corrupted this way? How they have been generated, i.e. by using what tool?

2) Sorry, I have no clue why the compression mechanism is not triggered in managed code. In unmanaged code a simple cause would be a leaking connection.


Dan.



-----Original Message-----
From: Ytse [mailto:[hidden email]]
Sent: Tuesday, January 23, 2007 5:31 AM
To: Dan Stoica; Robert Fortin; Pierre Dalcourt; [hidden email]
Subject: RE : RE: RE : RE: [fdo-users] SHP modifications issue

Thank you for your answer, thank you also Robert for
your previous answer (I'm replying here to both your
mails)

1.--------------------------------------------------

For my knowledge, what make you think that the first
row of this file is deleted ?
=> I don't see the '*' when I edit the dbf with and
hexadecimal editor (though I've been able to see them
earlier, if you refer to my first mail in this thread)

I've tested my code on 110 SHP files (2 completely
distinct class definition, though from the same french
public company) and it's always the same issue, FeatId
1 is ignored, so I guess there's either a bug in FDO's
ISelect/IReader interface or an issue with the SHP
structure of my files (but considering other viewers
can read them without troubles, I don't think so).
I've tried tracing the execution into the .cpp files
(I've added a breakpoint in mgISelectImp.cpp) but I'me
not confortable enough with FDO's internals to
understand what's happening.


Back to the first issue I had (I delete records using
FDO but am still able to see them in MGV/ArcView),
these rows should be physically deleted by the
compression algorithm but I can still see them (with
the '*', this time). I can't show you the code for
this as it's encapsulated within a couple classes, but
what could be wrong ? I've traced the code step by
step and I'm correctly closing the connection.

Here's the method I use to delete each record

public bool Delete(string className, string filter) {
 int n = 0;
 try {
  IDelete del =
(IDelete)this.connection.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Delete);
  del.SetFeatureClassName(className);
  if (!string.IsNullOrEmpty(filters))
del.SetFilter(filters);
  n = del.Execute();
 } catch {}
 return (n > 0);
}

I'm calling this once for each record to delete, then
I call this.connection.Close();
Am I forgetting something ?
I've tried calling this.connection.Flush() after each
edition (in my update / delete / insert methods) but
that doesn't change anything.

As a conclusion for this long mail, first of all I'd
like to thank you all again for your assistance.
I'm still requiring your help and I'm willing to do
all I can to make this go the right way, if you need
additionnal code or files I can pack this in a zip.

Pierre

--- Dan Stoica <[hidden email]> a écrit :

> Hi,
>
> The file in question has the 1st record deleted.
>
> We decided that FDO should skip deleted records
> (that is, marked with an '*' in the .dbf).
>
> As said before, SHP is also doing compression on
> -edited- files. By getting rid entirely of the
> deleted records we fix this unpleasant compatibility
> issue with ESRI tools.
>
>
> Cheers,
> Dan.


       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE : RE: RE : RE: RE : RE: SHP modifications issue

ytse
1) you're the best, that's definitely the answer.
I checked 10 files manually and they all have 00 zero
instead of 20 space
I don't have the slightiest idea on how the files are
generated. Would that have sense to change the test
and look for records with this byte != '*' ? (I guess
the ministry won't change it's code for me :))
If it's not something that can be validated for FDO
3.2, could you at least tell me in which file I can
change this to rebuild everything and ensure that this
is it ?

2) you're not the best then ;)
I'll try to continue testing on "FDO valid" files,
from minimalistic code up to my classes.
If anyone else has any idea...

Anyway thanks again everyone !


--- Dan Stoica <[hidden email]> a écrit :

> 1) about '*' flag:  I was wrong, the SHP provider is
> actually checking for  ' ' (space), i.e. valid
> record instead. The .dbf you send me contains a 0
> (zero) in that position. From ESRI tools perpective
> it doesn't matter since they ignore the flag
> anyways.
>
> Is is possible that all your SHP files are corrupted
> this way? How they have been generated, i.e. by
> using what tool?
>
> 2) Sorry, I have no clue why the compression
> mechanism is not triggered in managed code. In
> unmanaged code a simple cause would be a leaking
> connection.
>
>
> Dan.
>
>
>


       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: RE : RE: RE : RE: RE : RE: SHP modifications issue

Dan Stoica
1) have a look at:

/providers/SHP/src/ShpRead/DataRow.cpp line #75:

    else if (cVALID_RECORD_ID != ((char*)buffer)[0])
        SetDeleted (true);

I have no problem changing it to:

    else if (cDELETED_RECORD_ID == ((char*)buffer)[0])
        SetDeleted (true);

2) Good luck :-)

Dan.

-----Original Message-----
From: Ytse [mailto:[hidden email]]
Sent: Tuesday, January 23, 2007 1:48 PM
To: Dan Stoica; Robert Fortin; Pierre Dalcourt; [hidden email]
Subject: RE : RE: RE : RE: RE : RE: [fdo-users] SHP modifications issue

1) you're the best, that's definitely the answer.
I checked 10 files manually and they all have 00 zero
instead of 20 space
I don't have the slightiest idea on how the files are
generated. Would that have sense to change the test
and look for records with this byte != '*' ? (I guess
the ministry won't change it's code for me :))
If it's not something that can be validated for FDO
3.2, could you at least tell me in which file I can
change this to rebuild everything and ensure that this
is it ?

2) you're not the best then ;)
I'll try to continue testing on "FDO valid" files,
from minimalistic code up to my classes.
If anyone else has any idea...

Anyway thanks again everyone !


--- Dan Stoica <[hidden email]> a écrit :

> 1) about '*' flag:  I was wrong, the SHP provider is
> actually checking for  ' ' (space), i.e. valid
> record instead. The .dbf you send me contains a 0
> (zero) in that position. From ESRI tools perpective
> it doesn't matter since they ignore the flag
> anyways.
>
> Is is possible that all your SHP files are corrupted
> this way? How they have been generated, i.e. by
> using what tool?
>
> 2) Sorry, I have no clue why the compression
> mechanism is not triggered in managed code. In
> unmanaged code a simple cause would be a leaking
> connection.
>
>
> Dan.
>
>
>


       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE : RE: RE : RE: RE : RE: RE : RE: SHP modifications issue

ytse
1) Ok I'll change this right after writing this mail
and I'll give it a go. Will you commit this correction
or do I have to keep in mind that I might have to
change this each time a new FDO version is released ?

2) still hoping :)

I think I really need to have a closer look at the FDO
internal, I can read C++ code but the thing is of
course that I don't know where to start :)

thank you again


--- Dan Stoica <[hidden email]> a écrit :

> 1) have a look at:
>
> /providers/SHP/src/ShpRead/DataRow.cpp line #75:
>
>     else if (cVALID_RECORD_ID != ((char*)buffer)[0])
>         SetDeleted (true);
>
> I have no problem changing it to:
>
>     else if (cDELETED_RECORD_ID ==
> ((char*)buffer)[0])
>         SetDeleted (true);
>
> 2) Good luck :-)
>
> Dan.



       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: RE : RE: RE : RE: RE : RE: RE : RE: SHP modifications issue

Dan Stoica
1) I'll drop this change, maybe today.

2) place a breakpoint in ShpConnection::~ShpConnection (void):

    // Do files compression (get rid of the deleted rows)
    CompressFileSets();

When your connection is released:
a) the desctuctor should be called
b) CompressFileSets() should find mGlobalRefCount == 1.

Cheers,
Dan.


-----Original Message-----
From: Ytse [mailto:[hidden email]]
Sent: Wednesday, January 24, 2007 4:04 AM
To: Dan Stoica; Robert Fortin; Pierre Dalcourt; [hidden email]
Subject: RE : RE: RE : RE: RE : RE: RE : RE: [fdo-users] SHP modifications issue

1) Ok I'll change this right after writing this mail
and I'll give it a go. Will you commit this correction
or do I have to keep in mind that I might have to
change this each time a new FDO version is released ?

2) still hoping :)

I think I really need to have a closer look at the FDO
internal, I can read C++ code but the thing is of
course that I don't know where to start :)

thank you again


--- Dan Stoica <[hidden email]> a écrit :

> 1) have a look at:
>
> /providers/SHP/src/ShpRead/DataRow.cpp line #75:
>
>     else if (cVALID_RECORD_ID != ((char*)buffer)[0])
>         SetDeleted (true);
>
> I have no problem changing it to:
>
>     else if (cDELETED_RECORD_ID ==
> ((char*)buffer)[0])
>         SetDeleted (true);
>
> 2) Good luck :-)
>
> Dan.



       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE : RE: RE : RE: RE : RE: RE : RE: RE : RE: SHP modifications issue

ytse
Hum I'm sorry but I don't know how to step into the
unmanaged code, I can't go further than

System::Void
NAMESPACE_OSGEO_FDO_CONNECTIONS::IConnectionImp::Close()
{
        EXCEPTION_HANDLER(GetImpObj()->Close())
}

in mgiconnectionimp.cpp

There probably is a leak somewhere as it works/fails
without logic : I can reproduce the same manipulation
several times in a row (delete all features but one)
and the result won't be the same.
The issue is probably somewhere in my code, I'll try
to find it by myself.

Now one last thing, I've talking about delete, update
is ok, but I have another issue with insert :
the new features are seen by ArcView 3.2 but not by
Mapguide viewer 6.5 (which the users of my app are
using). Any idea ?
...


--- Dan Stoica <[hidden email]> a écrit :

> 1) I'll drop this change, maybe today.
>
> 2) place a breakpoint in
> ShpConnection::~ShpConnection (void):
>
>     // Do files compression (get rid of the deleted
> rows)
>     CompressFileSets();
>
> When your connection is released:
> a) the desctuctor should be called
> b) CompressFileSets() should find mGlobalRefCount ==
> 1.
>
> Cheers,
> Dan.
>
>
> -----Original Message-----
> From: Ytse [mailto:[hidden email]]
> Sent: Wednesday, January 24, 2007 4:04 AM
> To: Dan Stoica; Robert Fortin; Pierre Dalcourt;
> [hidden email]
> Subject: RE : RE: RE : RE: RE : RE: RE : RE:
> [fdo-users] SHP modifications issue
>
> 1) Ok I'll change this right after writing this mail
> and I'll give it a go. Will you commit this
> correction
> or do I have to keep in mind that I might have to
> change this each time a new FDO version is released
> ?
>
> 2) still hoping :)
>
> I think I really need to have a closer look at the
> FDO
> internal, I can read C++ code but the thing is of
> course that I don't know where to start :)
>
> thank you again
>
>
> --- Dan Stoica <[hidden email]> a écrit :
>
> > 1) have a look at:
> >
> > /providers/SHP/src/ShpRead/DataRow.cpp line #75:
> >
> >     else if (cVALID_RECORD_ID !=
> ((char*)buffer)[0])
> >         SetDeleted (true);
> >
> > I have no problem changing it to:
> >
> >     else if (cDELETED_RECORD_ID ==
> > ((char*)buffer)[0])
> >         SetDeleted (true);
> >
> > 2) Good luck :-)
> >
> > Dan.
>
>
>
>
>
>
>
>
___________________________________________________________________________
>
> Découvrez une nouvelle façon d'obtenir des réponses
> à toutes vos questions !
> Profitez des connaissances, des opinions et des
> expériences des internautes sur Yahoo!
> Questions/Réponses
> http://fr.answers.yahoo.com
>



       

       
               
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users