Home > gdalwarp > How do I make gdalwarp set target extents to -180 -90 180 90?

How do I make gdalwarp set target extents to -180 -90 180 90?

August 24Hits:2
Advertisement

I'm using gdalwarp with the -te option and it doesn't appear to be working like I expected.

I'm running a command like:

gdalwarp -of GTiff -te -180 -90 180 90 -tr 0.1 0.1 -t_srs EPSG:4326 input.tif output.tif 

or

gdalwarp -of GTiff -te -180.0 -90.0 180.0 90.0 -tr 0.1 0.1 -t_srs EPSG:4326 input.tif output.tif 

But when I run gdalinfo after executing gdalwarp I get this:

Upper Left  (-180.0000000,  90.0000000) (180d 0'0.00"W, 90d 0'0.00"N) Lower Left  (-180.0000000, -89.9903092) (180d 0'0.00"W, 89d59'25.11"S) Upper Right ( 179.9806183,  90.0000000) (179d58'50.23"E, 90d 0'0.00"N) Lower Right ( 179.9806183, -89.9903092) (179d58'50.23"E, 89d59'25.11"S) Center      (  -0.0096908,   0.0048454) (  0d 0'34.89"W,  0d 0'17.44"N) 

How can I create a geotiff where the extents with the following values?

Upper Left  (-180.0000000,  90.0000000) (180d 0'0.00"W, 90d 0'0.00"N) Lower Left  (-180.0000000, -90.0000000) (180d 0'0.00"W, 90d 0'0.00"S) Upper Right ( 180.0000000,  90.0000000) (180d 0'0.00"E, 90d 0'0.00"N) Lower Right ( 180.0000000, -90.0000000) (180d 0'0.00"E, 90d 0'0.00"S) Center      (   0.0000000,   0.0000000) (  0d 0'0.00"W,  0d 0'0.00"N) 

Answers

I think you need to specify the -ts option rather than the -tr option. In other words, you know the exact size of your output array, so specify it rather than let GDAL calculate it. Otherwise, gdalwarp tries to calculate it (note sure where this is in the codebase, but see this.

Tags:gdalwarp

Related Articles

  • How do I make gdalwarp set target extents to -180 -90 180 90?August 24

    I'm using gdalwarp with the -te option and it doesn't appear to be working like I expected. I'm running a command like: gdalwarp -of GTiff -te -180 -90 180 90 -tr 0.1 0.1 -t_srs EPSG:4326 input.tif output.tif or gdalwarp -of GTiff -te -180.0 -90.0 18

  • Cutting image using gdalwarp to extent of dataNovember 26

    I am currently generating a raster from point data and applying inverse distance algorithm. This image is then cut with : gdalwarp -cutline <<src shape file>> -crop_to_cutline -srcnodata 0 results_in.tiff results_out.tiff Is there a way to cut

  • gdalwarp results in incorrect extentAugust 31

    I have a GeoTIFF that's 172800x86400 on the MODIS "250 meter" Sinusoidal grid (more like 231.7, but who's counting?). (You can find its metadata at the bottom of this post.) This bounty of resolution has turned out to be quite a pain. My goal is

  • Cropping Geotiff with gdalwarpDecember 9

    I downloaded a geotiff from the recently published 25m-DEM of the European Union (see: http://courses.neteler.org/eu-dem-new-digital-surface-model-at-25m/). One tile has about 5GB so I would like to crop it to a smaller extend. I'm trying to use gdal

  • Using gdalwarp with multiple elevation models

    Using gdalwarp with multiple elevation modelsSeptember 4

    I'm trying to use gdal_warp to slice and convert some SRTM data. The data I'm interested in are in S30E152.hgt and S30E153.hgt. What I'd like to do is: Convert these DEM files from EPSG:4326 to EPSG:3857 Select a subsection of the data at coordinates

  • Use gdalwarp to crop area with simple coordinate systemAugust 18

    I'm new to GIS and trying to cut image with gdalwarp I need image projected like google map and I need to input coordinates of area of interest in latidute longitute system, like: from 45.3 10.2 to 45.8 10.5 Source file as this info: PROJCS["WGS 84 /

  • gdalwarp resampling problemsJanuary 19

    I'm trying to clip and resample a raster to match the dimensions and resolution of another raster. Here's my gdalwarp command: gdalwarp -t_srs EPSG:4326 -te 102.3375307079206 14.6874037407838 107.6323189079206 10.350077240783799 -tr 0.000833299999999

  • Overlaying Shapefile with projection and raster (without projection but with defined extent) using QGIS?March 31

    I'm trying to overlay a shape file into a raster. The raster has no defined projection but it's a global raster with extent 0, -1800 : 3600, 0. I tried "on the fly CRS" transformation and followed the projection of my shape file, and yeah they a

  • How to unproject a UTM ESRI Shapefile over WGS84 extent boundaries

    How to unproject a UTM ESRI Shapefile over WGS84 extent boundariesJanuary 25

    Background: I am working on a collaborative project in Python that uses GDAL/OGR to work with rasters and vectors. There is one function that attempts to project one ESRI Shapefile's coordinate system into another. This is done by creating a coordina

  • Predicting enemy position in order to have an object lead its target

    Predicting enemy position in order to have an object lead its targetOctober 30

    In my 2D game I have AI turrets that should assist the player by automatically firing towards enemies. I would like to make them fire intelligently and lead their target instead of just targeting an enemy's current position. So, given the (always con

  • How to clip raster image by the extent of each row in a shapefile with ArcGIS 9.3June 19

    I'm using Python to clip a raster image by each row in a shapefile with ArcGIS 9.3. I am hoping to end up with one raster image for each polygon row, clipped to the extent of the polygon row. However, my current script clips the raster to the entire

  • When a raster is clipped to a polygon with Python, why does it still take on the extent of the entire shapefile?June 20

    I am clipping a raster image to each polygon row in a shapefile in ArcMap 9.3 using the Clip tool (Data Management) in Python with Clipping Geometry set. While the clipped raster successfully depicts the intersection of the raster and the polygon, th

  • Count raster value in a bounding box (spatial extent)

    Count raster value in a bounding box (spatial extent)September 22

    I have simple question: given a bounding box, how can I count the number of specific values (say, I am interested in the number of value == 1 ) in a raster in 1) arcpy, or 2) raster package in R? --------------Solutions------------- In R, use crop to

  • OpenLayers: constraint a map extent and fit a div

    OpenLayers: constraint a map extent and fit a divOctober 2

    I need to display a map with a world extension -18,-90,180,90. I want the map on the initial view to fit in the div. I tried to define the div proportionally to the map extent, but it does not work: the map displays vector before lon=-180° and after

  • Openlayers using Google Maps as base layer: possible to zoom out farther than max extent?

    Openlayers using Google Maps as base layer: possible to zoom out farther than max extent?November 20

    See attached picture. This is how it is when the page loads. I'm currently using map.zoomToMaxExtent(); Everything is working pretty well but I'd like to zoom out more/see the whole world using OSM/Google Map Layers: is this even possible? Note that

  • Applying unique processing extent to each iteration of tool in ArcMAP Model Builder

    Applying unique processing extent to each iteration of tool in ArcMAP Model BuilderDecember 23

    I am trying to create an automated ArcMAP (10.1) tool that will read in a file (ASCII most likely) of maximum and minimum lat/long values along with some additional variables. The tool will iterate over each row of this file, and run the processes on

  • Calculate turn rate between xy and target xy on a moving sprite with variable speed

    Calculate turn rate between xy and target xy on a moving sprite with variable speedFebruary 17

    My First question on here so be kind... I am writing an aerodrome simulator in as2, I need to calculate a turn rate between 2 points so that the aircraft turns nicely. I have tried a few things but the maths forums on this type of subject use complex

  • User signup Exact Target (Ruby)April 21

    I have been trying to find examples of using the Savon gem with Rails to connect to the SOAP endpoint. Before Exact Target recomended the Fuel SDK but this doesn't seem to be supported anymore. It would of been as simple as following this example. An

  • Wrapping WTMS image & map extentMay 26

    I'm using OpenLayers 3 (both v3.4 and v3.5) to display a tiled image from a NASA WMTS server and have a question about using the layer wrapX parameter on a global map. When I set wrapX=true in the layer specification, I can pan left and right, but th

  • gdalwarp reprojection causes missing data

    gdalwarp reprojection causes missing dataJune 30

    I have tried to reproject and resample an SRTM DEM file from WGS84 to a cylindrical equal area projection. The problem is there is missing data as seen in the image below. The command I use is: gdalwarp -s_srs WGS84 -t_srs ogcwkt.prj -r near -multi -

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 2.256 s.