I have a set of data that is essentially an array of coordinates (WGS84) and values.  Example:      51.5834,-101.1709,0.0452,51.5834,-101.1567,0.0648,51.5834,-101.1425,0.0339,51.5924,-101.2133,0.0339,51.5924,-101.1992,0.0365   This data values are ~1.079km apart. Since it is approximate gdal_translate cannot be used.  I would like to convert this data into a GeoTIFF that is projected into Web Mercator. I understand that some sort of gridding will have to occur.  I believe the current system is using the dimensions of pixels (at zoom level 8) as a sort of gridding system. I may not be 100% correct as reading C++ code (especially this code) is very confusing.   It calculates what pixel the latitude/longitude will intersect and applies the value there and somehow applies that to the GeoTIFF, which is then used to output tiles (using a Gdal2Tiles script)  However, I would like to do this with the standard GDAL tooling rather then some custom C++ code.   Is this possible? Basically taking a latitude/longitude/value CSV and converting that to a gridded Web Mercator GeoTIFF?
122012
I have a huge amount of data in the form of CSV containing UTM coordinates as X and Y and an elevation value as Z information. I need to convert these data into a DEM as GeoTIFF for further analysis. In this case, a huge amount means 16 m. lines, with one point in X, Y and Z per line. The points are equally distributed, therefore an interpolation is not needed; each point just needs to be converted into a raster cell.  The original data came without separator, with fixed column widths. I already figured out how to convert the file syntax to use a separator instead of fixed widths and eliminate all space characters, using the stream text editor sed. From here on, normally my workflow would be to import the data into ArcGIS by creating a feature class from the X, Y and Z data and as a second step, converting the point shapefile into a GeoTIFF, using the Point to Raster tool. However, the file I currently have is way too big for this process.  Instead of the above described workflow, I was looking for an efficient alternative and discovered GDAL. However, in gdal_translate, the closest supported format I can find in the supported filetype list, is ASCII grid but no comma separated XYZ. Another difficulty is, that I have UTM coordinates, while most examples seem to use decimal degree coordinates. However, I need to stay within the UTM system (or at least, my output GeoTIFF needs to be in a UTM coordinate system).  So I am looking for a way to convert the CSV XYZ into a GeoTIFF, using GDAL, but so far wasn't able to find examples dealing with this exact problem. I would be very happy for some hints or even code examples.
41318
I'm working on a school project. I have  from Sacramento, California   I want to convert the XY coordinates to latitude and longitude, in order to import it into tableau and use its mapping features.   I also have the address, if that makes it easier.  I have about 10,000 records, so I need a powerful tool to perform this conversion.
9430
I am having an issue with buffer. My data is in Geographic coordinate system. I am trying to do a buffer of 600m and i am finding different results for each case, have tried thse so far:    Map in web maercator map in UTM zone 12 map in geogaphic coordinate   I am missing some data points due to this and wanted to check how I can resolve this issue. I know that UTM is the most accurate projection for distance but I wanted to know if by using WebMercator map if there is a way to get correct buffer results , any ideas? Thanks jay
81880
I received several shapefiles from an colleague that he told me is in WGS:84. If I look at the metadata in Qgis it tells me the following:  In layer spatial reference system units xMin,yMin 3572722.82,5453423.31 : xMax,yMax 3582448.25,5462926.22 Layer Spatial Reference System +proj=longlat +datum=WGS84 +no_defs   Now when I try to save it in another projection say WGS:84 Pseudo Mercator (EPSG: 3857) it gives me the following:   Export to vector file failed.     Error: Failed to transform a point while drawing a feature with ID '1'. Writing stopped. (Exception: forward transform of     (62425.896446, 95242.109906)     PROJ.4: +proj=longlat +datum=WGS84 +no_defs +to +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs     Error: latitude or longitude exceeded limits)   A similar message is returned in R with the rgdal package. I suspect that the initial projection is somehow wrong.   Is it truly WGS84?   The problem occurs with all shapefiles.  ogrinfo -so    tells me:  INFO: Open of `XXX.shp'       using driver `ESRI Shapefile' successful. 1: XXXABC (Polygon)
81956
I have two raster datasets, they have different projected coordinate systems; one in WGS_84_UTM_Zone_N34, another in Hungarian_1972_EOV,  they overlap each other perfectly if I open them in QGIS.   I would like to transform the coordinate system of the first raster into the second.  I tried Project Raster tool in Data Management toolbox (ArcGIS), it converted the first raster into Hungarian_1972_EOV, but it doesn't overlap with the second raster perfectly (There is a shift between two raster datasets fo about 10-15 meters).   Can anybody help me to find out what is the problem?
100713
I have a HDF file that I want to convert to tif or ENVI file.  I know that the +Proj of the original file is: "+proj=cea +lon_0=0 +lat_ts=30 +ellps=WGS84 +units=m"  so:    gdal_translate -of "ENVI" -a_srs "+proj=cea +lon_0=0 +lat_ts=30 +ellps=WGS84 +units=m" HDF5 file.h5  output.img   but I found that the projection was not defined but instead I got this:         ENVI      samples = 1000      lines   = 500      bands   = 1      header offset = 0      file type = ENVI Standard      data type = 4      interleave = bsq      byte order = 0   My question how to deal with geo points?
83518
I have an ESRI GRID file projected in MODIS-Sphere (here's the dataset ) that I need to convert to a WGS84 GeoTIFF.  I tried Raster > Projections > Warp (Reproject) and got this nonsense:   I then thought I'd use the MODIS reprojection tool or HEG to convert it, but they only accept HDF files and using QGIS' warp or translate functions to convert this file to HDF throwns an error. This guy was trying to do the same thing in Arc, no joy:   I looked for clues in the metadata, and the file seems a little goofy; gdalinfo yields:  Driver: AIG/Arc/Info Binary Grid Files: seto_uf        seto_uf.aux        seto_uf/.aux.xml        seto_uf/.DS_Store        seto_uf/dblbnd.adf        seto_uf/hdr.adf        seto_uf/log        seto_uf/metadata.xml        seto_uf/sta.adf        seto_uf/vat.adf        seto_uf/w001001.adf        seto_uf/w001001.tif        seto_uf/w001001.tif.aux.xml        seto_uf/w001001x.adf Size is 7468, 2911 Coordinate System is `' Origin = (-17345341.010356999933720,8423784.764957003295422) Pixel Size = (5000.000000000000000,-5000.000000000000000) Corner Coordinates: Upper Left  (-17345341.010, 8423784.765)  Lower Left  (-17345341.010,-6131215.235)  Upper Right (19994658.990, 8423784.765)  Lower Right (19994658.990,-6131215.235)  Center      ( 1324658.990, 1146284.765)  Band 1 Block=256x4 Type=Byte, ColorInterp=Undefined   Description = Seto_UF   Min=0.000 Max=101.000    NoData Value=255   So it can't determine the coordinate system.  There's a .tif included in the directory, but gdalinfo on that shows:  Driver: GTiff/GeoTIFF Files: w001001.tif        w001001.tif.aux.xml Size is 7468, 2911 Coordinate System is: GEOGCS["Unspecified datum based upon the GRS 1980 Authalic Sphere",     DATUM["unknown",         SPHEROID["unnamed",6371007,1]],     PRIMEM["Greenwich",0],     UNIT["degree",0.0174532925199433],     AUTHORITY["EPSG","4047"]] Origin = (-17345341.010356999933720,8423784.764957003295422) Pixel Size = (5000.000000000000000,-5000.000000000000000) Metadata:   AREA_OR_POINT=Area Image Structure Metadata:   INTERLEAVE=BAND Corner Coordinates: Upper Left  (-17345341.010, 8423784.765)  Lower Left  (-17345341.010,-6131215.235)  Upper Right (19994658.990, 8423784.765)  Lower Right (19994658.990,-6131215.235)  Center      ( 1324658.990, 1146284.765)    So it says the units are degrees but those huge corner coordinates and origin values don't agree.  Any ideas?  My setup: OSX 10.9.4 QGIS 2.6.1 Brighton GDAL 1.11.2 (apparently there are newer versions but this is the latest you can get on OSX without having to compile it yourself)
110216
In R, it's relatively trivial to perform per pixel calculations based on a raster stack (e.g., get std.dev for each pixel on a 12 layer GeoTIFF). Unfortunately, the speed is less than desirable when working with large rasters.  Recently, I've been trying to use GDAL for this purpose, but I can't seem to get the expression down. I've tried the following, but it doesn't seem to work as advertised (or how I think it should work):  gdal_calc.py -A tmean_monthly_1980.tif --calc="std(A)" --outfile=tstdev_1980.tif --allBands=A --calc="std(A)" --NoDataValue=-9999   In the above example tmean_monthly_1980.tif is a raster composed of 12 layers (Jan-Dec) of mean monthly temperatures in 1980 (stacked using gdal_merge). Although the GDAL command produces an output, the results are definitely not the standard deviation per pixel.  Another option might be to use single band files, but gdal_calc.py appears limited to "only" 26 inputs (A-Z; i.e., "-A file -B file -C file etc."), and the resulting command line/script would be fairly cumbersome when working with large, multi-layered rasters (e.g., time series).  Is there a specific syntax for performing per-pixel raster calculations on a multi-band image using GDAL? If only individual files/bands can be specified using gdal_calc.py, please provide a scripted example using Bash, Python, etc.  Specifically, my goal is to calculate the standard deviation and cv for each pixel in a multi-layer raster stack, or using individual files that make up the same raster stack.  Note: I'm holding out for a GDAL specific answer, but other FOSS solutions are welcomed and will be upvoted, especially if they are relatively compact and adaptable to large number of inputs.
50289
I'm writing an isometric 2D game and I'm having difficulty figuring precisely on which tile the cursor is. Here's a drawing:    where xs and ys are screen coordinates (pixels), xt and yt are tile coordinates, W and H are tile width and tile height in pixels, respectively. My notation for coordinates is (y, x) which may be confusing, sorry about that.  The best I could figure out so far is this:  int xtemp = xs / (W / 2); int ytemp = ys / (H / 2); int xt = (xs - ys) / 2; int yt = ytemp + xt;   This seems almost correct but is giving me a very imprecise result, making it hard to select certain tiles, or sometimes it selects a tile next to the one I'm trying to click on. I don't understand why and I'd like if someone could help me understand the logic behind this.  Thanks!
17923
I have an array in the form of 'int[][]' that represents the co-ordinates of a small grid. Each co-ordinate has been assigned its own value. eg array[0][4] = 28......  I have two questions. Firstly, how do I iterate through all the stored values. Secondly, I want to be able to input a value and have its specific co-ordinates in the grid returned. What would be the best way to approach this?  Thank you for any help!
57654
I stand on the following tricky situation:  I have a node with geofield coordinates attached. I am constructing an array of points. Something like:  Array ( [86] =&gt; Array     (         [0] =&gt; Array             (                 [lat] =&gt; 39.1641410477                 [lon] =&gt; -2.633972168             )          [1] =&gt; Array             (                 [lat] =&gt; 41.0420738489                 [lon] =&gt; -2.633972168             )          [2] =&gt; Array             (                 [lat] =&gt; 41.0420738489                 [lon] =&gt; 1.2524414063             )          [3] =&gt; Array             (                 [lat] =&gt; 39.1641410477                 [lon] =&gt; 1.2524414063             )         [4] =&gt; Array             (                 [lat] =&gt; 39.1641410477                 [lon] =&gt; -2.633972168             )     )  [85] =&gt; Array     (         [0] =&gt; Array             (                 [lat] =&gt; 39.1641410477                 [lon] =&gt; -2.633972168             )          [1] =&gt; Array             (                 [lat] =&gt; 41.0420738489                 [lon] =&gt; -2.633972168             )          [2] =&gt; Array             (                 [lat] =&gt; 41.0420738489                 [lon] =&gt; 1.2524414063             )          [3] =&gt; Array             (                 [lat] =&gt; 39.1641410477                 [lon] =&gt; 1.2524414063             )         [4] =&gt; Array             (                 [lat] =&gt; 39.1641410477                 [lon] =&gt; -2.633972168             )     ) )   I want to pass this to my-googlemaps.js in order to be used by google's init map Google map is defined as:  my-map:   header: true js:   js/my-googlemaps.js: { }   https://maps.googleapis.com/maps/api/js?key=my_key&amp;callback=initMap: {type: external, attributes: {defer: true,async: true}} dependencies:   - core/drupal   - core/drupalSettings  my-googlemaps.js:   console.log(Drupal.settings);   function initMap() {}   This way I get Drupal.settings undefined, which makes sense I guess. On the other hanve if I place initMap into a behavior It can not be seen as a callback as defined in googleapis.com before.  Has anyone stumbled with this before? Any idea how to attack the problem?
5404
I have a few digital images that are not georeferenced. E.g.:  Img01.tif   Img02.tif   ... Img99.tif     On the other hand, I have a text file, which contains georeferencing information for these images. E.g., I have a file c:\tfws\list.txt which contains the following information:  Img01.tfw 0.25 0 0 - 0.25 456258,125 4569852,125   Img02.tfw 0.25 0 0 - 0.25 456586,125 4570001,125    Img03.tfw 0.25 0 0 - 0.25 456952,125 4570300,125   ... Img99.tfw 0.25 0 0 - 0.25 458412,125 4575123,125     I need to generate a TFW file for each image in the text file. E.g. create a file named C:\tfws\img??.tfw containing the following information:  0.25   0   0   -0.25   456258,125   4569852,125     Does anyone know of a tool able to generate these TFW files automatically?
40698
I'm looking for an algorithm which when given a latitude and longitude pair and a vector translation in meters in Cartesian coordinates (x,y) would give me a new coordinate. Sort of like a reverse Haversine. I could also work with a distance and a heading transformation, but this would probably be slower and not as accurate. Ideally, the algorithm should be fast as I'm working on an embedded system. Accuracy is not critical, within 10 meters would be good.
37219
I have an ASCII file with latitude, longitude, and data_val in the following format.  35-13.643782N, 080-57.190157W, 118.6 ...   I have a GeoTiff image file, and I can easily view it.  I want to place a "pin" (can be a dot/flag/star or whatever is easiest) on the image at the specific latitude/longitude position found in the ASCII file.  Here is what I've managed to do so far:  My source image looks like this:  Driver: GTiff/GeoTIFF Files: /tmp/Charlotte SEC 100.tif Size is 16867, 12358 Coordinate System is: PROJCS["Lambert Conformal Conic",     GEOGCS["NAD83",         DATUM["North_American_Datum_1983",             SPHEROID["GRS 1980",6378137,298.2572221010042,                 AUTHORITY["EPSG","7019"]],             AUTHORITY["EPSG","6269"]],         PRIMEM["Greenwich",0],         UNIT["degree",0.0174532925199433],         AUTHORITY["EPSG","4269"]],     PROJECTION["Lambert_Conformal_Conic_2SP"],     PARAMETER["standard_parallel_1",38.66666666666666],     PARAMETER["standard_parallel_2",33.33333333333334],     PARAMETER["latitude_of_origin",34.11666666666667],     PARAMETER["central_meridian",-78.75],     PARAMETER["false_easting",0],     PARAMETER["false_northing",0],     UNIT["metre",1,         AUTHORITY["EPSG","9001"]]] Origin = (-365041.822331817995291,240536.419747152860509) Pixel Size = (42.334586069440391,-42.334898968590878) Metadata:   AREA_OR_POINT=Area   TIFFTAG_DATETIME=2016:06:24 12:46:45   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)   TIFFTAG_SOFTWARE=Adobe Photoshop CS5 Windows   TIFFTAG_XRESOLUTION=300   TIFFTAG_YRESOLUTION=300 Image Structure Metadata:   COMPRESSION=LZW   INTERLEAVE=BAND Corner Coordinates: Upper Left  ( -365041.822,  240536.420) ( 82d48'55.43"W, 36d13' 4.92"N) Lower Left  ( -365041.822, -282638.262) ( 82d35'10.11"W, 31d30'17.00"N) Upper Right (  349015.641,  240536.420) ( 74d51'46.40"W, 36d13'26.16"N) Lower Right (  349015.641, -282638.262) ( 75d 4'55.60"W, 31d30'36.99"N) Center      (   -8013.091,  -21050.921) ( 78d50'12.11"W, 33d55'36.35"N) Band 1 Block=16867x1 Type=Byte, ColorInterp=Palette   Color Table (RGB with 256 entries)     0: 255,255,255,255 ...   Here is what I've managed to cobble together in Python:  from osgeo import gdal, osr  src_filename = '/tmp/Charlotte SEC 100.tif' dst_filename = '/tmp/foo.tiff'  # Opens source dataset src_ds = gdal.Open(src_filename) format = "GTiff" driver = gdal.GetDriverByName(format)  # Open destination dataset dst_ds = driver.CreateCopy(dst_filename, src_ds, 0)  # Specify raster location through geotransform array # (upperleftx, scalex, skewx, upperlefty, skewy, scaley) # Scale = size of one pixel in units of raster projection # this example below assumes 100x100 gt = [-365041.822, 100, 0, 240536.420, 0, -100]  # Set location dst_ds.SetGeoTransform(gt)  # Get raster projection epsg = 4269            # http://spatialreference.org/ref/sr-org/lambert_conformal_conic_2sp/ srs = osr.SpatialReference() srs.ImportFromEPSG(epsg) dest_wkt = srs.ExportToWkt()  # Set projection dst_ds.SetProjection(dest_wkt)  # Close files dst_ds = None src_ds = None   But, I can't quite figure out how to place a "red dot" at 35-13.643782N, 080-57.190157W  I'm having to learn some new details here (nomenclature about GIS).
72378
I have float raster and now I want to convert it to vector. How is it possible with the Python GDAL library?  I have tried with gdal_polygonize.py of GDAL utilities on the command line and it worked excellently. But this utility is based on GDALPolygonize() of C++ library and I want to C++ method GDALFPolygonize() to be used instead, which manipulates float raster data as far as I know.
92204
I have a text file containing exactly this:  POLYGON ((6.2973716 48.98613 1772.1, ... many other Long Lat Altitude values ... ))   And only this. It seems to be just like a WKT geometry of a polygon. But it's only a text file.     I'd like to create an "ESRI Shapefile" from this file, if possible with tools that are available without any installation on Windows.  I've tried GDAL so far but it doesn't seem to handle such files.
38524
I need to extract the Lat/long coordinates of the centroids of districts. My QGIS project SCR and the different layers have all been set on "WGS 84 / UTM zone 18N".   I've created the centroids using the usual tool. I could then extracted the coordinates using the "Vector > Geometry Tools > Export/Add Geometry Columns", or saving the layer in CSV typing "GEOMETRY=AS_XY" in the "Layers" part of the "OGR creation options".  Nevertheless, both methods output Cartesian coordinates, whereas I need Lat/long coordinates.