I would like to download OSM data and convert it to shapefile and change
coordinates to same as Landsat data.
I'm following the code bellow.
Is this the correct way for saving/writing to swapfile the OSM data?
Thanks a lot for your response.
> Dear users,
> I would like to download OSM data and convert it to shapefile and change
> coordinates to same as Landsat data.
> I'm following the code bellow.
> Is this the correct way for saving/writing to swapfile the OSM data?
Since you are using the sf package, why not use it for the other
operations? There is no need to involve sp or rgdal unless you want to for
some other reason. Maybe you are copying from an old blog or SO source?
Have you visited: https://www.r-spatial.org/ with plenty of posts on
migrating to sf?
With regard to coordinate operations, you (and everybody else) will need
to find out how to define CRS without using Proj.4 strings; this change is
coming soon! Yours looks like EPSG:32636. Both sf and sp will be moving
very soon to WKT2-2019 from Proj.4 strings (Proj.4 strings will still be
available, but datums and other specification components may simply drop
out without warning because of changes in PROJ and GDAL).
Finally, stop using shapefiles and change to GeoPackage straight away,
there is no reason to continue to use a format past its end-of-life.
> Thanks a lot for your response.
> # Paris administrative borders ID
> dat2 <- opq_osm_id (type = "relation", id = id) %>%
> opq_string () %>%
> osmdata_sf ()
> st_write(dat2$osm_multipolygons, "s.shp")
> # change coordinate system to Landsat data
> landst_crs= "+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs +ellps=WGS84
> S <- spTransform(s, CRS(landst_crs))
> writeOGR( obj = S, dsn = '/Users/gcotlier/Desktop',layer = "S1", driver =
> "ESRI Shapefile")
> [[alternative HTML version deleted]]
> R-sig-Geo mailing list
> [hidden email] > https://stat.ethz.ch/mailman/listinfo/r-sig-geo >