I have a large polygon file in the form of .gdb (mygdb
, ~10gb) and I need to crop it using another polygon shapefile (myshp
, ~10mb). I want to do this PostGIS database using R so that it will be faster and R won't crash. I already have them exported to my postGIS database. (say, schema = myschema
, table = mytab1
for mygdb
and table = mytab2
for myshp
) I know if I have them locally saved I can do using sf::st_intersection(x,y)
. But I am finding it hard to find any proper help on how to do this without importing them in R. I understand I need to write some SQL
code inside the st_intersection
to do this in PostGIS database without importing them again in R. I am a beginner in SQL
and not sure what exactly to write inside the function. Could somebody please help me with this?
st_intersection
function at all.