[Qgis-user] Reduce the file size of the shape file

Hervé Furstoss herve.furstoss at gmail.com
Wed Jun 30 03:59:31 PDT 2021


Hello,

I have noticed that some tools of Qgis sets the size of the data in the 
attribute table to its maximum (64) when processing the data. This will 
increase the size of shapefile but just one file is concerned the dbf 
file. A way to reduce the size of the shapefile can be to reduce that 
size of the data in the dbf file.

It can be easely done by opening the dbf file with libreoffice. It gives 
access to the data size in the first line of each column and you can 
adjust the data size.
ie : If an attribute is : Nature,C,25 this correspond to the name of the 
attribute, its type and its size in the table.
After the data processing each attribute size can be set to 64  : 
Nature,C,64 but it can be changed to the original value with the software.

Hope it will help you.

Le 30/06/2021 à 06:26, Nicolas Cadieux a écrit :
> Hi,
>
> If you have made a shortest path analysis like a one to all or an all 
> to all, then multiple paths will be created.  Select and object then 
> look at the attribute table. Sort them to the top. There is a sorting 
> icon for this.  You will see that you probably have multiple 
> overlapping path selected. Send a screen shot or the file and I can 
> take a look at it tomorrow morning. I am in Montreal time.
>
> Nicolas Cadieux
> https://gitlab.com/njacadieux <https://gitlab.com/njacadieux>
>
>> Le 29 juin 2021 à 20:26, krishna Ayyala <ayyalakrishna at gmail.com> a 
>> écrit :
>>
>> 
>> Nicolas,
>> Thanks for your reply. Changing the field format and saving to a 
>> different file format did not work for me. Just now, I noticed that, 
>> Whenever I select one line feature for the "ShortestPath" shapefile, 
>> I see the following message at the bottom left corner of the window. 
>> For example: "2148 feature(s) selected on layer shortest path. i.e. 
>> More than one features appear at the bottom left corner for each line 
>> that I select. I am trying to figure out how this will appear as 1 
>> feature instead of 2148 features.The tools such as simplify and 
>> dissolve did not work for me.
>>
>> Regards.
>>
>> On Tue, Jun 29, 2021 at 4:43 PM Nicolas Cadieux 
>> <njacadieux.gitlab at gmail.com <mailto:njacadieux.gitlab at gmail.com>> wrote:
>>
>>     Hi,
>>
>>     To my knowledge no.  You could simplify the geometries but that
>>     would probably come with a resolution penalty (missing nodes). 
>>     You could perhaps change the field data type.  For example, an
>>     int data type will probably use less space than a float with a 16
>>     decimal value.  A text field can be reduced to the minimum size
>>     needed.  You can also try to save the file under an other name. 
>>     Depending on where the file was created and used, saving the file
>>     could “permanently delete” some previous deleted components.  Can
>>     you use another file format?
>>
>>     Nicolas Cadieux
>>     https://gitlab.com/njacadieux <https://gitlab.com/njacadieux>
>>
>>>     Le 29 juin 2021 à 15:53, krishna Ayyala <ayyalakrishna at gmail.com
>>>     <mailto:ayyalakrishna at gmail.com>> a écrit :
>>>
>>>     
>>>     Hello,
>>>     I have a "Streets" shape file of a state with about 12000 lines.
>>>     For the same geographic area I have "Blocks_Centroids" shape
>>>     file of about 6000 points. I ran the tool as shown below. It
>>>     resulted in a shapefile "ShortestPath" with 6000 lines. The size
>>>     of the "Streets" shape file with 12000 lines is 5000 KB. Whereas
>>>     the size of the output shape file "ShortestPath" with only 6000
>>>     lines is 270,000 KB. Is there a way to reduce the file size? The
>>>     reason is I need to upload this in a different platform which
>>>     cannot accept shapefiles larger than 10,000 KB.
>>>
>>>     <image.png>
>>>
>>>     _______________________________________________
>>>     Qgis-user mailing list
>>>     Qgis-user at lists.osgeo.org <mailto:Qgis-user at lists.osgeo.org>
>>>     List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>>>     Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210630/0c116160/attachment.html>


More information about the Qgis-user mailing list