I have a large shapefile (1 gb) and need to rasterise it. I have tried the following already.
1.) Import it into GRASS using v.in.ogr
this failed with the error message: ERROR: G_realloc: unable to allocate 498240036 bytes at break_polygons.c:188
2.) My second idea was to use PostGIS. Import the shapefile, resample it at the x,y location of the grid and then export these points and create a grid from xyz. I successfully imported the shapefiles (polygons and points) but intersecting 1 million polygons with 300k points seems to be very slow. I used the following PostGIS satement, maybe there is room for improvement.
select polygons.land_id,grid.geom from grid,polygons where grid.geom && polygons.geom and within(grid.geom,polygons.geom)
3.) I did also try to use simplify()
in PostGIS. But I lost to many small polygons (i.e. some areas that were covered only with small polygons became null).
Any ideas would be greatly appreciated.