fwiw, a method with geodata/terra

cyp <- geodata::gadm(country = c("CYP", "XNC"), path = tempdir(), version =
"3.6")

terra::aggregate(cyp)

see ?terra::writeVector to write it out

(rgdal is very old and you should abandon it, it will be removed from
support by the end of this year)


(just as an aside, we can't hit the geodata vector urls directly with gdal
as we can with the rasters, as they are in an R specific format)

Cheers, Mike


On Fri, Apr 28, 2023 at 10:52 AM Ben Tupper <btup...@bigelow.org> wrote:

> Hi,
>
> You might try st_union() from the sf package
> https://r-spatial.github.io/sf/articles/sf3.html#geometrical-operations
>
>
>
> On Thu, Apr 27, 2023 at 5:37 PM Miluji Sb <miluj...@gmail.com> wrote:
>
> > Dear all,
> >
> > I am using the country-level shapefile from GADM. I would like to merge
> > Cyprus and North Cyprus into one polygon. Is this possible? I am using
> > rgdal to read the shapefile, subset, and then rewrite it. Any help will
> be
> > highly appreciated.
> >
> > ##
> > world <- readOGR("~/gadm36_levels_shp", layer = "gadm36_0")
> >
> > Best regards,
> >
> > Milu
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsum...@gmail.com

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to