Field names abbreviated for ESRI Shapefile driver

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

Field names abbreviated for ESRI Shapefile driver

Miluji Sb
Greetings,

i am trying to export a shapefile using the following command;

st_write(weight.sf, "weight.shp, driver="ESRI Shapefile")

But getting the following warning;

1: In abbreviate_shapefile_names(obj) :
  Field names abbreviated for ESRI Shapefile driver

The variable names have the following pattern; "weight_2010" but
become like this "w__201". How can I preserve field/variable names? Thank
you.

Best regards,

Milu

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Field names abbreviated for ESRI Shapefile driver

Joe Lewis
Hi  Milu,

It is not possible to preserve your field/variable name when creating ESRI
shapefiles as the maximum length of field names is limited to 10 character.

See https://community.esri.com/thread/63279

I believe the geopackage format does not have the 10 character limit, so
you may want to try that.

Hope it helps.

Kind regards,
Joseph Lewis

On Sun, Apr 19, 2020 at 4:38 PM Miluji Sb <[hidden email]> wrote:

> Greetings,
>
> i am trying to export a shapefile using the following command;
>
> st_write(weight.sf, "weight.shp, driver="ESRI Shapefile")
>
> But getting the following warning;
>
> 1: In abbreviate_shapefile_names(obj) :
>   Field names abbreviated for ESRI Shapefile driver
>
> The variable names have the following pattern; "weight_2010" but
> become like this "w__201". How can I preserve field/variable names? Thank
> you.
>
> Best regards,
>
> Milu
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Field names abbreviated for ESRI Shapefile driver

Bede-Fazekas Ákos
In reply to this post by Miluji Sb
Dear Milu,
ESRI shapefile format cannot contain field names longer than 10
characters. So you should do one of the following options:
- choose other file format when saving the data,
- rename the columns of the sf object before saving.

HTH,
Ákos Bede-Fazekas
Hungarian Academy of Sciences


2020.04.19. 17:37 keltezéssel, Miluji Sb írta:

> Greetings,
>
> i am trying to export a shapefile using the following command;
>
> st_write(weight.sf, "weight.shp, driver="ESRI Shapefile")
>
> But getting the following warning;
>
> 1: In abbreviate_shapefile_names(obj) :
>    Field names abbreviated for ESRI Shapefile driver
>
> The variable names have the following pattern; "weight_2010" but
> become like this "w__201". How can I preserve field/variable names? Thank
> you.
>
> Best regards,
>
> Milu
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Field names abbreviated for ESRI Shapefile driver

Miluji Sb
Dear Akos and Joe,

Thank you for your kind replies and the information. I did not know about
the character limit, it is easier for me to shorten the variable names.
Thank you again and stay safe.

Best,

Milu

On Sun, Apr 19, 2020 at 5:58 PM Bede-Fazekas Ákos <[hidden email]>
wrote:

> Dear Milu,
> ESRI shapefile format cannot contain field names longer than 10
> characters. So you should do one of the following options:
> - choose other file format when saving the data,
> - rename the columns of the sf object before saving.
>
> HTH,
> Ákos Bede-Fazekas
> Hungarian Academy of Sciences
>
>
> 2020.04.19. 17:37 keltezéssel, Miluji Sb írta:
> > Greetings,
> >
> > i am trying to export a shapefile using the following command;
> >
> > st_write(weight.sf, "weight.shp, driver="ESRI Shapefile")
> >
> > But getting the following warning;
> >
> > 1: In abbreviate_shapefile_names(obj) :
> >    Field names abbreviated for ESRI Shapefile driver
> >
> > The variable names have the following pattern; "weight_2010" but
> > become like this "w__201". How can I preserve field/variable names? Thank
> > you.
> >
> > Best regards,
> >
> > Milu
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > [hidden email]
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo