Crop raster from vector problem

المشرف العام

Administrator
طاقم الإدارة
So I have a shapefile of a vector for Philadelphia's city lines and a raster image of Philadelphia county that I got from the lovely people from USDA:NRCS. I converted the raster from a sid file to tif (using gdal_translate) and then reprojected the newly converted raster tif to 3857 (using gdalwarp).

This new raster now has the same native projection as the vector for the city limits: EPSG:3857. So I load both the shapefile for the city limits and this new raster tif that I prepped into QGIS and I fire up that useful clipper tool (Raster->Extraction->Clipper) and I go about my business of setting the raster as the source and selecting the vector as my mask layer and press "OK". #thatwassimple. The computer starts chugging along doing its thing and I'm getting pumped about my new raster coming in.

Ding! computer finished...only South Philly and a tiny part of Central Philly are extracted out--West, North, and East Philly seem to have ducked out of the party and it's all black.

Hm...that's weird, maybe I can use GDAL command line to force this, because you know, if it's done on the command line, I am a real hacker and it's not like QGIS is already doing this in the background, but I digress.

So I cmd those mofos (using gdalwarp again!) 0...10....100! DING! Alright, alright, alright, as I McConaughey myself over to the directory that I outputted the clipped tif. Open that sucker up and I'm with the exact same output of Southside and Central only left to represent.

I've attached two images, the first shows a rose colored polygon that I want to cut out of the raster, and the second shows the output both times.

Photo 1:

Photo 2:

Thanks in advance



أكثر...
 
أعلى