Hi,
>
> What do you do with the attributes? Do you discard them all for the whole
> layer or do you give them to features as long as they last and then fill null
> attributes for the remaining orphan features?
>> Second option, I fill null attributes for remaining orphans. When the dbf 
>> exists,
>> the main loop stopped after the last record. I just added a supplementary 
>> loop
>> to step over remaining shapes.
>>> I guess that extra features are often the last shapes is .shp and then the 
>>> first
>>> alternative would feel fine, but it is also possible that the extra 
>>> features are in
>>> the beginning of the .shp or then somebody just deleted a row from the 
>>> middle
>>> of .dbf file with OpenOffice or something.
>>>
>>> If I remember right, shape file format does not use IDs for joins but it 
>>> behaves
>>> in a similar way than the ArcInfo generate format by just taking the first 
>>> shape
>>> from .shp and pairing it with the first row in .dbf and going on with the 
>>> second
>>> shape and second line in .dbf and so on. So if .shp and .dbf get 
>>> unsynchronised
>>> all the attributes after that point will go to wrong features.
>> Yes, that is also my understanding of the format specification. So I
>> suppose that additional shapes are the one at the end of the shapefile.
>> I don't think we can do much more.
> Yes, I believe too that new shapes are added to the end of the shapefile. But 
> how can you ever know if there are too many shapes or too few lines in the 
> dbf file?  I believe that the lenient reader for unpaired shapes/attributes 
> may contain a seed for a total catastrophe.  What happens in the real world 
> is that people realize that they can edit the dbf files with Excel or 
> OpenOffice Calc and it they then delete a row from the middle of the file the 
> result will be a total mess.  Of course that can happen also with the correct 
> number of rows if users think for example that it would be brilliant idea to 
> sort the dbf file according to some attribute but for that we can do nothing.
At one point, we can do nothing more to save the data or even guess it 
is corrupted.
I just noticed that the problem I addressed was already partially adress :
dbf > shapefile ==> already throwed exception
shapefile > dbf ==> stopped silently at the end of the dbf (now continue 
silently after the end of the dbf).
> I am not against the new behaviour but we should show a very clear and very 
> understandable error message for the users in case of unpaired number of 
> shapes and attributes.
I'll think about it. Curently, I just log an error in the log file.
I can add a (yellow) warning and/or a log in the output window, but I'm 
not sure if I can
do it easily as at this stage, I have no handle on the UI.
I'll also try to make both cases dbf>shp and shp>dbf more consistent.

I want to avoid a modal dialog which could stop processes like project 
or zip file opening,
> I hope that your corrupted shapefile was not created by OpenJUMP.
Hopefully not. But as I have been reported this shapefile is "entirely" 
read by
arcgis and not by OpenJUMP, I investigated as soon as I could ;-)

Michaël
>
> -Jukka Rahkonen-
>
>> Thanks for the feedback,
>>
>> Michaël
>>> -Jukka Rahkonen-
>>>
>>>
>>> ________________________________________
>>> Michaël Michaud wrote:
>>>
>>>> Hi,
>>>> This is the second time I have to deal with a "corrupted" shapefile
>>>> with more shapes in the shp than records in the dbf.
>>>> I made a patch to read all geometries in this case (and log the error).
>>>> Please check that you still can read your preferred shapefile as before.
>>>> Michaël
>>> ------------------------------------------------------------------------------
>>> October Webinars: Code for Performance
>>> Free Intel webinars can help you accelerate application performance.
>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
>> from
>>> the latest Intel processors and coprocessors. See abstracts and register >
>>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> Jump-pilot-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>
>>> ------------------------------------------------------------------------------
>>> October Webinars: Code for Performance
>>> Free Intel webinars can help you accelerate application performance.
>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
>> from
>>> the latest Intel processors and coprocessors. See abstracts and register >
>>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> Jump-pilot-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
>> the latest Intel processors and coprocessors. See abstracts and register >
>> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to