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 TIFF (using gdal_translate) and then reprojected the newly converted raster TIFF 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 TIFF. 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.
SOURCE FILES
Shapefile used (in zip)
TIFF used (in zip)
UPDATE: I noticed that the clipped areas are actually in fact regions outside of the city and just cuts north of the city. (Note south philly no longer has Schuylkill River going through it). I tried making a polygon of this so I could upload an image for clarity, but I couldn't figure it out. Please just replicate the raster clipping with the files provided above and you too can see what I'm talking about.
This leads me to believe that there must be a projection problem, however, after I gdalinfo-ed the raster and consulting the .prj of the city_limits file, I've confirmed that they have the same aforementioned projection. #sayhwatt
gdalwarp -cutline city_limits.shp -crop_to_cutline philly_3857.tif philly_cropped.tif